secret-scanner
Skill1 starsChanged 3 months agoMITView on GitHub
Scan a repo or a diff for committed secrets — API keys, tokens, private keys, .env files, and high-entropy strings — then triage real leaks from fixtures. Use before pushing, in review, or when a credential may have leaked.
- Reads credentials
5 other projects use a version of this.
Adopted by
Most recently taken up by
- bestdeejay-design/agent-skillstheir own version, first seen Aug 9, 2026
- NovaCode37/claude-security-skillstheir own version, first seen Jun 7, 2026
- 0xjitsu/jitsu-skillstheir own version, first seen Apr 13, 2026
- inbharatai/claude-skillstheir own version, first seen Mar 14, 2026
- alirezarezvani/claude-code-tresortheir own version, first seen Nov 18, 2025
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- alirezarezvani/claude-code-tresor★ 777same name
- inbharatai/claude-skills★ 37same name
- NovaCode37/claude-security-skills★ 12same name
- bestdeejay-design/agent-skills★ 5same name
- 0xjitsu/jitsu-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository134 other files it gives its agents.
- agents.mdAGENTS.md
- accessibility-regression-auditorSkill
- adr-writerSkill
- agent-memory-designerSkill
- agent-trajectory-evaluatorSkill
- alerting-rules-tunerSkill
- analysis-memo-writerSkill
- api-deprecation-plannerSkill
- api-error-contract-designerSkill
- architecture-diagram-generatorSkill
- auth-flow-reviewerSkill
- background-job-reliability-auditorSkill
- branch-rebaserSkill
- brand-voice-profilerSkill
- bundle-analyzerSkill
- cache-policy-designerSkill
- canary-release-plannerSkill
- changelog-from-prsSkill
- chart-chooserSkill
- chunking-strategy-optimizerSkill
- circular-dependency-breakerSkill
- claude-settings-auditorSkill
- code-example-verifierSkill
- cold-email-deliverability-auditorSkill
- cold-start-optimizerSkill
- commit-splitterSkill
- competitor-teardownSkill
- component-spec-writerSkill
- connection-pool-tunerSkill
- content-repurposerSkill
- contract-test-designerSkill
- conventional-commitsSkill
- cors-configuratorSkill
- coverage-gap-finderSkill
- crm-export-auditorSkill
- dashboard-designerSkill
- data-retention-auditorSkill
- dataset-first-lookSkill
- dead-code-finderSkill
- deadlock-diagnoserSkill
- dependency-auditSkill
- dependency-upgrade-plannerSkill
- design-brief-writerSkill
- design-critique-checklistSkill
- design-token-extractorSkill
- devcontainer-designerSkill
- distributed-tracing-instrumenterSkill
- dockerfile-optimizerSkill
- email-sequence-drafterSkill
- embedding-index-tunerSkill
- embedding-set-inspectorSkill
- extract-moduleSkill
- feature-flag-retirerSkill
- finetune-dataset-builderSkill
- flaky-test-diagnoserSkill
- flamegraph-analyzerSkill
- git-blame-investigatorSkill
- github-actions-optimizerSkill
- graphql-schema-designerSkill
- graphrag-scaffolderSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 12
Before pushing a branch or opening a PR, to catch a credential that slipped into a commit.
- Distinctive: line 14
After a suspected leak, to find every place a key appears across the working tree and history.
- Distinctive: line 15
When onboarding a repo and you want a baseline audit of what secrets may already be committed.
- Very specific: line 23
Detect existing tooling and ignore rules — do not guess: Check for .gitleaks.toml, .trufflehog*, detect-secrets baselines, or a pre-commit …
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Find credentials that should never be in version control — provider API keys, OAuth tokens, private keys, database URLs, and .env files — across a whole repo or a single diff. The skill greps for known key shapes, flags high-entropy strings, then triages each hit: real leak vs. example/test fixture vs. placeholder. For confirmed leaks it tells you the only safe remediation — rotate the credential and scrub history — because a secret that reached git is already compromised the moment it was pushed.
When to use this skill
- Before pushing a branch or opening a PR, to catch a credential that slipped into a commit.
- During review of a diff that touches config, CI, infrastructure, or
.env*files. - After a suspected leak, to find every place a key appears across the working tree and history.
- When onboarding a repo and you want a baseline audit of what secrets may already be committed.
[!WARNING] Deleting a secret from the latest commit does not remove it from history — it stays in every prior commit, every clone, and every fork. Any matched real key must be treated as compromised: rotate it first, then scrub history. Deletion alone is not remediation.
Instructions
- Define the scan target. Decide between the working tree (
git ls-files), a specific diff (git diff main...HEAD), or full history (git log -p/ a dedicated history scanner). Diff scans are fast for PRs; full-tree scans catch already-committed leaks. Make the scope explicit in your report. - Detect existing tooling and ignore rules — do not guess. Check for
.gitleaks.toml,.trufflehog*,detect-secretsbaselines, or apre-commitconfig. If a scanner is already configured, run it (gitleaks detect,trufflehog filesystem .) and honor its allowlist. Read.gitignoreto see what should have been excluded but wasn't. - Grep for known secret shapes. Search for provider-specific prefixes and structural patterns rather than generic words:
AKIA/ASIA(AWS),ghp_/gho_/github_pat_(GitHub),sk-/sk-proj-(OpenAI),xox[baprs]-(Slack),AIza(Google),-----BEGIN .* PRIVATE KEY-----, JWTs (eyJ), and connection strings (postgres://,mongodb+srv://with embedded credentials). Also glob for committed.env,.env.*,*.pem,*.p12,id_rsa, and*.keystorefiles. - Flag high-entropy strings. For assignments like
token = "...",secret: ...,password=..., score the value's Shannon entropy; long base64/hex strings with high entropy near a secret-ish identifier are candidates even without a known prefix. - Triage every hit. This is the core of the skill — separate true positives from noise: a value in
*.example,*.sample,fixtures/,test/, or a docs snippet, or an obvious placeholder (xxx,your-key-here,changeme,dummy, all-zeros) is a false positive. A live-looking value in real config, source, or CI is a true positive. When unsure, mark itreviewrather than dismissing it. - Verify the finding set. Re-run your matches with
git grep -nto attach exactfile:linelocations, and confirm each true positive is reachable in a tracked file (not just an ignored local file). For history claims, verify withgit log -p -S '<fragment>'. - Report and remediate. Output a triaged findings table (file, line, type, verdict). For every true positive, give the two-step fix in order: (1) rotate the credential at the provider and invalidate the old one; (2) scrub history with
git filter-repo --replace-textor BFG, then force-push and have collaborators re-clone. Flag anyreviewitems needing human judgment and recommend adding a pre-commit secret scanner to prevent recurrence.
[!NOTE] Rotation comes before scrubbing. Scrubbing hides the secret going forward but cannot un-leak what was already pushed; only rotation makes the exposed value worthless.
Examples
Triaged output for a branch diff:
$ git diff main...HEAD | secret-scanner
Findings (4 matches, scope: diff main...HEAD)
| File | Line | Type | Verdict |
|-------------------------------|------|---------------------|----------------|
| src/config/aws.ts | 12 | AWS access key (AKIA) | TRUE POSITIVE |
| .env | 1 | committed .env file | TRUE POSITIVE |
| test/fixtures/stripe.json | 8 | Stripe TEST key (sk_test_) | false positive |
| README.md | 44 | placeholder API key | false positive |
2 true positives. ACTION REQUIRED.
src/config/aws.ts:12 AKIAIOSFODNN7EXAMPLE...
-> ROTATE: deactivate this access key in IAM and issue a new one.
-> SCRUB: git filter-repo --replace-text <(echo 'AKIAIOSFODNN7EXAMPLE==>REMOVED')
then force-push; ask collaborators to re-clone.
.env:1 contains DATABASE_URL with embedded password
-> ROTATE: change the database password now.
-> SCRUB: git rm --cached .env && add `.env` to .gitignore, then filter-repo
to purge it from history.
Recommendation: add gitleaks as a pre-commit hook to block future leaks.[!WARNING] The
sk_test_Stripe key and the README placeholder are intentionally inert — flagging them as incidents wastes responder time and erodes trust in the scanner. Triage before you alarm.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

