Repository navigation
feat: deterministic secrets pre-scan before AI review (#204) - #217
Merged
Merged
Conversation
New module src/engine/secrets_scanner.rs with 12 built-in patterns: - AWS Access Key / Secret Key - GitHub Token (ghp/gho/ghu/ghs/ghr) - OpenAI API Key (sk-*/sk-proj-*) - Anthropic API Key (sk-ant-*) - Groq API Key (gsk_*) - xAI API Key (xai-*) - Slack Token (xoxb/xoxp/xoxa/xoxr/xoxs) - Stripe Key (sk_live/sk_test/pk_live/pk_test) - Google API Key (AIza*) - JWT Token (eyJ.*.eyJ.*) - Private Key Block (RSA/EC/DSA/OPENSSH) Features: - Masked output: AKIA****CDEF (first 4 + last 4) - Auto-skip test/spec/fixture/mock/example files - Only scans added lines (not removed) - Integrated into review pipeline before LLM call - 18 unit tests covering all patterns + edge cases - Findings merged with rule findings on LLM failure fallback
1. Test-file skip regex: broaden to match test_*.py and *_test.py 2. Secrets findings now included in LLM prompt context 3. Fallback path derives should_block from findings severity
10 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
Implements #204 — deterministic secrets detection that runs before the AI review pass. Catches known secret patterns with zero false negatives.
Changes
New:
src/engine/secrets_scanner.rs12 built-in patterns:
AKIA...)ghp_/gho_/ghu_/ghs_/ghr_)sk-*/sk-proj-*)sk-ant-*)gsk_*)xai-*)BEGIN RSA/EC/DSA/OPENSSH PRIVATE KEY)eyJ...)xoxb/xoxp/xoxa/xoxr/xoxs)sk_live/sk_test/pk_live/pk_test)AIza...)Features
AKIA****CDEF(first 4 + last 4 chars shown)Integration
review.rs: secrets scan runs alongside rule engine, findings merged into responseTest Plan