SecretRef 憑證範圍
本頁面定義了標準的 SecretRef 憑證範圍。
範圍意圖:
- 範圍內:嚴格由使用者提供的憑證,且 OpenClaw 不會產生或輪換這些憑證。
- 範圍外:執行時期產生或輪換的憑證、OAuth 更新材料,以及類似階段的資料。
openclaw.json 目標 (secrets configure + secrets apply + secrets audit)
Section titled “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[].tts.providers.*.apiKeyagents.list[].memorySearch.remote.apiKeytalk.providers.*.apiKeymessages.tts.providers.*.apiKeytools.web.fetch.firecrawl.apiKeyplugins.entries.acpx.config.mcpServers.*.env.*plugins.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.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.authTokentools.web.search.*.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.sms.authTokenchannels.sms.accounts.*.authTokenchannels.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.feishu.appSecretchannels.feishu.encryptKeychannels.feishu.verificationTokenchannels.feishu.accounts.*.appSecretchannels.feishu.accounts.*.encryptKeychannels.feishu.accounts.*.verificationTokenchannels.qqbot.clientSecretchannels.qqbot.accounts.*.clientSecretchannels.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)
Section titled “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 參照包含在執行階段解析和稽核覆蓋範圍內。
- 在
openclaw.json中,SecretRefs 必須使用結構化物件,例如{"source":"env","provider":"default","id":"DISCORD_BOT_TOKEN"}。舊版secretref-env:<ENV_VAR>標記字串會在 SecretRef 憑證路徑上被拒絕;請執行openclaw doctor --fix以遷移有效的標記。 - OAuth 策略防護:
auth.profiles.<id>.mode = "oauth"不能與該設定檔的 SecretRef 輸入結合使用。當違反此策略時,啟動/重新載入和 auth-profile 解析會快速失敗。 - 對於 SecretRef 管理的模型提供者,產生的
agents/*/agent/models.json項目會保存非秘密標記(而非已解析的秘密值),用於apiKey/標頭層。 - 標記持久性是以來源為授權依據:OpenClaw 會從有效的來源配置快照(解析前)寫入標記,而不是從已解析的執行時期秘密值寫入。
- 對於網路搜尋:
- 在明確提供者模式(已設定
tools.web.search.provider)下,只有選定的提供者金鑰是啟用的。 - 在自動模式(未設定
tools.web.search.provider)下,只有第一個依優先順序解析的提供者金鑰是啟用的。 - 在自動模式下,未選取的提供者參照在被選取之前會被視為非啟用狀態。
- 舊版
tools.web.search.*提供者路徑在相容性期間仍會解析,但標準的 SecretRef 層是plugins.entries.<plugin>.config.webSearch.*。
- 在明確提供者模式(已設定
不支援的憑證
Section titled “不支援的憑證”範圍外的憑證包括:
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 解析。