fix(core): redact base64 blobs and message history from debug dumps#6326
Merged
Conversation
bug-ops
enabled auto-merge (squash)
July 16, 2026 18:14
bug-ops
force-pushed
the
fix/6315-debug-dump-tool-output-redact
branch
from
July 16, 2026 19:18
1654b28 to
1ca70d0
Compare
dump_tool_output, dump_response, dump_tool_error, and dump_focus_knowledge wrote raw text to debug dump files with no redaction, so a tool returning binary data as plain text (e.g. a vision tool emitting base64 image bytes instead of a typed MessagePart::Image) leaked full payloads to disk. Add redact_binary_blobs to scrub_content's redaction pipeline: contiguous runs of 200+ base64-alphabet characters are replaced with a length/hash marker. Apply it plus scrub_content across all four text-dump sinks, and recursively across dump_request's assembled JSON payload via a new redact_json_value helper, since a blob closed off in dump_tool_output otherwise resurfaces unredacted one turn later as message history in the next request dump. Closes #6315
bug-ops
force-pushed
the
fix/6315-debug-dump-tool-output-redact
branch
from
July 16, 2026 19:19
1ca70d0 to
8b08e42
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dump_tool_output,dump_response,dump_tool_error, anddump_focus_knowledgeincrates/zeph-core/src/debug_dump/mod.rswrote raw text to disk with no redaction, so a tool returning binary data as plain text (e.g. a vision/screenshot tool emitting base64 image bytes instead of a typedMessagePart::Image) leaked full payloads into debug dump files.redact_binary_blobstocrates/zeph-core/src/redact.rs: replaces contiguous runs of 200+ base64-alphabet characters with a<redacted possible binary data: N bytes, blake3:...>marker (decode-then-hash, with an undecodable-run fallback). Applied alongside the existingscrub_contentacross all four text-dump sinks.dump_request(json_dump/raw_dump) also recursively redacts every string leaf of its assembled JSON payload via a newredact_json_valuehelper — without this, a blob closed off indump_tool_outputwould resurface unredacted one turn later as message history serialized into the next request dump (found during adversarial review, same class of gap as the prior debug_dump writes raw MessagePart::Image base64 bytes to disk #6306 cycle).[debug] enabled).Test plan
cargo +nightly fmt --checkcargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warningscargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins(targeted redact/debug_dump filter: 95/95 passed)RUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler"gitleaks protect --staged— cleanredact_binary_blobs(redaction, marker stability, short-string passthrough, non-over-redaction on IDs/hashes, undecodable fallback, proptest never-panics)dump_request) redacts through the real public call path, asserting raw-payload absence, not just marker presenceweb_scrapetool output for false positives (flagged during review as a recommended follow-up, not required to close this issue)Closes #6315