Repository navigation
feat(secret-serialization): Add skill for secrets leaked via serialization - #173
Merged
Merged
Conversation
…ation Add a review skill for credentials that leak through generated serialization: dataclass repr and asdict, attrs, pydantic model_dump, JSON.stringify, util.inspect, logs, and tracing spans. The leak usually needs a credential field on an auto-serializing type and a sink that stringifies whole objects or every kwarg. Each half looks safe in its own diff, so the skill reports either side alone and searches the repository for the other side. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Warden splits allowed-tools on spaces and drops unknown tokens, so "Read, Grep, Glob" left the agent with only Glob (find and ls). Without read and grep it could not trace sinks and capped findings at medium. Record the Warden evaluation runs: the incident diff now yields high findings with a full sink trace, and two negative diffs yield none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
geoffg-sentry
marked this pull request as ready for review
September 25, 2026 23:56
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit aacfdb8. Configure here.
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.

Adds
secret-serialization, a review skill for credentials that leak through generated serialization: dataclassreprandasdict, attrs, pydanticmodel_dump,JSON.stringify,util.inspect, structured logs, and tracing spans.These leaks need two changes that each look safe alone. One stores a credential on a type that serializes itself, for example a dataclass field without
field(repr=False). The other serializes whole objects or every kwarg into telemetry, for examplestr(value)over tool-call kwargs written to a span attribute. They are usually written months apart, so diff-only review passes both. The skill reports either side on its own and searches the whole repository for the other side before choosing severity. It does not downgrade a finding because one half predates the diff.Direct logging of a secret stays with
security-review. This skill is opt-in, and repos add it through Warden withremote = "getsentry/skills".Evaluation
Run through Warden (
piruntime,openrouter/x-ai/grok-4.5, efforthigh) against the internal repository where the original leak happened:str(value)span sink was already on the default branch): high findings on both fields in two runs. Each finding traced tool kwarg, then tracing decorator, thenstr(value), then span attribute.field(repr=False): no findings.*_tokensusage-count fields: no findings.Details and open gaps are in
SOURCES.md. Known noise: call-site hunks that pass the credential into a constructor produce duplicate findings for the same field.allowed-toolsmust be space-delimited for Warden. WithRead, Grep, Glob, Warden dropsRead,andGrep,, so the agent could not read files or search code, and the incident only produced medium findings. Other skills in this repo that use the comma form, such asgha-security-review, likely have the same problem under Warden.