#New Secrets Manager
1 messages · Page 1 of 1 (latest)
OpenClaw’s “secrets manager” is basically SecretRefs + secret providers. You can keep using plaintext keys, but the new flow lets you store references in config/auth files and have the Gateway resolve the actual secret at startup (and on reload) into an in-memory snapshot.
Docs:
- Secrets overview + config fields: https://docs.openclaw.ai/gateway/secrets
- CLI commands (
audit/configure/apply/reload): https://docs.openclaw.ai/cli/secrets
The quickest way (recommended): migrate interactively
Run this on the Gateway host:
openclaw secrets audit --check
openclaw secrets configure
openclaw secrets audit --check
openclaw secrets reload
What you get:
audittells you where secrets are still stored in plaintext (openclaw.json,auth-profiles.json,.env, legacyauth.json)configurewalks you through:- setting up secret providers (
env,file, orexec) - mapping secret-bearing fields to SecretRefs
- preflighting resolution
- (optionally) applying + scrubbing old plaintext residues
- setting up secret providers (
reloadre-resolves refs and atomically swaps the runtime secrets snapshot (no partial state)
What a SecretRef looks like
Same shape everywhere:
{ source: "env" | "file" | "exec", provider: "default", id: "..." }
Examples:
1) Pull from an env var
{ source: "env", provider: "default", id: "OPENAI_API_KEY" }
2) Pull from a local JSON secrets file (JSON pointer)
~/.openclaw/secrets.json:
{ "providers": { "openai": { "apiKey": "sk-..." } } }
Config ref:
{ source: "file", provider: "filemain", id: "/providers/openai/apiKey" }