Technical reference
SecretRef 憑證介面
本頁定義標準的 SecretRef 憑證介面:哪些憑證欄位可接受 SecretRef(由環境變數/檔案/執行命令支援的參照),而非原始祕密值。
範圍:
- 範圍內:嚴格限於由使用者提供,且 OpenClaw 不會產生或輪替的憑證。
- 範圍外:執行階段產生或輪替的憑證、OAuth 重新整理資料,以及類似工作階段的成品。
以下清單由來源目標登錄檔產生,並在 CI 中與 docs/reference/secretref-user-supplied-credentials-matrix.json 核對;請勿手動編輯項目。
支援的憑證
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.*.apiKeytalk.realtime.providers.*.apiKeymessages.tts.providers.*.apiKeytools.web.fetch.firecrawl.apiKeyplugins.entries.acpx.config.mcpServers.*.env.*plugins.entries.brave.config.webSearch.apiKeyplugins.entries.codex.config.appServer.authTokenplugins.entries.codex.config.appServer.headers.*plugins.entries.exa.config.webSearch.apiKeyplugins.entries.google-meet.config.realtime.providers.*.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.parallel.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.relay.authTokenchannels.slack.userTokenchannels.slack.signingSecretchannels.slack.accounts.*.botTokenchannels.slack.accounts.*.appTokenchannels.slack.accounts.*.relay.authTokenchannels.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)
profiles.*.keyRef(type: "api_key";當auth.profiles.<id>.mode = "oauth"時不支援)profiles.*.tokenRef(type: "token";當auth.profiles.<id>.mode = "oauth"時不支援)
注意事項:
- 驗證設定檔的方案目標需要
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/標頭介面保存非祕密標記,而非已解析的祕密值。標記保存以來源為準:OpenClaw 從使用中的來源設定快照(解析前)寫入標記,而非從已解析的執行階段祕密值寫入。 - 對於網頁搜尋:在明確供應商模式(已設定
tools.web.search.provider)中,只有所選供應商的金鑰有效。在自動模式(未設定tools.web.search.provider)中,只有依優先順序第一個成功解析的供應商金鑰有效,未選取供應商的參照在被選取前會視為非作用中。舊版tools.web.search.*供應商路徑在相容期內仍會解析,但標準 SecretRef 介面為plugins.entries.<plugin>.config.webSearch.*。
不支援的憑證
這些憑證屬於產生、輪替、帶有工作階段,或可長期保存的 OAuth 類別,不適用於唯讀的外部 SecretRef 解析:
commands.ownerDisplaySecrethooks.tokenhooks.gmail.pushTokenhooks.mappings[].sessionKeyauth-profiles.oauth.*channels.discord.threadBindings.webhookTokenchannels.discord.accounts.*.threadBindings.webhookTokenchannels.whatsapp.creds.jsonchannels.whatsapp.accounts.*.creds.json
相關內容
Was this useful?