secrets-scan
Skill0 starsChanged 9 days agoMITView on GitHub
Scan code, config files and optionally git history for leaked secrets - passwords, API keys, tokens, private keys, connection strings with credentials, committed .env and key files - and check .gitignore. Found secrets are always masked, never printed in full. Use when asked to scan/check/audit for secrets, credentials, API keys, passwords or tokens in a repo, or before publishing/open-sourcing a repository.
- Reads credentials
8 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
- 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
- Jinbae10/skillstheir own version, first seen Jul 7, 2026
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- 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
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 repository28 other files it gives its agents.
- accessibility-auditSkill
- api-design-reviewSkill
- architecture-reviewSkill
- complexity-checkSkill
- concurrency-reviewSkill
- config-reviewSkill
- cpp-google-styleSkill
- csharp-google-styleSkill
- dead-code-finderSkill
- dependency-auditSkill
- doc-comment-auditSkill
- error-handling-reviewSkill
- full-reviewSkill
- java-google-styleSkill
- logging-reviewSkill
- markdown-readme-google-styleSkill
- naming-reviewSkill
- owasp-security-reviewSkill
- performance-reviewSkill
- privacy-reviewSkill
- python-google-styleSkill
- regex-reviewSkill
- repo-hygieneSkill
- review-without-fixingSkill
- shell-google-styleSkill
- sql-reviewSkill
- test-coverage-reviewSkill
- todo-auditSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. 0 are common, 7 are distinctive, and 6 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
6
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
- Very specific: line 11
Never print a found secret in full - not in the report, not in a summary, not in a command you suggest.
- Distinctive: line 12
Don't copy secret values into other files, issues or commit messages.
- Distinctive: line 13
When you read a file to verify a hit, quote only the key name and the masked value.
- Very specific: line 16
Check the whole repo unless the user names files/directories.
- Very specific: line 19
Run (no pipe; output is capped): bash <skill-dir>/scripts/scan.sh <project-root> [hitsPerRule=20]
- Distinctive: line 22
No gitleaks installed: the script says so.
- Distinctive: line 23
Verify each hit by reading the surrounding lines: real value, placeholder, test fixture or reference to an environment variable?
- Distinctive: line 24
Look manually for what patterns miss: long random-looking strings assigned to config keys (SC8), credentials in URLs inside docs, secrets …
- Very specific: line 42
Remove it from the code; load it from environment variables or a secret manager (e.g.
- Very specific: line 43
Add the files to .gitignore.
- Distinctive: line 44
If it is in the history and the repo is (or will be) public: rewrite history with git filter-repo or BFG, force-push, and ask collaborators …
- Very specific: line 52
Every finding has a concrete location (commit:file for SC7).
- Distinctive: line 54
Do not change files. Apply changes only when the user explicitly asks for it, and never print the secret while doing so.
“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
Secrets scan
Review only: report findings, never change files, rewrite history or rotate keys yourself.
Masking (strict)
- Never print a found secret in full - not in the report, not in a summary, not in a command you suggest. Show at most the first 4 characters followed by
***(e.g.AKIA***,ghp_***). - Don't copy secret values into other files, issues or commit messages.
- When you read a file to verify a hit, quote only the key name and the masked value.
Scope
Check the whole repo unless the user names files/directories. Skip .git/ internals (history is scanned separately), node_modules/, vendor/, .venv/, build output, lock files and minified files. Include config files, scripts, notebooks, Dockerfiles, CI files (.github/workflows, .gitlab-ci.yml) and docs.
Steps
- Run (no pipe; output is capped):
bash <skill-dir>/scripts/scan.sh <project-root> [hitsPerRule=20]- Runs
gitleaks(redacted) if installed, plus grep patterns SC1-SC4 (masked), SC5 committed sensitive files and SC6.gitignoregaps. HISTORY=1 bash .../scan.sh <root>also scans the full git history (SC7). Ask before running it on very large repos; it can take a while.- No gitleaks installed: the script says so. Tell the user that gitleaks (https://github.com/gitleaks/gitleaks) finds more secret types, then continue. Never install anything yourself.
- Runs
- Verify each hit by reading the surrounding lines: real value, placeholder, test fixture or reference to an environment variable?
- Look manually for what patterns miss: long random-looking strings assigned to config keys (SC8), credentials in URLs inside docs, secrets in notebooks' outputs, base64 blobs in configs.
- Report (format below) and give the remediation steps.
Rules
- SC1 error: known provider token format (AWS, GitHub, GitLab, Slack, Google, Stripe, Anthropic, OpenAI, SendGrid, npm …)
- SC2 error: private key (
-----BEGIN ... PRIVATE KEY-----) - SC3 error: credentials in a connection string / URL (
scheme://user:password@host) - SC4 warning: password/secret/token/API key assigned a literal value in code or config - "possible" until verified
- SC5 error: sensitive file tracked by git (
.env,*.pem,*.key,*.p12,*.pfx,*.jks,id_rsa,credentials.json,secrets.yaml…);.npmrc/.pypirconly if they contain a token - SC6 warning:
.gitignoredoes not ignore.env, key files orid_rsa - SC7 error: secret in git history - still exposed even if deleted from the current files
- SC8 info: high-entropy string that looks like a secret (manual)
False positives to drop
Placeholders (changeme, xxx, <your-api-key>, ${API_KEY}, {{ secret }}, example, dummy) · documented example keys (AKIAIOSFODNN7EXAMPLE) · public keys and certificates (BEGIN PUBLIC KEY, BEGIN CERTIFICATE) · hashes and checksums · test fixtures with obviously fake values (report as info if they look real). The script already skips placeholder-looking matches and prints how many it skipped.
Remediation (include in the report when anything real is found)
- Rotate/revoke the secret first. Once it was pushed, deleting it does not make it safe again.
- Remove it from the code; load it from environment variables or a secret manager (e.g. GitHub Actions secrets, Vault, cloud key vaults); commit only a
.env.examplewith placeholders. - Add the files to
.gitignore; untrack committed ones withgit rm --cached <file>. - If it is in the history and the repo is (or will be) public: rewrite history with
git filter-repoor BFG, force-push, and ask collaborators to re-clone - explain that this is disruptive and must be coordinated. Do not run it yourself. - Prevent recurrence: a pre-commit hook (
gitleaks protect --staged) or GitHub secret scanning / push protection.
Report
In the user's language, grouped by file:
path/to/file:line - error|warning|info - <ID> <rule> - <key name> = <first 4 chars>*** - <why it is a problem>- Every finding has a concrete location (
commit:filefor SC7). Unverified SC4/SC8 hits are "possible". - End with a summary: findings per severity, whether the history was scanned, then the remediation steps for the real findings, most urgent first.
- Do not change files. Apply changes only when the user explicitly asks for it, and never print the secret while doing so.
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.

