Secrets
A Secret stores a credential for one OpenClaw Namespace. OpenClaw Control Plane (OCC) returns its ID and metadata, never its value. An Agent can use a Secret for model authentication, or its Configuration can map a Secret to a gateway environment variable. Use the path that matches the consumer:
| Credential | Where to bind it |
|---|---|
| Model API key | Agent harnessAuth; the selected Harness receives it. |
| Gateway credential, such as a Slack token | Configuration secretBindings; the selected gateway receives it. |
| Backend-issued model access token | Service accounts; this follows its own credential lifecycle. |
| Model API key held by a Credential Gateway | Credential source; the Harness receives only a placeholder. OpenShell only. |
Create and bind a Secret
For browser management, follow Manage Secrets in the console. The API procedure below supports protected-file input.
- Wait for the Namespace to become
ready. Use the Kubernetes Secret Driver procedure to send a value from a protected file. Retain thesec_…ID returned in the metadata. - Bind that ID through the Agent or its Configuration. The Secret, Configuration,
and Agent must belong to the same Namespace. Never put credential values in
Configuration
valuesor a ConfigMap. - Confirm permissions before deployment. Assigning a Secret requires the caller
to have
operateon that exact Secret. Once an Agent's draft is bound to a Secret for model authentication, every later edit of that draft, including a switch to another Secret, also requiresoperateon the Secret bound now. Deploying also requires the Agent's service principal to haveoperate. The driver guide explains who can grant it. Namespace access or possession of the Secret ID does not grant permission to consume the value.
Follow Grant the Agent access to its model Secret. This requires an administrator with access to the configured IAM authority.
Rotate or remove a Secret
Updating a Secret changes the stored value. It does not restart a workload or
change a running process's environment. Redeploy each consumer through OCE and
verify the new version. occ secret get lists the consumers you may read and
counts the others; see Find a Secret's consumers. There is no value history or automatic rotation. If a
credential is exposed, stop the affected workloads, revoke it at the upstream
provider, store a replacement, and redeploy. OCC rejects deletion while a
current Configuration, credential source, Agent draft, selected version,
pending deployment, or pending Agent provisioning request still references the
Secret; the 409 names the references you may read. See Update and redeploy.
