-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
Redacted tool output should include a machine-readable marker so agents can detect redaction #68425
Copy link
Copy link
Open
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape 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:data-lossCan lose, corrupt, or silently drop user/session/config data.Can lose, corrupt, or silently drop user/session/config data.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.
Description
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape 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:data-lossCan lose, corrupt, or silently drop user/session/config data.Can lose, corrupt, or silently drop user/session/config data.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.
Type
Fields
Priority
None yet
Problem
OpenClaw's
redact-D4nea1HF.jsautomatically replacesapiKey/token/secretvalues with redacted placeholders ("***"for short values,"<prefix>…<suffix>"for long values) in tool outputs before passing them to the agent model. This redaction is completely transparent to the agent — there is no signal or marker indicating that the output has been redacted.This creates a serious risk:
terminal("cat openclaw.json"), file-read tool, etc.) see"apiKey": "***"as if it were the real valuejson.load→ edit →json.dump) inadvertently write the redacted placeholder back to diskapiKeyfields in the file become"***"— the config is now poisonedEvidence
Real incident on 2026-04-18: An agent tried to update an unrelated model setting in
openclaw.json. Its read of the file returned redacted values. Its write (full-filejson.dump) overwrote 6 real apiKeys with"***". OpenClaw's subsequent.bakrotation fixated the pollution. The system was 401-failing for ~14 hours before root cause was identified (see #68423 for the related backup validation issue).Proposed Fix
Make redaction explicit to downstream agents by emitting a machine-readable marker alongside the redacted output.
Option A: Structured tool response
{ "output": "...", "redacted": true, "redacted_fields": ["models.providers.bailian.apiKey", "plugins.entries.brave.config.webSearch.apiKey"], "warning": "Output contains redacted values. DO NOT write this back to config files without re-fetching real values via openclaw config get <path> or environment variables." }Option B: Text marker appended to output
Option C: Combined (structured + text)
Use a structured response when the tool protocol supports it, fall back to a text marker otherwise. Critical that the marker is always machine-parseable (stable prefix, no localization) so safety skills and linters can detect it reliably.
Why This Matters
Downstream safety measures (skills like
config-safety, runtime linters) can detect redacted values in source files — but they cannot help if the agent writes them in the first place. An explicit redaction marker at the tool-output boundary would prevent an entire class of "agent writes back redacted value" incidents at the root.Related
skills.updateechoes raw apiKey in gateway response — opposite failure mode (not enough redaction) but same underlying design gap (redaction state is implicit)