OpenClaw EnterpriseDOCSGitHub

Database entities cheat sheet

Look up the SQL table and column names stored by OpenClaw Control Plane (OCC). The tables below are in the occ PostgreSQL schema; use occ."user" when querying the user table.

The database schema defines columns and constraints. The repository-credentials migration adds the repository binding and session-attempt storage below. The Drizzle migration-history table, drizzle.__drizzle_migrations, is excluded. See migration history for supported database states and platform repositories for how OCC reads and writes its data.

Platform resources

installation

Stores the single OCC Installation record.

namespaces

Tracks platform Namespaces, their lifecycle status, and any existing Kubernetes namespace they use.

agents

Stores Agent drafts, their desired runtime state, and the selected version reference.

sandbox_policies

Stores one Agent-owned desired network policy with versioned application evidence. See per-Agent policies.

agent_revisions

Stores numbered, immutable snapshots of Agent settings accepted for deployment. admitted_spec includes the explicit v2 execution admission decision.

workspace_setups

Holds private initial workspace input for one exact Namespace and Agent. Activation completion clears files; setup identity and completion metadata remain until Agent deletion. See the workspace setup flow.

configurations

Stores each Agent Configuration’s current generation and Secret bindings; the Driver stores values.

presets

Stores reusable Agent launch templates and variable definitions within one Namespace.

secrets

Stores Secret metadata and backend references; Secret values are kept by the selected Driver.

connection_templates

Stores the scope and current version of each OAuth connection template.

oauth_connection_template_versions

Pins the approved OAuth configuration and the HTTPS destinations that can receive the credential. A discovered version also retains the MCP metadata observed when the administrator saved it.

oauth_clients

Identifies an independently managed OAuth client and its approved credential destinations. OCC uses the registration ID to locate a confidential client’s private value on the owning Secret Driver. A cleanup deadline keeps an unpublished or deleted client hidden until private cleanup completes.

saved_connections

Records the Namespace, consenting principal, approved template version and revocation status of a saved account.

connection_sessions

Stores the private, single-use OAuth attempt for the initiating principal and browser session.

connection_token_custody

Tracks the Token Service secret reference, the published access token version and the next refresh time.

credential_sources

Records the owner of each source. A Credential Gateway or Credential Proxy source identifies its admitting Driver. The Token Service owns saved account sources.

egress_installations

Binds authenticated supervisor/Sandbox identity and an immutable loaded-enforcement instance/configuration fingerprint to the exact admitted revision plan. See protected inference.

credential_deliveries

Tracks delivery custody for the exact Namespace, Agent and revision. See the repository flow.

credential_delivery_reductions

Retains material-delivery and execution-policy reduction requests for static and repository bindings. An unobserved request cannot be sent again. See the policy reduction flow.

prepared_github_families

Owns prepared token issuance and renewal for an explicitly admitted source.

prepared_github_attempts

Retains issuance and disposal custody, including unknown outcomes. Authenticated expiry is distinct from confirmed revocation. A refusal with no token is not_issued. An unknown outcome settles after GitHub's maximum token lifetime from started_at.

prepared_repository_git_uses

Append-only records of possible disclosure, bound to the exact attempt and material version.

prepared_repository_draft_pulls

Retains the single draft-creation allowance for a grant, independently of later PR updates.

protected_repository_git_recipients

Records where the selected Driver observed the protected Git recipient and which token version it installed. If the installation result is unknown, state stays installing. The sender must still get permission for each Git request.

egress_send_receipts

Retains exact sender attempts and safe observations independently of final delivery proof. See protected inference.

egress_rejected_material

Fences a provider-rejected version independently of later authoritative rereads.

agent_credential_sources

Mirrors each Agent draft's credential_sources through a trigger, so the database refuses to delete a source an Agent still binds.

credential_source_secrets

Links each credential source secret field to the Namespace Secret that supplied it.

credential_withdrawals

Records one credential source withdrawn from one Agent revision, until the gateway confirms revocation.

service_accounts

Stores Namespace service accounts and any credential Secret references.

service_account_driver_bindings

Links managed accounts to a Backend, Driver, upstream account, workspace, and any issued credential.

repository_session_attempts

Retains repository-session identity and cleanup context after AgentRevision deletion.

repository_broker_receipts

Retains nonsecret admission fences and broker-confirmed terminal evidence for an exact attempt.

Identity and access

iam_identities

Stores human Principals and service identities, including those owned by an Agent.

iam_groups

Defines native IAM groups at Installation or Namespace scope, including the configured Groups (group_config_ IDs), which OCC can delete.

iam_group_memberships

Links human Principals to their native IAM groups. Rows cannot be updated; memberships of a configured Group can be deleted.

iam_roles

Defines native IAM roles as sets of actions and resource kinds. Only configured Roles (role_config_ IDs) can change; a check constraint keeps them at Installation scope without installation permissions.

iam_access_bindings

Grants a native IAM role to an identity or group, optionally for a specific resource. OCC also writes configured Group bindings and the Owner bindings of creators here.

iam_restrictions

Defines native IAM rules that deny actions on a resource kind or specific resource, overriding grants.

Audit and controller

audit_events

Keeps an append-only record of bootstrap, changes to resources, and authorization denials. When Control Plane audit is enabled, it also records covered API requests, worker activity, and disclosures of Agent audit records. See the audit guide.

controller_work

Queues and tracks controller work for Namespace and Agent lifecycle changes, Agent provisioning, and version deployments.

agent_provisioning_work

Records one Agent provisioning request and its progress. Each row belongs to a controller_work row with work_kind = 'provisioning'. See the Agent provisioning flow.

Browser authentication and service API keys

user

Stores the profiles of people provisioned to sign in.

session

Stores expiring browser sessions for signed-in users.

account

Links a user to their sign-in method. Password methods store a password hash; identity-only external methods reject password and provider-token storage. See External sign-in.

human_authentication_accounts

Binds each enrolled human user to its existing Installation Principal and current account version. Disabled accounts cannot issue or use profile-bound sessions.

human_authentication_sessions

Binds an ordinary browser session to its admitted account and method versions.

human_authentication_results

Holds outstanding external sign-in results by Installation and attempt. Deleting the bound session removes its result. The application role can insert, read, and delete rows.

human_authentication_recovery

Retains the fixed existing password recovery administrator for an Installation.

human_authentication_attempts

Stores one-use external-login attempts with browser binding and a maximum five-minute lifetime. Stores the PKCE verifier, but no authorization code or provider token. Consumed attempts are deleted before exchange.

native_browser_intents

Short-lived, browser-bound native Agent launches. Consumed atomically; deleted with the parent session or revision.

native_browser_handles

Hashed Agent access handles dependent on a live parent human session.

verification

Stores expiring verification records managed by Better Auth.

apikey

Stores hashed service API keys and their settings for IAM service identities.

Search documentation