SecretRef 凭证表面
本页定义了规范的 SecretRef 凭证表面。 范围意图:- 范围内:严格限定为由用户提供、且 OpenClaw 不会签发或轮换的凭证。
- 范围外:运行时签发或会轮换的凭证、OAuth 刷新材料,以及类似会话的产物。
支持的凭证
openclaw.json 目标(secrets configure + secrets apply + secrets audit)
models.providers.*.apiKeymodels.providers.*.headers.*models.providers.*.request.auth.tokenmodels.providers.*.request.auth.valuemodels.providers.*.request.headers.*models.providers.*.request.proxy.tls.camodels.providers.*.request.proxy.tls.certmodels.providers.*.request.proxy.tls.keymodels.providers.*.request.proxy.tls.passphrasemodels.providers.*.request.tls.camodels.providers.*.request.tls.certmodels.providers.*.request.tls.keymodels.providers.*.request.tls.passphraseskills.entries.*.apiKeyagents.defaults.memorySearch.remote.apiKeyagents.list[].memorySearch.remote.apiKeytalk.providers.*.apiKeymessages.tts.providers.*.apiKeytools.web.fetch.firecrawl.apiKeyplugins.entries.brave.config.webSearch.apiKeyplugins.entries.exa.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.minimax.config.webSearch.apiKeyplugins.entries.tavily.config.webSearch.apiKeytools.web.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.accounts.*.apiPasswordchannels.zalo.botTokenchannels.zalo.webhookSecretchannels.zalo.accounts.*.botTokenchannels.zalo.accounts.*.webhookSecretchannels.googlechat.serviceAccount通过同级的serviceAccountRef(兼容性例外)channels.googlechat.accounts.*.serviceAccount通过同级的serviceAccountRef(兼容性例外)
auth-profiles.json 目标(secrets configure + secrets apply + secrets audit)
profiles.*.keyRef(type: "api_key";当auth.profiles.<id>.mode = "oauth"时不受支持)profiles.*.tokenRef(type: "token";当auth.profiles.<id>.mode = "oauth"时不受支持)
- auth-profile 计划目标需要
agentId。 - 计划条目以
profiles.*.key/profiles.*.token为目标,并写入同级引用(keyRef/tokenRef)。 - auth-profile 引用包含在运行时解析和审计覆盖范围内。
- OAuth 策略防护:
auth.profiles.<id>.mode = "oauth"不能与该 profile 的 SecretRef 输入组合使用。违反此策略时,启动/重载和 auth-profile 解析都会快速失败。 - 对于由 SecretRef 管理的模型提供商,生成的
agents/*/agent/models.json条目会为apiKey/标头表面持久化非秘密标记(而不是已解析的秘密值)。 - 标记持久化以源配置为权威:OpenClaw 从当前源配置快照(解析前)写入标记,而不是从已解析的运行时秘密值写入。
- 对于 Web 搜索:
- 在显式 provider 模式下(设置了
tools.web.search.provider),只有所选 provider 的键处于激活状态。 - 在自动模式下(未设置
tools.web.search.provider),只有按优先级解析到的第一个 provider 键处于激活状态。 - 在自动模式下,未被选中的 provider 引用在被选中之前会被视为未激活。
- 旧版
tools.web.search.*provider 路径在兼容期内仍会继续解析,但规范的 SecretRef 表面是plugins.entries.<plugin>.config.webSearch.*。
- 在显式 provider 模式下(设置了
不支持的凭证
超出范围的凭证包括:commands.ownerDisplaySecrethooks.tokenhooks.gmail.pushTokenhooks.mappings[].sessionKeyauth-profiles.oauth.*channels.discord.threadBindings.webhookTokenchannels.discord.accounts.*.threadBindings.webhookTokenchannels.whatsapp.creds.jsonchannels.whatsapp.accounts.*.creds.json
- 这些凭证属于已签发、会轮换、承载会话,或 OAuth 持久化类别,不适合只读的外部 SecretRef 解析。