fix(redact): preserve Codex input_image payloads during JSONL redaction - #2066
Open
suhaanthayyil wants to merge 11 commits into
Open
fix(redact): preserve Codex input_image payloads during JSONL redaction#2066suhaanthayyil wants to merge 11 commits into
suhaanthayyil wants to merge 11 commits into
Conversation
shouldSkipJSONLObject only matched strings.HasPrefix(t, "image") or t == "base64" to identify image objects safe to skip during JSONL redaction. Codex embeds images as "type":"input_image", which matches neither check, so the entropy scanner treated the base64 payload as a high-entropy secret and silently rewrote it to REDACTED — corrupting the image with no error surfaced. Claude's "type":"image" already matched via the prefix check and was unaffected. Extend the check to also match any "..._image" suffix (covers input_image and output_image) so Codex transcripts round-trip through JSONLBytes without base64 corruption, while Claude's image type keeps working as before.
7 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes JSONL redaction behavior so Codex inline image payload objects (e.g., {"type":"input_image", ...} / {"type":"output_image", ...}) are treated like other image-bearing JSON objects and are skipped during entropy redaction, preventing high-entropy base64 image data from being rewritten to REDACTED. This aligns redaction behavior with how multiple agent transcript formats encode images and preserves data needed for replay/export.
Changes:
- Extend
shouldSkipJSONLObjectto skip JSON objects whose"type"ends with_image(e.g.,input_image,output_image), in addition to existingimage*andbase64handling. - Add regression tests ensuring
JSONLBytespreserves Codexinput_imagedata URL payloads and still preserves Claude-styletype:"image"objects. - Expand
TestShouldSkipJSONLObjectcoverage to includeinput_imageandoutput_image.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
redact/redact.go |
Expands image-object detection to include Codex _image-suffixed types so image payloads aren’t corrupted by entropy redaction. |
redact/redact_test.go |
Adds regression tests for Codex and Claude image JSONL shapes and extends unit coverage for _image types. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
suhaanthayyil
marked this pull request as ready for review
August 19, 2026 18:07
The suffix check matched any type name ending in "_image" (e.g. docker_image, container_image), which would silently skip redaction of an unrelated object that happens to carry a secret in another field. Match only the known Codex screenshot types (input_image, output_image) by exact equality. Co-authored-by: Cursor <cursoragent@cursor.com> Entire-Checkpoint: 01M0DS8PQK39EWWPC2KKPJKFEV
Co-authored-by: Cursor <cursoragent@cursor.com> Entire-Checkpoint: 01M0X8J060NZ2PE67QVKTY41MA
Co-authored-by: Cursor <cursoragent@cursor.com> Entire-Checkpoint: 01M0X9BWQGFEBZDZ978XV322NA
Co-authored-by: Cursor <cursoragent@cursor.com> Entire-Checkpoint: 01M0XBEHHF31CNJPXBJN7ZDZP2
Co-authored-by: Cursor <cursoragent@cursor.com> Entire-Checkpoint: 01M0XC928NZFZJ1SWXMXTK3MMG
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Trail: https://entire.io/gh/entireio/cli/trails/1097
What: Skip Codex
input_image/output_imageJSONL objects during entropy redaction so base64 image payloads are not rewritten toREDACTED.Why / how it helps: Codex embeds images as
type:input_image, which did not matchHasPrefix(t, "image"). Subagent transcripts (and main sessions with externalization off) silently lost image bytes.How: Extend
shouldSkipJSONLObjectto also match types with an_imagesuffix; add round-trip tests for Codex and Claude shapes.Testing:
go test ./redact/ -count=1green (includes new Codex/Claude image cases)gofmtclean on committed treeFixes #2060