secrets-scan
Skill0 starsChanged 10 days agoMITView on GitHub
Scan your own repository or files for hardcoded secrets - AWS, GitHub, GitLab, Slack, Stripe, Google, npm, SendGrid and LLM API keys, private key blocks, JWTs, passwords in URLs and high-entropy values assigned to password/token/api_key names - plus sensitive files such as .env, id_rsa, *.pem and terraform.tfstate. Output is always redacted (prefix, length, fingerprint), supports a baseline and inline allow markers, and ends with a rotation plan for anything real. Use when the user asks to check a repo for leaked secrets or credentials before pushing or open-sourcing, mentions "API key in git", "did I commit my .env", GitHub push protection or secret scanning alerts, or wants a pre-commit / CI secret check.
- Reads credentials
9 other projects use a version of this.
Adopted by
Most recently taken up by
- mdigital94/vibe-shield-plugintheir own version, first seen Nov 8, 2026
- Smaui94/ClaudeSkillCollectiontheir own version, first seen Nov 8, 2026
- Phaedra-Solutions/cursor-rulestheir own version, first seen Nov 8, 2026
- manastalukdar/ai-devstudiotheir own version, first seen Oct 13, 2026
- NinjaSln-labs/agent-skillstheir own version, first seen Oct 2, 2026
- lglucas/ai-dev-operating-systemtheir own version, first seen Sep 28, 2026
Other versions9 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 9
- lglucas/ai-dev-operating-system★ 12same name
- Phaedra-Solutions/cursor-rules★ 4same name
- Pradnyeshp/Claude-Skills★ 2same name
- manastalukdar/ai-devstudio★ 1same name
- NinjaSln-labs/agent-skills★ 1same name
- Jinbae10/skills★ 0same name
- mdigital94/vibe-shield-plugin★ 0same name
- mguttmann/code-audit-suite★ 0same name
- Smaui94/ClaudeSkillCollection★ 0same 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 repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- auth-session-reviewSkill
- dependency-auditSkill
- dockerfile-securitySkill
- incident-response-playbookSkill
- input-validation-reviewSkill
- owasp-web-reviewSkill
- security-headers-checkSkill
- threat-modelingSkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 6 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
6
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
- Distinctive: line 18
Never print, quote, paste or summarise a full secret value - not even "to confirm".
- Very specific: line 20
Do not cat, grep or open a flagged file in a way that echoes the secret into the chat.
- Distinctive: line 21
If you must inspect context, read only neighbouring lines, or ask the user to look.
- Distinctive: line 22
Do not test whether a key works by calling the provider API.
- Distinctive: line 30
After a contractor leaves or a laptop is lost: what credentials live in our code?
- Distinctive: line 51
Scan git history too: when the repo has a history (deleted files still leak).
- Distinctive: line 100
Always end with: what is real, what was already pushed, the rotation plan, and the prevention step.
“Common” is measured: kept by at least 6 in 10 of the 6 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
Secrets scan
Find credentials in the working tree, never display them, and get real ones rotated.
Paths below are relative to this skill's folder (in Claude Code: ${CLAUDE_SKILL_DIR}).
Safety rules for this skill
- Never print, quote, paste or summarise a full secret value - not even "to confirm". Refer to findings by file, line, rule and the redacted prefix the script prints.
- Do not
cat,grepor open a flagged file in a way that echoes the secret into the chat. If you must inspect context, read only neighbouring lines, or ask the user to look. - Do not test whether a key works by calling the provider API. Treat every match as live until the owner says otherwise.
When to use
- "Scan this repo for secrets / API keys / passwords before I push or make it public"
- "Did I commit my .env?", "GitHub says it found a secret", "push protection blocked my push"
- Setting up a pre-commit hook or CI job that blocks secrets
- After a contractor leaves or a laptop is lost: what credentials live in our code?
When not to use
- A secret is already confirmed leaked publicly: start with
incident-response-playbook(rotate first, investigate second) and use this skill afterwards to find other copies. - Scanning repositories or systems the user does not own or is not authorised to audit.
- Dependency vulnerabilities (
dependency-audit) or secrets inside Docker images (dockerfile-securitycovers ENV/ARG and copied key files).
Workflow
- Scope it. Confirm the directory and whether the repo is (or will become) public. Note test fixtures that intentionally contain fake keys so they can be excluded.
- Scan the working tree (read-only).
Skipspython3 scripts/secrets_scan.py . python3 scripts/secrets_scan.py . --exclude 'tests/fixtures/*' --json > secrets.json.git,node_modules,vendor, virtualenvs, build output, lockfiles, binaries and files over 1 MB. Exit 1 = findings at or above--fail-on(defaultlow), 2 = bad input. - Scan git history too when the repo has a history (deleted files still leak). Prefer an
installed scanner; do not install tools without asking:
trufflehog can verify keys against providers, which sends them over the network - only with the user's explicit consent.gitleaks git -v --redact . # gitleaks 8.19+; older versions: gitleaks detect --redact git log --all --oneline -- '*.env' '*.pem' 'id_*' # quick check for removed key files - Triage each finding using the table below. A finding is a false positive only if the
value is a placeholder, a published example, or a test fixture that never worked anywhere.
Mark accepted false positives with a
secrets-scan:allowcomment on the line, or record them in a baseline:
The baseline stores fingerprints only (truncated SHA-256 of rule + value), never values.python3 scripts/secrets_scan.py . --write-baseline .secrets-baseline.json python3 scripts/secrets_scan.py . --baseline .secrets-baseline.json - Real secret found: rotate, then clean up. Removing it from the code is not enough once it has been committed or pushed. Follow references/rotation.md: revoke/rotate at the provider, deploy the new value from an environment variable or secret manager, check the provider's audit log, then decide whether history rewriting is worth it. Propose every rotation and history rewrite as exact steps and wait for the user to confirm.
- Prevent recurrence. Offer the pre-commit and CI setup in
references/prevention.md and make sure
.gitignorecovers.env*(but not.env.example), key files and Terraform state.
| Rule | Typical meaning | Action |
private-key, aws-*, github-*, stripe-live-key, provider tokens | real credential format | rotate unless clearly fake |
generic-secret | high-entropy literal assigned to a secret-like name | ask the owner; move to env/secret store |
url-credentials | scheme://user:password@host | rotate DB/service password; use env vars |
jwt | token in code or logs | usually a test token; check expiry and where it came from |
stripe-test-key (low) | test-mode key | still move to env; rotate if repo is public |
sensitive-file | .env, keys, tfstate present | git rm --cached, add to .gitignore, rotate contents |
Output
secrets scan: 214 files, 3 high, 1 medium, 0 low, 0 info (values redacted)
HIGH src/config.py:12 aws-access-key-id AKIA******** (len 20) fp=3f9c0a...
HIGH deploy/id_rsa sensitive-file SSH private key
MEDIUM docker-compose.yml:31 url-credentials Tr0u******** (len 14)
Real credentials: 2 (AWS key in src/config.py, SSH key in deploy/). Both were committed in
a1b2c3d (2026-10-02) and pushed to origin -> treat as exposed.
Plan (needs your confirmation): 1) deactivate the AWS key and create a new one ...
False positives: 1 (fixture in tests/, added to baseline).Always end with: what is real, what was already pushed, the rotation plan, and the prevention step.
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.

