Redact tool output secrets#85196
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 10, 2026, 1:17 AM ET / 05:17 UTC. Summary 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.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest 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 changesLabel justifications:
Evidence reviewedPR surface: Source +713, Tests +579. Total +1292 across 7 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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 PR egg ✨ Hatched: 🌱 uncommon Tiny Branchling Hatch commandComment Hatchability rules:
Rarity: 🌱 uncommon. What is this egg doing here?
|
e1ddf1d to
292463b
Compare
a6ae3b7 to
4c820c0
Compare
- 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)
|
Addressed the ClawSweeper review in 038f346, plus two adjacent gaps found while re-reviewing. Prefilter sync (the P1)
Enforcement so this cannot drift again Repro confirmed before the fix — the new tests against the prior head (4c820c0) fail exactly as the review predicted: the exec approval prompt renders Also fixed (found in re-review)
On the compatibility label: the forced Known follow-up (out of scope here): Verification
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
- 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
|
CI failure root cause ( The failure was caused by this branch, in two parts:
Fix: the seven new vendor prefixes whose alphabet is pure standard base64 (
Regression tests pin all of it: tiny-PNG data URL byte-identical through redaction, in-blob Verification
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
* 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]>
* 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]>
Summary
Verification
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.