Appearance
SecretRef 凭据范围
本页面定义了 OpenClaw 中 SecretRef 凭据的权威范围。
范围说明:
- 在范围内:严格由用户提供、OpenClaw 不自动生成也不轮换的凭据。
- 不在范围内:运行时自动生成或轮换的凭据、OAuth 刷新令牌,以及类会话类产物。
支持的凭据
openclaw.json 目标字段(支持 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.search.gemini.apiKeytools.web.search.grok.apiKeytools.web.search.kimi.apiKeytools.web.search.perplexity.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.passwordchannels.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")profiles.*.tokenRef(type: "token")
注意事项:
- 认证配置文件(Auth-profile)计划目标需要提供
agentId。 - 计划条目以
profiles.*.key/profiles.*.token为目标,并写入同级引用(keyRef/tokenRef)。 - 认证配置文件引用包含在运行时解析和审计覆盖范围内。
- 对于 SecretRef 管理的模型提供商,生成的
agents/*/agent/models.json条目中,apiKey/header 字段存储的是非密钥标记(不是已解析的密钥值)。 - 标记持久化以来源为权威:OpenClaw 从活跃源配置快照(解析前)写入标记,而非从运行时已解析的密钥值写入。
- 关于 Web 搜索:
- 在显式提供商模式下(已设置
tools.web.search.provider),只有所选提供商的密钥处于激活状态。 - 在自动模式下(未设置
tools.web.search.provider),只有按优先级首先解析成功的提供商密钥处于激活状态。 - 在自动模式下,未被选中的提供商引用在被选中前视为未激活状态。
- 旧版
tools.web.search.*提供商路径在兼容窗口期内仍可解析,但 SecretRef 的权威路径已统一为plugins.entries.<plugin>.config.webSearch.*。
- 在显式提供商模式下(已设置
不支持的凭据
以下凭据不在范围内:
commands.ownerDisplaySecretchannels.matrix.accessTokenchannels.matrix.accounts.*.accessTokenhooks.tokenhooks.gmail.pushTokenhooks.mappings[].sessionKeyauth-profiles.oauth.*discord.threadBindings.*.webhookTokenwhatsapp.creds.json
不支持原因:
- 这些凭据属于自动生成、自动轮换、携带会话状态或 OAuth 持久类凭据,不适合通过只读的外部 SecretRef 解析机制管理。