-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
SecretRef credentials travel as plaintext through the model-call chain after resolution #102008
Copy link
Copy link
Closed
Labels
P0Emergency: data loss, security bypass, crash loop, or unusable core runtime.Emergency: data loss, security bypass, crash loop, or unusable core runtime.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maintainerMaintainer-authored PRMaintainer-authored PRmaturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.
Description
Metadata
Metadata
Assignees
Labels
P0Emergency: data loss, security bypass, crash loop, or unusable core runtime.Emergency: data loss, security bypass, crash loop, or unusable core runtime.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maintainerMaintainer-authored PRMaintainer-authored PRmaturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.
Type
Fields
Priority
None yet
Problem
SecretRefs (docs: https://docs.openclaw.ai/gateway/secrets) keep provider credentials out of
openclaw.json, but after eager resolution the plaintext value travels through the entire model-call chain:resolveApiKeyForProviderreturns the resolved plaintext (src/agents/model-auth.ts)src/agents/embedded-agent-runner/run/auth-controller.ts)src/agents/embedded-agent-runner/stream-resolution.ts,packages/agent-core/src/agent-loop.ts)packages/ai/src/providers/*)Any log line, error dump, capture file, or introspection surface along that chain can leak the real credential. Several
packages/aiadapters (Anthropic, OpenAI responses) also construct SDK clients without the host guarded fetch, so the SDK builds auth headers from the raw key with no in-repo interception point.The secrets docs currently punt the remaining risk to "OS isolation, container isolation, or an external credential proxy."
Proposal
Egress-time credential injection inside the runtime:
oc-sent-v1-<hex>) for SecretRef-managed model credentials at auth resolution; everything downstream holds the sentinel.packages/aiadapters onto the host guarded fetch where the SDK supports custom fetch; unwrap at client construction (host port) where it does not.redactSensitiveText/redactSecrets.Kill switch:
OPENCLAW_SECRET_SENTINELS=off. Plugin SDK auth surface stays plaintext (shipped contract).Out of scope (follow-ups): channel tokens, MCP env/headers, skills env, sandbox egress proxying for tool traffic.