fix: extend trajectory JSONL redaction to cover Google, AWS, Daytona, and header patterns (#537)#585
Open
ElegantLin wants to merge 1 commit into
Open
fix: extend trajectory JSONL redaction to cover Google, AWS, Daytona, and header patterns (#537)#585ElegantLin wants to merge 1 commit into
ElegantLin wants to merge 1 commit into
Conversation
1693596 to
42cf8f8
Compare
… and header patterns (#537) Trajectory.to_jsonl only redacted sk-ant- (Anthropic) and Bearer headers. Other production credential patterns could leak into acp_trajectory.jsonl if they entered trajectory content (e.g. agent running `env` as a tool call). Added redaction for: - Google AI / Gemini: AIzaSy* - AWS access keys: AKIA* / ASIA* (anchored to exact 20-char length) - Daytona: dtn_* (>=16 char suffix to avoid short identifiers) - OpenAI project keys: sk-proj-* - HTTP headers: x-api-key, api-key (Azure) Extracted patterns into a compiled _REDACTION_PATTERNS list and a reusable redact_trajectory_text() function. All test fixtures use obviously-fake keys. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
42cf8f8 to
030a52c
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
Trajectory.to_jsonlonly redacted two secret patterns (sk-ant-,Bearer). Every other production credential pattern could leak intoacp_trajectory.jsonlif it entered trajectory content (e.g. agent runningenvas a tool call).Added redaction for:
AIzaSy*AKIA*/ASIA*(anchored to exact 20-char length to avoid matchingASIAPACIFICetc.)dtn_*(≥16 char suffix to avoid short identifiers)sk-proj-*x-api-key,api-key(Azure)Extracted patterns into a compiled
_REDACTION_PATTERNSlist and a reusableredact_trajectory_text()function for downstream callers.Test plan
Trajectory.to_jsonl(redact_keys=True/False)Closes #537
🤖 Generated with Claude Code