Skip to content

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.

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.*.apiKey
  • models.providers.*.headers.*
  • skills.entries.*.apiKey
  • agents.defaults.memorySearch.remote.apiKey
  • agents.list[].memorySearch.remote.apiKey
  • talk.apiKey
  • talk.providers.*.apiKey
  • messages.tts.providers.*.apiKey
  • tools.web.fetch.firecrawl.apiKey
  • plugins.entries.brave.config.webSearch.apiKey
  • plugins.entries.google.config.webSearch.apiKey
  • plugins.entries.xai.config.webSearch.apiKey
  • plugins.entries.moonshot.config.webSearch.apiKey
  • plugins.entries.perplexity.config.webSearch.apiKey
  • plugins.entries.firecrawl.config.webSearch.apiKey
  • plugins.entries.tavily.config.webSearch.apiKey
  • tools.web.search.apiKey
  • tools.web.x_search.apiKey
  • gateway.auth.password
  • gateway.auth.token
  • gateway.remote.token
  • gateway.remote.password
  • cron.webhookToken
  • channels.telegram.botToken
  • channels.telegram.webhookSecret
  • channels.telegram.accounts.*.botToken
  • channels.telegram.accounts.*.webhookSecret
  • channels.slack.botToken
  • channels.slack.appToken
  • channels.slack.userToken
  • channels.slack.signingSecret
  • channels.slack.accounts.*.botToken
  • channels.slack.accounts.*.appToken
  • channels.slack.accounts.*.userToken
  • channels.slack.accounts.*.signingSecret
  • channels.discord.token
  • channels.discord.pluralkit.token
  • channels.discord.voice.tts.providers.*.apiKey
  • channels.discord.accounts.*.token
  • channels.discord.accounts.*.pluralkit.token
  • channels.discord.accounts.*.voice.tts.providers.*.apiKey
  • channels.irc.password
  • channels.irc.nickserv.password
  • channels.irc.accounts.*.password
  • channels.irc.accounts.*.nickserv.password
  • channels.bluebubbles.password
  • channels.bluebubbles.accounts.*.password
  • channels.feishu.appSecret
  • channels.feishu.encryptKey
  • channels.feishu.verificationToken
  • channels.feishu.accounts.*.appSecret
  • channels.feishu.accounts.*.encryptKey
  • channels.feishu.accounts.*.verificationToken
  • channels.msteams.appPassword
  • channels.mattermost.botToken
  • channels.mattermost.accounts.*.botToken
  • channels.matrix.accessToken
  • channels.matrix.password
  • channels.matrix.accounts.*.accessToken
  • channels.matrix.accounts.*.password
  • channels.nextcloud-talk.botSecret
  • channels.nextcloud-talk.apiPassword
  • channels.nextcloud-talk.accounts.*.botSecret
  • channels.nextcloud-talk.apiPassword
  • channels.zalo.botToken
  • channels.zalo.webhookSecret
  • channels.zalo.accounts.*.botToken
  • channels.zalo.accounts.*.webhookSecret
  • channels.googlechat.serviceAccount via sibling serviceAccountRef (compatibility exception)
  • channels.googlechat.accounts.*.serviceAccount via sibling serviceAccountRef (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 when auth.profiles.<id>.mode = "oauth")
  • profiles.*.tokenRef (type: "token"; unsupported when auth.profiles.<id>.mode = "oauth")

Keep these details in mind when configuring your setup:

  • Auth-profile plan targets require an agentId.
  • Plan entries target profiles.*.key or profiles.*.token and write sibling refs like keyRef or tokenRef.
  • 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.json entries 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 canonical plugins.entries.<plugin>.config.webSearch.* surface.

Some credentials fall outside the scope of SecretRef. These usually involve artifacts that the system creates or manages itself.

  • commands.ownerDisplaySecret
  • hooks.token
  • hooks.gmail.pushToken
  • hooks.mappings[].sessionKey
  • auth-profiles.oauth.*
  • channels.discord.threadBindings.webhookToken
  • channels.discord.accounts.*.threadBindings.webhookToken
  • channels.whatsapp.creds.json
  • channels.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.

OpenClaw

OpenClaw Expert

Still stuck?

If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.