Skip to content

Redact tool output secrets#85196

Merged
amknight merged 4 commits into
mainfrom
aknight/tool-output-secret-redaction
Jun 10, 2026
Merged

Redact tool output secrets#85196
amknight merged 4 commits into
mainfrom
aknight/tool-output-secret-redaction

Conversation

@amknight

Copy link
Copy Markdown
Member

Summary

  • Expand tool-output redaction coverage for vendor token prefixes, credential fields, URL/query/form secrets, connection-string passwords, and obfuscated key separators.
  • Apply forced tool payload redaction to tool detail surfaces and share parsed redaction coverage with exec approval display bypass handling.
  • Extend sensitive URL query-name normalization and regression coverage for encoded, hidden, plus-spliced, and control-spliced keys.

Verification

  • pnpm format:fix src/logging/redact.ts src/logging/redact.test.ts src/shared/net/redact-sensitive-url.ts src/shared/net/redact-sensitive-url.test.ts src/infra/exec-approval-command-display.ts src/infra/exec-approval-command-display.test.ts
  • node scripts/run-vitest.mjs src/logging/redact.test.ts src/shared/net/redact-sensitive-url.test.ts src/infra/exec-approval-command-display.test.ts src/agents/pi-embedded-subscribe.tools.test.ts src/agents/tools/sessions-history-tool.test.ts src/gateway/ws-log.test.ts
  • git diff --check
  • AUTOREVIEW_AUTO_TESTS=0 .agents/skills/autoreview/scripts/autoreview --mode local

Behavior addressed: tool output and approval display text now redact a broader set of secret-like values by default, including vendor token prefixes, URL/query/form secrets, credential fields, and obfuscated sensitive keys.
Real environment tested: local Codex worktree on macOS with repository Vitest wrapper.
Exact steps or command run after this patch: ran focused redaction tests, touched-surface Vitest suite, diff whitespace check, formatter, and local autoreview.
Evidence after fix: touched-surface suite passed 10 test files and 214 tests; focused redaction suite passed 88 tests after replacing push-protection-triggering fixture literals with runtime-built strings.
Observed result after fix: secret-like values are masked across tool-detail redaction, URL helper redaction, and exec approval display bypass rendering without exposing the raw fixture values.
What was not tested: full repository test suite, build, and cross-platform Testbox lanes were not run.

@openclaw-barnacle openclaw-barnacle Bot added size: XL maintainer Maintainer-authored PR labels May 22, 2026
@clawsweeper

clawsweeper Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 10, 2026, 1:17 AM ET / 05:17 UTC.

Summary
The branch expands built-in redaction for tool/log/approval/URL surfaces and adds regression coverage for vendor token prefixes, credential fields, obfuscated keys, URL/query/form secrets, and base64 media false positives.

PR surface: Source +713, Tests +579. Total +1292 across 7 files.

Reproducibility: yes. source inspection gives a high-confidence path: current main's default prefilter lacks the new token/query/form triggers and tool detail redaction still depends on the older behavior, while the touched callers feed approval and tool display text through these helpers. I did not run the tests locally because this review is read-only and tests can create artifacts.

Review metrics: 1 noteworthy metric.

  • Default redaction policy: 1 built-in corpus expanded; 1 tool-detail path forced. Both affect existing users without a config change, so maintainers should intentionally accept the upgrade behavior before merge.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Get maintainer/security acceptance for the broader default-redaction policy and the gateway-client follow-up scope.

Risk before merge

  • [P1] Existing users may see more log, diagnostic, URL, tool-detail, approval-display, and tool payload text masked after upgrade because the built-in default corpus is intentionally broader.
  • [P1] The patch changes a security boundary with complex regex, URL/form parsing, bitmap projection, and media-payload exceptions; focused tests and CI look coherent, but maintainer/security acceptance is still the merge gate.
  • [P1] An independent gateway-client URL redactor still has narrower query-name matching; the author called this out as a follow-up, so maintainers should decide whether that remaining gap is acceptable before treating URL-normalizer parity as complete.

Maintainer options:

  1. Accept broader redaction and land (recommended)
    A maintainer/security reviewer can merge once they intentionally accept the upgrade-visible masking changes and the separately tracked gateway-client cleanup scope.
  2. Unify the sibling URL redactor first
    If maintainers want URL-normalizer parity before merge, update the gateway-client redactor to reuse or match the net-policy normalization and add focused coverage.
  3. Pause if default masking is too broad
    If the expanded built-in corpus is not the desired default policy, pause this PR and ask for a narrower redaction set or an explicit rollout decision.

Next step before merge

  • [P2] Human maintainer/security review is the next action because this protected-label PR intentionally changes a security-boundary default and has no narrow automation repair remaining.

Security
Cleared: No concrete supply-chain or security regression was found in the diff; the remaining security concern is maintainer acceptance of the intentional redaction-boundary change.

Review details

Best possible solution:

Land after a maintainer/security reviewer accepts the broader default-redaction compatibility impact and the scoped gateway-client follow-up; otherwise fold that sibling URL-normalizer cleanup into this branch before merge.

Do we have a high-confidence way to reproduce the issue?

Yes, source inspection gives a high-confidence path: current main's default prefilter lacks the new token/query/form triggers and tool detail redaction still depends on the older behavior, while the touched callers feed approval and tool display text through these helpers. I did not run the tests locally because this review is read-only and tests can create artifacts.

Is this the best way to solve the issue?

Yes, this is the best current fix shape for the central problem: it centralizes coverage in src/logging/redact.ts, reuses that coverage in exec approval display instead of duplicating a bitmap matcher, and adds focused regression tests. The one remaining sibling gap is the gateway-client redactor, which is acceptable only if maintainers agree to keep it as follow-up.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against e9671ed60327.

Label changes

Label justifications:

  • P2: The PR is a security hardening improvement with limited but real compatibility impact on displayed/logged text.
  • merge-risk: 🚨 compatibility: The diff intentionally broadens default masking and forces tool-detail redaction, so existing diagnostics and displays can change after upgrade.
  • merge-risk: 🚨 security-boundary: The changed regex/parsing/bitmap logic controls whether secrets are hidden or leaked across approval, tool, URL, and log surfaces.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external-contributor proof gate is not applicable because this is a maintainer-member PR, and the PR body plus follow-up comments provide terminal-style focused verification for the changed behavior.
Evidence reviewed

PR surface:

Source +713, Tests +579. Total +1292 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 3 785 72 +713
Tests 4 726 147 +579
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 1511 219 +1292

What I checked:

  • Root policy read: Root AGENTS.md was read fully and its security-boundary, compatibility, whole-surface, proof, and protected-label review rules apply to this PR. (AGENTS.md:1, e9671ed60327)
  • Scoped policy check: The changed paths are under src, packages, infra, and logging; the only matching scoped guide read was src/agents/AGENTS.md, which is performance-focused and did not change the verdict. (src/agents/AGENTS.md:1, e9671ed60327)
  • Default redaction expansion: The PR head adds shared auth/form key sets, expanded vendor/token patterns, URL/userinfo/connection-string coverage, and a generated prefilter source list that is intended to stay in sync with default redaction patterns. (src/logging/redact.ts:137, d6428fcca660)
  • Approval display bypass handling: Exec approval display now computes raw and stripped redaction bitmaps from the shared logging redactor before union-masking bypassed positions, replacing the previous local bitmap implementation. (src/infra/exec-approval-command-display.ts:99, d6428fcca660)
  • Forced tool-detail redaction: redactToolDetail now routes through redactToolPayloadText, so tool display/detail surfaces keep tool-mode redaction even when general log redaction is off. (src/logging/redact.ts:994, d6428fcca660)
  • URL normalizer coverage: The net-policy URL redactor now normalizes decoded, plus-spliced, control, whitespace, and Hangul-filler-spliced query parameter names before classifying them as sensitive. (packages/net-policy/src/redact-sensitive-url.ts:13, d6428fcca660)

Likely related people:

  • steipete: Recent history and blame show Peter Steinberger carried net-policy extraction/refactors and logging/redaction fast-path maintenance around the touched URL and redaction surfaces. (role: recent area contributor; confidence: high; commits: f4c6c0aec49e, 1e7510ae103e, 2035f38ab244; files: packages/net-policy/src/redact-sensitive-url.ts, src/logging/redact.ts)
  • volcano303: Authored the merged Control UI tool payload redaction work that established forced tool payload redaction as the safety-boundary behavior this PR extends. (role: feature introducer; confidence: medium; commits: f3e8c50df392; files: src/logging/redact.ts)
  • drobison00: Authored the merged exec approval display sanitizer security hardening that this PR builds on for approval-prompt redaction and bypass rendering. (role: adjacent owner; confidence: medium; commits: 503b748a8ee1; files: src/infra/exec-approval-command-display.ts)
  • nimbleenigma: Recent blame shows follow-up work on persisted tool result detail redaction and resolveToolPayloadRedaction, adjacent to the forced tool-detail behavior changed here. (role: recent area contributor; confidence: medium; commits: 277eb16652dd; files: src/logging/redact.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels May 22, 2026
@clawsweeper

clawsweeper Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

✨ Hatched: 🌱 uncommon Tiny Branchling

Hatch command

Comment @clawsweeper hatch when this PR is hatchable.

Hatchability rules:

  • Merged PRs are hatchable.
  • Open PRs are hatchable when they are status: 👀 ready for maintainer look, status: 🚀 automerge armed, or labeled clawsweeper:automerge.
  • Closed unmerged PRs are hatchable only when one of those hatchable labels is still present in the durable record.

Rarity: 🌱 uncommon.
Trait: finds missing screenshots.
Image traits: location release reef; accessory release bell; palette sunrise gold and clean white; mood bright-eyed; pose standing beside its cracked shell; shell paper lantern shell; lighting clean product lighting; background subtle branch markers.
Share on X: post this hatch
Copy: My PR egg hatched a 🌱 uncommon Tiny Branchling in ClawSweeper.

What is this egg doing here?
  • Eggs appear after the PR passes real-behavior proof. It is here for vibes, not verdicts: it does not change labels, ratings, merge decisions, or automation.
  • The shell reacts to review momentum: open follow-up work warms it up, re-review makes it wobble, and a clean final review lets it hatch.
  • Hatchability usually comes from sufficient real-behavior proof, no blocking P0/P1/P2 findings, no security attention needed, and clean correctness. A merged PR is already final, so merge makes the egg hatchable independently.
  • The hatch is seeded from this repository and PR number, so the same PR keeps the same creature; the reviewed head SHA can only change safe visual details.
  • Rarity is just collectible sparkle: 🥚 common, 🌱 uncommon, 💎 rare, ✨ glimmer, and 🌈 legendary.

@amknight
amknight force-pushed the aknight/tool-output-secret-redaction branch from e1ddf1d to 292463b Compare May 22, 2026 03:45
@openclaw-barnacle openclaw-barnacle Bot added the cli CLI command changes label May 22, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels May 22, 2026
@amknight amknight self-assigned this May 22, 2026
@amknight
amknight force-pushed the aknight/tool-output-secret-redaction branch from a6ae3b7 to 4c820c0 Compare June 7, 2026 15:23
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 7, 2026
- build DEFAULT_REDACT_PREFILTER_RE from sources covering every default
  pattern family: new vendor prefixes, webhook hosts, bare query/form keys,
  userinfo/connection-string passwords, and percent/plus/invisible
  obfuscated keys (including trailing separator splices)
- run default-pattern redaction tests through the default options path and
  redact the vendor corpus per token so prefilter gaps fail tests
- fix quoted standalone assignment values containing the other quote char
  or an unterminated quote; never re-mask *** placeholders
- align net-policy URL query-name separator stripping with logging key
  normalization (Hangul fillers)
@amknight

Copy link
Copy Markdown
Member Author

Addressed the ClawSweeper review in 038f346, plus two adjacent gaps found while re-reviewing.

Prefilter sync (the P1)
DEFAULT_REDACT_PREFILTER_RE is now assembled from DEFAULT_REDACT_PREFILTER_SOURCES, co-located with DEFAULT_REDACT_PATTERNS in src/logging/redact.ts, with triggers for every default this PR adds:

  • vendor prefixes and webhook hosts (gh[opsur]_, glpat-, gloas-, glsa_, sk_live_/sk_test_/rk_live_, SG., pypi-, do[opr]_v1_, dp.*, dckr_, AKIA/ASIA, api_org_, hooks.slack.com, discord, and the rest)
  • bare sensitive query/form keys (code=, jwt=, session=, credential, pass=)
  • URL userinfo and connection-string password shapes (://user:pass@)
  • structural triggers for obfuscated keys — percent escapes, plus splices, and invisible/control splices (including interior-plus-trailing separator combinations) — which literal key triggers can never cover.

Enforcement so this cannot drift again
The default-pattern suites in src/logging/redact.test.ts now exercise the real default-options path ({ mode: "tools" }, no explicit patterns), and the vendor corpus test redacts each token individually. A default pattern added without a prefilter trigger now fails its own test. The previous suites passed patterns: defaults, which skips the prefilter gate entirely — that is why the gap shipped silently. A parity test pins explicit-defaults ≡ default path.

Repro confirmed before the fix — the new tests against the prior head (4c820c0) fail exactly as the review predicted: the exec approval prompt renders deploy --with glpat-… unredacted, and ?code=…, jwt=…&safe=1, db pass=…, postgres://user:pw@…, and spliced client%5Fse​cret=… all pass through redactSensitiveText untouched on the default path (7 failures). All pass after the fix.

Also fixed (found in re-review)

  • Quoted standalone assignment values containing the other quote character (password="it's-a-secret") or an unterminated quote leaked entirely: tagged main's single ([^\s&#]+) value class masked these, while the split quoted/unquoted patterns in this PR both failed to match. The quoted pattern now ends only at the matching close quote, the unquoted variant accepts one leading quote, and *** placeholders are never re-masked (which would have stripped their quote wrappers). Regression tests added.
  • packages/net-policy URL_QUERY_NAME_SEPARATOR_RE now also strips Hangul filler characters (category Lo, missed by \p{C}\p{Z}), matching FORM_BODY_KEY_SEPARATOR_RE in src/logging/redact.ts.

On the compatibility label: the forced redactToolDetail redaction matches the already-documented contract in https://docs.openclaw.ai/logging (Control UI tool-call events redact even when logging.redactSensitive is "off"), so that part closes a docs/code mismatch rather than adding a new contract.

Known follow-up (out of scope here): packages/gateway-client/src/client.ts keeps an independent substring-only isSensitiveUrlQueryParamName, so filler-spliced keys can still reach gateway-client error logs under a custom redactForLog. Tracked as a separate cleanup to reuse the net-policy normalizer.

Verification

  • node scripts/run-vitest.mjs src/logging/redact.test.ts packages/net-policy/src/redact-sensitive-url.test.ts src/infra/exec-approval-command-display.test.ts → 153 passed (105/16/32)
  • node scripts/run-vitest.mjs src/agents/embedded-agent-subscribe.tools.test.ts src/agents/tools/sessions-history-tool.test.ts src/gateway/ws-log.test.ts src/cli/gateway-cli/run.option-collisions.test.ts → 98 passed
  • node scripts/run-vitest.mjs src/agents/tool-display.test.ts src/agents/transcript-redact.test.ts src/logging/log-tail.test.ts src/infra/errors.test.ts → 86 passed
  • pnpm format:fix + scripts/run-oxlint.mjs on touched files (fixed one no-shadow in redactFormBodyLine); git diff --check clean
  • AUTOREVIEW_AUTO_TESTS=0 autoreview --mode local ran twice: round 1 flagged a trailing-separator prefilter bypass (client_seㅤcretㅤ=), fixed and regression-tested; round 2 clean — "no accepted/actionable findings".
  • Follow-up commit is net −104 lines (test conversions shrink more than the prefilter sources add).

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 10, 2026
- pure-base64-alphabet token prefixes (gAAAA, AKIA, ASIA, dapi,
  ATCTT3xFfG, ATATT, ATBB) now require a non-alphanumeric left boundary,
  skip explicit ;base64, payload spans, and run unchunked so chunk starts
  cannot fake the boundary or hide the container from the lookbehind
- tokens after URL/path delimiters or assignments still mask; data-URL
  media survives redaction byte-identical (fixes chat media mirror CI)
- regression tests: tiny-PNG data URL, in-blob plus boundary,
  chunk-aligned large data URL, reset-path Fernet token, path AWS key
@amknight

Copy link
Copy Markdown
Member Author

CI failure root cause (checks-node-agentic-gateway-methods on 038f346: chat.directive-tags.test.ts > backs source reply media with an equivalent deduped delivery mirror) — fixed in d6428fc.

The failure was caused by this branch, in two parts:

  1. This PR's Fernet pattern (gAAAA[A-Za-z0-9_=-]{20,}) had no left boundary, and tiny-PNG base64 contains gAAAA runs (zero-filled IHDR bytes). Redaction therefore mangled the test's data:image/png;base64,… media URL to …iVBORw0KGgoAAAANSUhEUgAAAAE…YII=, dropping the image block in the delivery mirror.
  2. The prefilter sync in 038f346 is what made that latent over-redaction reachable on the default path — earlier CI runs passed only because the broken prefilter skipped the pattern. The new default-path enforcement surfaced a real over-redaction bug, which is exactly what it is for.

Fix: the seven new vendor prefixes whose alphabet is pure standard base64 (gAAAA, AKIA, ASIA, dapi, ATCTT3xFfG, ATATT, ATBB) now use a shared BASE64_SAFE_TOKEN_BOUNDARY:

  • a non-alphanumeric left boundary, so the prefix cannot fire mid-blob, while URL/path delimiters (/) and assignments (=) still qualify — https://app.example/reset/gAAAA… and /buckets/AKIA…/ keep redacting;
  • a negative lookbehind that skips explicit ;base64, payload spans, so a +- or /-adjacent prefix inside a data URL stays untouched;
  • these boundary patterns run unchunked: replacePatternBounded's 16 KiB chunking would otherwise fake a ^ boundary at chunk starts and hide the ;base64, container from the lookbehind on large media payloads.

Regression tests pin all of it: tiny-PNG data URL byte-identical through redaction, in-blob +gAAAA splice, a chunk-aligned ≥32 KiB data URL, plus positive cases for reset-path Fernet tokens and path-segment AWS keys.

Verification

  • node scripts/run-vitest.mjs src/gateway/server-methods/chat.directive-tags.test.ts → 212 passed (was 210/212 with the CI failure reproduced locally)
  • node scripts/run-vitest.mjs src/logging/redact.test.ts packages/net-policy/src/redact-sensitive-url.test.ts src/infra/exec-approval-command-display.test.ts → 156 passed
  • Consumer suites (embedded-agent-subscribe.tools, sessions-history-tool, ws-log, run.option-collisions, tool-display, transcript-redact, log-tail, errors) all green
  • AUTOREVIEW_AUTO_TESTS=0 autoreview --mode local iterated three more rounds: caught the /-delimiter over-narrowing and the chunk-boundary interaction (both fixed above); final round clean — "no actionable defects, patch is correct".

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@amknight
amknight merged commit 3faf669 into main Jun 10, 2026
159 checks passed
@amknight
amknight deleted the aknight/tool-output-secret-redaction branch June 10, 2026 21:34
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 11, 2026
* redact tool output secrets

* Expand tool-output secret redaction

* fix(security): keep redaction prefilter in sync with expanded defaults

- build DEFAULT_REDACT_PREFILTER_RE from sources covering every default
  pattern family: new vendor prefixes, webhook hosts, bare query/form keys,
  userinfo/connection-string passwords, and percent/plus/invisible
  obfuscated keys (including trailing separator splices)
- run default-pattern redaction tests through the default options path and
  redact the vendor corpus per token so prefilter gaps fail tests
- fix quoted standalone assignment values containing the other quote char
  or an unterminated quote; never re-mask *** placeholders
- align net-policy URL query-name separator stripping with logging key
  normalization (Hangul fillers)

* fix(security): keep base64-prefix redaction out of media payloads

- pure-base64-alphabet token prefixes (gAAAA, AKIA, ASIA, dapi,
  ATCTT3xFfG, ATATT, ATBB) now require a non-alphanumeric left boundary,
  skip explicit ;base64, payload spans, and run unchunked so chunk starts
  cannot fake the boundary or hide the container from the lookbehind
- tokens after URL/path delimiters or assignments still mask; data-URL
  media survives redaction byte-identical (fixes chat media mirror CI)
- regression tests: tiny-PNG data URL, in-blob plus boundary,
  chunk-aligned large data URL, reset-path Fernet token, path AWS key

---------

Co-authored-by: Alex Knight <[email protected]>
badgerbees pushed a commit to badgerbees/openclaw that referenced this pull request Jul 8, 2026
* redact tool output secrets

* Expand tool-output secret redaction

* fix(security): keep redaction prefilter in sync with expanded defaults

- build DEFAULT_REDACT_PREFILTER_RE from sources covering every default
  pattern family: new vendor prefixes, webhook hosts, bare query/form keys,
  userinfo/connection-string passwords, and percent/plus/invisible
  obfuscated keys (including trailing separator splices)
- run default-pattern redaction tests through the default options path and
  redact the vendor corpus per token so prefilter gaps fail tests
- fix quoted standalone assignment values containing the other quote char
  or an unterminated quote; never re-mask *** placeholders
- align net-policy URL query-name separator stripping with logging key
  normalization (Hangul fillers)

* fix(security): keep base64-prefix redaction out of media payloads

- pure-base64-alphabet token prefixes (gAAAA, AKIA, ASIA, dapi,
  ATCTT3xFfG, ATATT, ATBB) now require a non-alphanumeric left boundary,
  skip explicit ;base64, payload spans, and run unchunked so chunk starts
  cannot fake the boundary or hide the container from the lookbehind
- tokens after URL/path delimiters or assignments still mask; data-URL
  media survives redaction byte-identical (fixes chat media mirror CI)
- regression tests: tiny-PNG data URL, in-blob plus boundary,
  chunk-aligned large data URL, reset-path Fernet token, path AWS key

---------

Co-authored-by: Alex Knight <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant