Configure OpenClaw SecretRef Credentials
Managing API keys and secrets can be a mess when you are trying to keep your configuration clean. You want to use external secret managers, but knowing which specific fields support these references is often a trial-and-error process.
This guide clarifies the SecretRef credential surface in OpenClaw. It helps you see exactly where you can apply external secrets and which fields are off-limits.
Supported credentials
Section titled “Supported credentials”OpenClaw focuses SecretRef support on credentials you provide manually. This system does not handle credentials that the system creates or changes on its own.
openclaw.json targets (secrets configure + secrets apply + secrets audit)
Section titled “openclaw.json targets (secrets configure + secrets apply + secrets audit)”models.providers.*.apiKeymodels.providers.*.headers.*skills.entries.*.apiKeyagents.defaults.memorySearch.remote.apiKeyagents.list[].memorySearch.remote.apiKeytalk.apiKeytalk.providers.*.apiKeymessages.tts.providers.*.apiKeytools.web.fetch.firecrawl.apiKeyplugins.entries.brave.config.webSearch.apiKeyplugins.entries.google.config.webSearch.apiKeyplugins.entries.xai.config.webSearch.apiKeyplugins.entries.moonshot.config.webSearch.apiKeyplugins.entries.perplexity.config.webSearch.apiKeyplugins.entries.firecrawl.config.webSearch.apiKeyplugins.entries.tavily.config.webSearch.apiKeytools.web.search.apiKeytools.web.x_search.apiKeygateway.auth.passwordgateway.auth.tokengateway.remote.tokengateway.remote.passwordcron.webhookTokenchannels.telegram.botTokenchannels.telegram.webhookSecretchannels.telegram.accounts.*.botTokenchannels.telegram.accounts.*.webhookSecretchannels.slack.botTokenchannels.slack.appTokenchannels.slack.userTokenchannels.slack.signingSecretchannels.slack.accounts.*.botTokenchannels.slack.accounts.*.appTokenchannels.slack.accounts.*.userTokenchannels.slack.accounts.*.signingSecretchannels.discord.tokenchannels.discord.pluralkit.tokenchannels.discord.voice.tts.providers.*.apiKeychannels.discord.accounts.*.tokenchannels.discord.accounts.*.pluralkit.tokenchannels.discord.accounts.*.voice.tts.providers.*.apiKeychannels.irc.passwordchannels.irc.nickserv.passwordchannels.irc.accounts.*.passwordchannels.irc.accounts.*.nickserv.passwordchannels.bluebubbles.passwordchannels.bluebubbles.accounts.*.passwordchannels.feishu.appSecretchannels.feishu.encryptKeychannels.feishu.verificationTokenchannels.feishu.accounts.*.appSecretchannels.feishu.accounts.*.encryptKeychannels.feishu.accounts.*.verificationTokenchannels.msteams.appPasswordchannels.mattermost.botTokenchannels.mattermost.accounts.*.botTokenchannels.matrix.accessTokenchannels.matrix.passwordchannels.matrix.accounts.*.accessTokenchannels.matrix.accounts.*.passwordchannels.nextcloud-talk.botSecretchannels.nextcloud-talk.apiPasswordchannels.nextcloud-talk.accounts.*.botSecretchannels.nextcloud-talk.apiPasswordchannels.zalo.botTokenchannels.zalo.webhookSecretchannels.zalo.accounts.*.botTokenchannels.zalo.accounts.*.webhookSecretchannels.googlechat.serviceAccountvia siblingserviceAccountRef(compatibility exception)channels.googlechat.accounts.*.serviceAccountvia siblingserviceAccountRef(compatibility exception)
auth-profiles.json targets (secrets configure + secrets apply + secrets audit)
Section titled “auth-profiles.json targets (secrets configure + secrets apply + secrets audit)”profiles.*.keyRef(type: "api_key"; unsupported whenauth.profiles.<id>.mode = "oauth")profiles.*.tokenRef(type: "token"; unsupported whenauth.profiles.<id>.mode = "oauth")
Keep these details in mind when configuring your setup:
- Auth-profile plan targets require an
agentId. - Plan entries target
profiles.*.keyorprofiles.*.tokenand write sibling refs likekeyRefortokenRef. - Auth-profile refs are part of runtime resolution and audit coverage.
- You cannot use SecretRef inputs for a profile if
auth.profiles.<id>.mode = "oauth". The system will fail fast during startup or reload if this policy is violated. - For model providers managed by SecretRef, the generated
agents/*/agent/models.jsonentries keep non-secret markers instead of resolved values. - Marker persistence comes from the active source config snapshot, not from resolved runtime values.
- For web search, if you set an explicit provider, only that key is active. In auto mode, only the first provider key that resolves by precedence is active.
- Non-selected provider refs in auto mode stay inactive until they are selected.
- Legacy
tools.web.search.*paths still work for now, but you should use the canonicalplugins.entries.<plugin>.config.webSearch.*surface.
Unsupported credentials
Section titled “Unsupported credentials”Some credentials fall outside the scope of SecretRef. These usually involve artifacts that the system creates or manages itself.
commands.ownerDisplaySecrethooks.tokenhooks.gmail.pushTokenhooks.mappings[].sessionKeyauth-profiles.oauth.*channels.discord.threadBindings.webhookTokenchannels.discord.accounts.*.threadBindings.webhookTokenchannels.whatsapp.creds.jsonchannels.whatsapp.accounts.*.creds.json
These credentials are out of scope because they are minted, rotated, session-bearing, or OAuth-durable classes. They do not work with read-only external SecretRef resolution.
If you need help setting up your secrets, check out the AI Setup Assistant.
Next steps
Section titled “Next steps”OpenClaw Expert
Still stuck?
If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.