OpenClaw EnterpriseDOCSGitHub

OpenShell Credential Gateway

The bundled OpenShell Credential Gateway stores OCC credential sources as OpenShell providers. The OpenShell supervisor applies them at its egress proxy, so the dedicated Codex Harness never receives the real model key. It implements the CredentialGatewayDriver contract and works only with the OpenShell SandboxDriver, through one shared openshell Backend.

This Driver does not make OpenShell a supported production path. It removes the model API key from the list of upstream blockers; the app-server token, workload identity, workspace mounts, plugin-runtime files, and exposed-route authorization still fail closed on stock OpenShell v0.1.0.

Configure the Driver

Select drivers.credential_gateway with the OpenShell Backend and Sandbox in trusted Installation YAML. All three IDs must match:

yaml
backend:  - id: openshell    type: openshell    configuration:      endpoint: https://openshell-gateway.openshell-system.svc:8080      auth:        mode: bearerTokenFile        path: /etc/openclaw/openshell/token      rootCertificatePath: /etc/openclaw/openshell/ca.crt    drivers:      sandbox: openshell-sandbox      credential_gateway: openshell-credentialsdrivers:  sandbox:    id: openshell-sandbox    configuration:      gateway:        workspaceMode: operator      # See openshell-sandbox.md for the remaining Sandbox settings.  credential_gateway:    id: openshell-credentials    configuration:      binaries:        - /path/to/codex

binaries is required and closed: a nonempty list of absolute executable paths inside the Harness image. OpenShell releases a credential only to requests made by those binaries. Use the exact native Codex executable, not a wrapper script. A stale path fails closed at the Codex startup model probe.

Startup rejects the selection when:

Both the API and the worker connect to the gateway with the Backend's credentials. The API registers and deletes providers; the worker creates Sandboxes and reads attachment status. Allow both to reach the gateway.

Source-type catalog

Type Secret fields Config fields Rotation Harness authentication
openai api_key (required) None none openai / api_key

Other OpenShell provider types are not in the catalog, so registration rejects them.

How sources map to OpenShell

Each OCC Namespace maps to one operator-mode OpenShell Workspace with the same name as its Kubernetes namespace. The Driver manages two objects in that Workspace:

sourceStatus reports ready for an owned provider, absent when it is missing, and failed when a provider with that name is not owned by the source.

removeSource deletes the owned provider and confirms that it is gone. When no provider of the profile's type remains, it also deletes the profile, because OpenShell cannot delete a Workspace that still holds profiles.

For a revision, attachForRevision returns each source's provider name. The OpenShell SandboxDriver appends those names to SandboxSpec.providers. attachmentStatus calls GetSandboxProviderStatus for each provider and maps OpenShell readiness states to ready, withheld, revoked, failed, or pending.

In the running Sandbox, the Harness environment holds only an openshell:resolve:env: placeholder for OPENAI_API_KEY. codex login --with-api-key stores that placeholder, and the supervisor proxy substitutes the real key on matching requests.

Trust requirements

What the boundary covers

The boundary keeps the key away from the Harness and from ordinary OpenShell reads, not from OpenShell administrators or OCC itself. On the pinned OpenShell revision:

Limits

Verification

The OpenShell real Sandbox suite registers a source through the API, deploys a dedicated Codex Agent that uses it, and checks that every Harness process sees only the placeholder. The Sandbox Driver startup integration covers Backend membership and selection rules.

Troubleshooting

Symptom or message Cause and fix
drivers.credential_gateway requires an owning backend entry with type openshell. Add the openshell Backend.
backend[…].drivers.credential_gateway must match … Make the Backend member IDs match the selected Driver IDs.
OpenShell Credential Gateway binaries must be a nonempty list of absolute paths. Correct binaries.
Registration returns 503 Check that the API reaches the gateway, the token file is mounted, and the Workspace exists.
Registration returns 404 for a name conflict A provider named for this source exists without OCC's labels. Remove it in OpenShell, then retry.
The revision stays inactive with a failed or withheld attachment Check the provider in OpenShell and the Sandbox's GetSandboxProviderStatus reason.
Codex startup fails its model probe Confirm binaries names the exact Codex executable and that Codex trusts the Sandbox CA.
Search documentation