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.*.apiKeymemory.search.remote.apiKeyagents.entries.*.tts.providers.*.apiKeyagents.entries.*.memory.search.remote.apiKeytalk.providers.*.apiKeytalk.realtime.providers.*.apiKeytts.providers.*.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.firecrawl.config.webFetch.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.authTokenplugins.entries.webhooks.config.routes.*.secretgateway.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.clickclack.tokenchannels.clickclack.accounts.*.tokenchannels.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 從使用中的來源設定快照(解析前)寫入標記,而非從已解析的執行階段機密值寫入。 - 閘道冷啟動可隔離已對應之非閘道擁有者的可重試解析失敗。目前已對應的類別包括模型提供者與 Skills、媒體/TTS/排程提供者、符合資格的認證設定檔、各代理程式記憶體、沙箱 SSH、頻道帳號,以及由資訊清單宣告的外掛路由。啟動時會將每個失敗擁有者的明確參照保留在執行階段快照中,透過狀態與 doctor 回報該擁有者,並拒絕該擁有者的要求,而不嘗試較低優先順序的認證資訊。重新載入與設定寫入預檢使用相同的擁有者感知原則:健康的擁有者會重新整理;符合資格但失敗的擁有者,只有在其參照身分、提供者定義及完整的非機密擁有者合約均未變更時,才會維持過時狀態;新的或已變更的失敗則會轉為冷狀態。閘道入口驗證、結構無效的參照或值、失敗時關閉的擁有者,以及目前尚未對應的擁有者,仍採嚴格處理。
- 對於網頁搜尋:在明確提供者模式(已設定
tools.web.search.provider)下,只有所選的提供者金鑰處於啟用狀態。在自動模式(未設定tools.web.search.provider)下,只有依優先順序第一個成功解析的提供者金鑰處於啟用狀態,未選取的提供者參照在被選取前視為未啟用。提供者認證資訊使用plugins.entries.<plugin>.config.webSearch.*。 - Slack
identity: "user"在 Socket Mode 中使用channels.slack.userToken搭配channels.slack.appToken,或在 HTTP 模式中搭配channels.slack.signingSecret。在channels.slack.accounts.*下亦採用相同配對;此身分不需要機器人權杖。
不支援的認證資訊
這些認證資訊屬於由系統建立、會輪替、帶有工作階段,或需長期保存的 OAuth 類別,不適合唯讀的外部 SecretRef 解析:
hooks.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?