Redact secret-shaped strings from transcript bundles before writing to disk - #136
Open
priyamkarn wants to merge 8 commits into
Open
Redact secret-shaped strings from transcript bundles before writing to disk#136priyamkarn wants to merge 8 commits into
priyamkarn wants to merge 8 commits into
Conversation
…o disk sanitizeTranscriptMessage previously only stripped fake <system_instruction>/<developer_instruction> tags (prompt-injection defense) with zero redaction of API keys, tokens, passwords, or .env content. Adds pattern-based redaction for common secret shapes (AWS, GitHub, Slack, Stripe, Anthropic, OpenAI, Google keys, JWTs, Bearer tokens, private key blocks, .env assignments) at the single choke point every platform adapter calls. CLI now warns with a redaction count when writing a transcript bundle.
…-redaction # Conflicts: # package.json
Contributor
Author
|
Good catches : the metadata field was a real gap (I only traced the message field, not cwd/session_id, into the redaction path) and the quoted multi-word value was an actual regex bug, not just an untested edge case. Appreciate the fix. I'll add both patterns to my mental checklist for future redaction-adjacent work: trace every field that reaches the output, not just the obvious one, and test quoted/multi-token values explicitly. |
…-redaction # Conflicts: # package.json
…tion' into fix/transcript-secret-redaction
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.
Problem
Transcript bundles wrote secret-shaped values from session messages and metadata to disk unchanged. The existing sanitizer only removed injected instruction tags.
Fix
[REDACTED:<type>]placeholders in the bundle without maintaining separate count or reporting state.Tests
Limitation
Redaction is best-effort pattern matching, not a guarantee. Bundles should still be reviewed before sharing or committing.