fix(core): redact image bytes from debug dumps by default - #6314
Merged
Conversation
debug_dump/mod.rs serialized outbound LLM requests verbatim, including MessagePart::Image base64 payloads, in both json and raw dump formats. The raw format's dominant path clones the provider's native wire payload directly, so Claude/OpenAI/Gemini/Ollama vision requests all leaked full image bytes to disk whenever debug dumps were enabled. Redact all known image-payload shapes to a size/format marker by default; add an opt-in include_raw_images config flag to restore full byte output for wire-payload debugging, with a startup warning when enabled. Closes #6306
bug-ops
enabled auto-merge (squash)
July 16, 2026 17:05
bug-ops
force-pushed
the
fix/6306-debug-dump-image-redact
branch
from
July 16, 2026 17:05
e8c9101 to
d939cfe
Compare
8 tasks
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
debug_dump/mod.rsserialized outbound LLM requests verbatim, includingMessagePart::Imagebase64 payloads, in bothjsonandrawdump formats. Therawformat's dominant path clones the provider's native wire payload directly, so Claude/OpenAI/Gemini/Ollama vision requests all leaked full image bytes to disk whenever debug dumps were enabled ([debug] enabled = true, opt-in feature).<redacted image: {mime_type}, {n} bytes, blake3:{prefix}>marker via a single generic recursive JSON-value redactor applied to both dump formats.[debug] include_raw_imagesconfig flag (defaultfalse) to restore full raw byte output for wire-payload debugging; enabling it now emits atracing::warn!at construction time so the tradeoff is visible in logs.Notes
MessagePart::Imagein outbound requests. Other sensitive text content in messages (PII, secrets) is unaffected by this change, anddump_tool_output/dump_responsehave a related but out-of-scope residual leak vector (raw tool output text, e.g. a vision tool returning base64 as text) — filing a follow-up issue for that.ClaudeProvider/OpenAiProvider/GeminiProvider/OllamaProviderserializers fromzeph-llmwith an image-bearing message and asserts no raw base64 survives the realdump_request/raw_dumppath.input_imagestring shape (a known future leak vector) is not wired up anywhere in this codebase today — no dead-code test added; documented in the playbook.Closes #6306
Test plan
cargo +nightly fmt --check— cleancargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warnings— cleancargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins— 13802 passed, 0 failed, 35 skippedRUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler"— cleangitleaks protect --staged --no-banner --redact— no leaksUntestedin.local/testing/coverage-status.md