secrets-detection
Skill2 starsChanged 49 days agoMITView on GitHub
Finds hardcoded secrets in any project — API keys (AWS, GitHub, Google, Stripe, Slack), passwords, tokens, private keys, JWTs, database URLs with credentials. Runs a fast regex scan, then triages matches to remove false positives and checks .env/git hygiene. Use when auditing a codebase for leaked credentials or before committing/publishing a repo.
- Reads credentials
2 other projects use a version of this.
Adopted by
Most recently taken up by
- awarexone/AXguardtheir own version, first seen Sep 15, 2026
- Rootx202/appsec-skillstheir own version, first seen Jul 13, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- awarexone/AXguard★ 17same name
- Rootx202/appsec-skills★ 2same 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 repository23 other files it gives its agents.
- android-code-securitySkill
- auth-reviewSkill
- config-hardeningSkill
- container-iac-securitySkill
- course-platform-securitySkill
- crypto-reviewSkill
- cve-researchSkill
- data-exposureSkill
- dependency-vulnsSkill
- design-threat-reviewSkill
- django-securitySkill
- dotnet-securitySkill
- flow-securitySkill
- flutter-securitySkill
- graphql-securitySkill
- injection-flawsSkill
- laravel-securitySkill
- llm-securitySkill
- mobile-securitySkill
- rails-securitySkill
- security-auditSkill
- skill-forgeSkill
- spring-securitySkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 17
If grep -rE is unavailable, replicate manually with rg -n using the same patterns file.
- Distinctive: line 28
Keep — and flag as CRITICAL — anything that looks real: correct prefix + realistic entropy + committed to git history.
- Very specific: line 67
Optional bridge: if gitleaks/trufflehog is installed (probe: ../security-audit/scripts/probe_tools.sh), run it too — it scans full git …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Secrets Detection
Step 1 — Fast regex scan
bash scripts/scan.sh <project_root>The script greps the pattern set in references/patterns.txt (one ERE regex per line — edit that file to tune, not the script). Output: file:line:matched line.
If grep -rE is unavailable, replicate manually with rg -n using the same patterns file.
Step 2 — Triage (kill false positives)
For each hit, read the surrounding code and drop it if the value is:
- A placeholder:
example,test,dummy,sample,changeme,placeholder,xxx,your_...,todo,<...>,***,... - In an obvious fixture/mock: paths containing
test/,__tests__/,fixtures/,examples/,docs/,*.mdcode blocks - A variable reference, not a literal:
API_KEY=$API_KEY,password: process.env.PW - An intentional canary/honeypot token (look for comments like
canary,honeypot, or a monitoring URL)
Keep — and flag as CRITICAL — anything that looks real: correct prefix + realistic entropy + committed to git history.
Step 3 — Hygiene checks
git ls-files | rg -i '\.env($|\.)' # .env files tracked?
cat .gitignore 2>/dev/null | rg -i 'env|secret|key|pem' # .env ignored?
git log --all --oneline -S 'AKIA' -- '*.py' 2>/dev/null | head # leaked keys in history?
rg -n --hidden -g '!*.lock' -g '!package-lock.json' '(BEGIN (RSA |EC |OPENSSH )?PRIVATE KEY)' <root>Report:
- Committed real secrets → CRITICAL. Fix: rotate/revoke immediately (a removed file is not a revoked key), then scrub history (
git filter-repo/ BFG). - Tracked
.envfiles → CRITICAL regardless of content. - Secrets in git history but not HEAD → HIGH (history is forever on clones/forks).
- Placeholder secrets in prod-looking config → MEDIUM (someone will "temporarily" deploy them).
- Secrets handling patterns — note whether the project uses env vars / secret manager properly, and whether secrets can leak into logs (see also
../data-exposure/SKILL.md).
Step 4 — Dev-artifact leak surface (developer tools commit secrets too)
rg --files --hidden -g '.vscode/**' -g '.idea/**' -g '*.postman_collection.json' -g '*.postman_environment.json' -g '*.http' -g '*.rest' -g 'devcontainer.json' -g '*.insomnia*' | head
rg -n -i "token|secret|password|api[_-]?key|authorization" .vscode/ .idea/ *.postman* *.http devcontainer.json 2>/dev/null | head- Postman/Insomnia collections & environments: live
Authorization: Bearer …headers, saved logins — these files are SHARED and committed by design → CRITICAL (rotate on sight) .vscode/launch.json/.idea/workspace.xml:env/ENVblocks with tokens and DB URLs → HIGH; also debugconsole/attachconfigs revealing internal hosts.http/.restrequest files: same class — request headers with real credentials → HIGH/Criticaldevcontainer.json/codespaces: secrets incontainerEnv/remoteEnv, PATs in feature options → HIGH- Swagger/OpenAPI
examples:that are real payloads (real users, real tokens) → Medium/High
Same triage rules apply (fakes/fixtures dropped); these surfaces pair with the generic patterns from Step 1 — the difference is WHERE to look, not WHAT to match.
Notes
- Scan binary-free (
-I) and exclude vendored dirs — the script does this already. - Encoded secrets (base64, hex blobs near words like
key,token,secret) deserve a look: decode and judge. references/patterns.mddocuments each pattern, its false-positive profile, and how to add new ones.- Optional bridge: if
gitleaks/trufflehogis installed (probe:../security-audit/scripts/probe_tools.sh), run it too — it scans full git history, where worktree regex cannot see deleted-then-rotated keys. Merge hits into Step 2 triage; same false-positive rules apply.
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.

