SecretRef 凭据接口
本页定义了规范的 SecretRef 凭据面:哪些凭据字段接受 SecretRef(基于 env/file/exec/store 的引用)而不是原始密钥值。
范围:
- 范围内:严格由用户提供的凭据,OpenClaw 不会签发或轮换。
- 范围外:运行时签发或轮换的凭据、OAuth 刷新材料,以及类似会话的产物。
以下列表由源目标注册表生成,并在 CI 中对照 docs/reference/secretref-user-supplied-credentials-matrix.json 进行检查;请勿手动编辑条目。
如果已存在的渠道 secret-contract 工件无法加载,源生成将失败,而不是发布不完整的列表。没有该可选工件的插件不会贡献任何渠道目标。此生成检查不会改变运行时 SecretRef 所有者隔离行为。
支持的凭据¶
openclaw.json 目标(secrets configure + secrets apply + secrets audit)¶
agents¶
agents.entries.*.memory.search.remote.apiKeyagents.entries.*.tts.personas.*.providers.*.apiKeyagents.entries.*.tts.providers.*.apiKey
channels¶
channels.buzz.accounts.*.authTagchannels.buzz.accounts.*.privateKeychannels.buzz.authTagchannels.buzz.privateKeychannels.clickclack.accounts.*.tokenchannels.clickclack.tokenchannels.discord.accounts.*.pluralkit.tokenchannels.discord.accounts.*.tokenchannels.discord.accounts.*.voice.realtime.providers.*.apiKeychannels.discord.accounts.*.voice.tts.personas.*.providers.*.apiKeychannels.discord.accounts.*.voice.tts.providers.*.apiKeychannels.discord.pluralkit.tokenchannels.discord.tokenchannels.discord.voice.realtime.providers.*.apiKeychannels.discord.voice.tts.personas.*.providers.*.apiKeychannels.discord.voice.tts.providers.*.apiKeychannels.feishu.accounts.*.appSecretchannels.feishu.accounts.*.encryptKeychannels.feishu.accounts.*.verificationTokenchannels.feishu.appSecretchannels.feishu.encryptKeychannels.feishu.verificationTokenchannels.googlechat.accounts.*.serviceAccountchannels.googlechat.serviceAccountchannels.irc.accounts.*.nickserv.passwordchannels.irc.accounts.*.passwordchannels.irc.nickserv.passwordchannels.irc.passwordchannels.matrix.accessTokenchannels.matrix.accounts.*.accessTokenchannels.matrix.accounts.*.passwordchannels.matrix.passwordchannels.mattermost.accounts.*.botTokenchannels.mattermost.botTokenchannels.msteams.appPasswordchannels.nextcloud-talk.accounts.*.apiPasswordchannels.nextcloud-talk.accounts.*.botSecretchannels.nextcloud-talk.apiPasswordchannels.nextcloud-talk.botSecretchannels.nostr.privateKeychannels.qqbot.accounts.*.clientSecretchannels.qqbot.clientSecretchannels.slack.accounts.*.appTokenchannels.slack.accounts.*.botTokenchannels.slack.accounts.*.relay.authTokenchannels.slack.accounts.*.signingSecretchannels.slack.accounts.*.userTokenchannels.slack.appTokenchannels.slack.botTokenchannels.slack.relay.authTokenchannels.slack.signingSecretchannels.slack.userTokenchannels.sms.accounts.*.authTokenchannels.sms.authTokenchannels.telegram.accounts.*.botTokenchannels.telegram.accounts.*.webhookSecretchannels.telegram.botTokenchannels.telegram.webhookSecretchannels.zalo.accounts.*.botTokenchannels.zalo.accounts.*.webhookSecretchannels.zalo.botTokenchannels.zalo.webhookSecret
cron¶
cron.webhookToken
gateway¶
gateway.auth.passwordgateway.auth.tokengateway.remote.passwordgateway.remote.token
memory¶
memory.search.remote.apiKey
models¶
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.passphrase
plugins¶
plugins.entries.acpx.config.mcpServers.*.env.*plugins.entries.brave.config.webSearch.apiKeyplugins.entries.codex.config.appServer.authTokenplugins.entries.codex.config.appServer.headers.*plugins.entries.comfy.config.headers.*plugins.entries.exa.config.webSearch.apiKeyplugins.entries.facetime.config.realtime.providers.*.apiKeyplugins.entries.firecrawl.config.webFetch.apiKeyplugins.entries.firecrawl.config.webSearch.apiKeyplugins.entries.google-meet.config.realtime.providers.*.apiKeyplugins.entries.google.config.webSearch.apiKeyplugins.entries.google.config.webSearch.headers.*plugins.entries.imap.config.accounts.*.passwordplugins.entries.minimax.config.webSearch.apiKeyplugins.entries.moonshot.config.webSearch.apiKeyplugins.entries.parallel.config.webSearch.apiKeyplugins.entries.perplexity.config.webSearch.apiKeyplugins.entries.tavily.config.webSearch.apiKeyplugins.entries.team-reports.config.discord.tokenplugins.entries.team-reports.config.github.tokenplugins.entries.typesafe.config.apiKeyplugins.entries.voice-call.config.realtime.providers.*.apiKeyplugins.entries.voice-call.config.streaming.providers.*.apiKeyplugins.entries.voice-call.config.tts.providers.*.apiKeyplugins.entries.voice-call.config.twilio.authTokenplugins.entries.xai.config.webSearch.apiKey
skills¶
skills.entries.*.apiKey
talk¶
talk.providers.*.apiKeytalk.realtime.providers.*.apiKey
tts¶
tts.personas.*.providers.*.apiKeytts.providers.*.apiKey
SQLite 认证配置目标(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"时不受支持)
节点主机连接目标¶
gateway.cloudflareAccess.clientIdgateway.cloudflareAccess.clientSecret
这些字段位于节点主机的规范 nodeHost.config SQLite
机器状态值中,
而不是 openclaw.json。它们接受相同的 SecretInput 形式,并在节点启动时通过
已配置的 SecretRef 提供者进行解析。传统的
CF_ACCESS_CLIENT_ID / CF_ACCESS_CLIENT_SECRET 回退机制会自动为
这些字段持久化 env 引用。它们不是 secrets configure 或
secrets apply 的目标。
说明:
- store 引用使用匹配
^[A-Z][A-Z0-9_]{0,127}$的名称,并且仅从 Gateway 范围的团队作用域解析;不存在其他 store 作用域。典型引用为{"source":"store","provider":"default","id":"OPENAI_API_KEY"}。 - 认证配置计划目标需要
agentId;计划条目指向profiles.*.key/profiles.*.token,并写入同级引用(keyRef/tokenRef)。认证配置引用包含在运行时解析和审计覆盖范围内。 - 在
openclaw.json中,SecretRef 必须使用结构化对象,例如{"source":"env","provider":"default","id":"DISCORD_BOT_TOKEN"}。在 SecretRef 凭据路径上会拒绝旧版secretref-env:<ENV_VAR>标记字符串;运行openclaw doctor --fix以迁移有效标记。 - OAuth 策略保护:
auth.profiles.<id>.mode = "oauth"不能与该配置文件的 SecretRef 输入组合使用。当违反此策略时,启动/重新加载和认证配置解析会快速失败。 - 对于由 SecretRef 管理的模型提供者,生成的
agents/*/agent/models.json条目会为apiKey/header 表面持久化非机密标记(而不是已解析的机密值)。标记持久化以源为权威:OpenClaw 从活动源配置快照(解析前)写入标记,而不是从已解析的运行时机密值写入。 - 冷 Gateway 启动可以隔离可重试的解析失败,针对已映射的非 Gateway 所有者。当前已映射类别包括模型提供者和技能、媒体/TTS/cron 提供者、符合条件的认证配置、按 agent 的内存、沙箱 SSH、频道账户以及清单声明的插件路由。启动会在运行时快照中保留每个失败所有者的显式引用,通过 status 和 doctor 报告该所有者,并拒绝针对该所有者的请求,而不尝试较低优先级的凭据。重新加载和配置写入预检使用相同的基于所有者的策略:健康的所有者会刷新;符合条件的失败所有者仅在其引用身份、提供者定义和完整的非机密所有者契约未改变时保持陈旧;新的或已改变的失败会变为冷状态。Gateway 入口认证、结构无效的引用或值、fail-closed 所有者以及当前未映射的所有者仍保持严格。
- 对于网络搜索:在显式提供者模式(设置了
tools.web.search.provider)下,只有所选提供者密钥处于活动状态。在自动模式(未设置tools.web.search.provider)下,只有按优先级解析的第一个提供者密钥处于活动状态,未选中的提供者引用在选中之前被视为非活动。提供者凭据使用plugins.entries.<plugin>.config.webSearch.*。 - Slack
identity: "user"使用channels.slack.userToken,Socket Mode 搭配channels.slack.appToken,HTTP mode 搭配channels.slack.signingSecret。相同配对也适用于channels.slack.accounts.*;此身份不需要 bot token。
不支持的凭据¶
这些凭据属于铸造、轮换、会话承载或 OAuth 持久类别,不适合只读外部 SecretRef 解析:
hooks.tokenhooks.gmail.pushTokenhooks.mappings[].sessionKeyauth-profiles.oauth.*channels.discord.accounts.*.threadBindings.webhookTokenchannels.discord.threadBindings.webhookTokenchannels.whatsapp.accounts.*.creds.jsonchannels.whatsapp.creds.json
相关¶
本页原文 Markdown:在 AtomGit 查看·内容源自开源项目 cl/openclaw