secrets-scan
Skill4 starsChanged 10 days agoMITView on GitHub
Scan staged changes, the working tree or git history for leaked secrets with gitleaks, and guide the user through revoking and rotating anything found, then optionally removing it from history. Use before a commit, when asked to check for secrets or leaked keys, after a secret was pasted or committed, or as part of a security audit.
- 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
- Smaui94/ClaudeSkillCollectiontheir 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
- 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 repository32 other files it gives its agents.
- llms.txtllms.txt
- cve-checkSkill
- dependency-vetSkill
- git-commitSkill
- incident-supply-chainSkill
- migrate-angularjsSkill
- migrate-class-to-hooksSkill
- migrate-cordovaSkill
- migrate-cra-to-viteSkill
- migrate-dotnet-frameworkSkill
- migrate-ingress-nginxSkill
- migrate-strutsSkill
- migrate-vue2Skill
- migrate-xamarinSkill
- security-auditSkill
- threat-model-liteSkill
- upgrade-angularSkill
- upgrade-djangoSkill
- upgrade-dotnetSkill
- upgrade-expressSkill
- upgrade-jquerySkill
- upgrade-laravelSkill
- upgrade-nestjsSkill
- upgrade-nextjsSkill
- upgrade-nodeSkill
- upgrade-nuxtSkill
- upgrade-phpSkill
- upgrade-pythonSkill
- upgrade-railsSkill
- upgrade-react-nativeSkill
- upgrade-spring-bootSkill
- upgrade-supabaseSkill
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 15
Before a commit (the git-commit skill calls this on staged files).
- Distinctive: line 16
When the user asks to check for secrets, keys or credentials.
- Distinctive: line 17
After a secret was pasted into code, a log, an issue or chat, or committed by mistake.
- Very specific: line 22
Check that gitleaks is installed: gitleaks version.
- Very specific: line 24
Never print, echo or paste a secret value, even partly.
- Very specific: line 25
Don't write a report file into the repo.
- Distinctive: line 50
every commit hash after the first affected commit changes.
- Very specific: line 69
If history was rewritten: gitleaks git .
- Distinctive: line 73
Never print a secret's value, in full or in part, in chat, files, commit messages or logs.
- Distinctive: line 74
Never send a secret to an external service to "check" it.
- Distinctive: line 75
Never rewrite history or force-push without explicit consent.
- Very specific: line 76
Never add .gitleaksignore entries or gitleaks:allow comments without the user's approval.
- Distinctive: line 77
Never disable push protection or a secret-scanning hook to get a commit through.
“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
When to use
- Before a commit (the
git-commitskill calls this on staged files). - When the user asks to check for secrets, keys or credentials.
- After a secret was pasted into code, a log, an issue or chat, or committed by mistake.
- As part of
security-audit, which only scans the working tree; this skill also covers history.
Before you start
- Check that gitleaks is installed:
gitleaks version. If it isn't, ask before installing it, and install only from the official source (package manager or the GitHub releases page). - Agree the scope with the user: staged changes (default), the working tree, a commit range, or the full history. A full-history scan can be slow on large repos.
- Never print, echo or paste a secret value, even partly. Always pass
--redactso gitleaks hides values in its output. - Don't write a report file into the repo. If the user wants one, write it outside the working tree with
--redactand delete it when done.
Steps
Run the scan for the agreed scope (from the repo root):
Scope Command Staged changes gitleaks git --staged --redact --no-banner -vUnstaged changes gitleaks git --pre-commit --redact --no-banner -vWorking tree (all files, tracked or not) gitleaks dir . --redact --no-banner -vA commit range gitleaks git --log-opts="origin/main..HEAD" --redact --no-banner -vFull history gitleaks git . --redact --no-banner -vExit code 1 means leaks were found; 0 means none. Respect an existing
.gitleaks.tomland.gitleaksignore.- Triage each finding. For each one, note the rule ID, file, line, commit (for history scans) and author. Decide:
- Real secret: go to step 3.
- Test fixture or example value: confirm it grants no access, then suggest a
gitleaks:allowcomment on that line, or a fingerprint in.gitleaksignore. Ask the user first; never add an ignore on your own. - False positive: same as above, with the reason.
- Contain a real secret. Explain to the user, in this order:
- Revoke or rotate it first, at the provider (cloud console, GitHub token settings,
npm token revoke, the API vendor's dashboard). A secret that reached a remote, a CI log, a package or chat is compromised even after it's deleted. Removing it from history doesn't make it safe. - Check for misuse: review the provider's access logs for the period since the leak.
- Replace it with a reference to an env var or secret manager (
process.env.STRIPE_SECRET_KEY, a CI secret, a vault). Add the file to.gitignoreif it's a local config file. - Remove it from the code in a normal commit.
- Revoke or rotate it first, at the provider (cloud console, GitHub token settings,
Only if the user asks, rewrite history. Explain the cost first:
- every commit hash after the first affected commit changes;
- a force-push is required, and every collaborator must re-clone or rebase; forks, open PRs, caches and existing clones keep the old data;
- on GitHub, cached views and PR refs may need GitHub Support to purge.
With the user's consent, work in a fresh clone and use git-filter-repo (≥ 2.47 for
--sensitive-data-removal):git filter-repo --sensitive-data-removal --invert-paths --path config/secrets.yml # or replace the literal values listed one per line in a file kept outside the repo: git filter-repo --sensitive-data-removal --replace-text ../expressions.txtThe user runs the force-push; never run it yourself.
- Prevent recurrence. Suggest gitleaks as a pre-commit hook or CI step, and GitHub secret scanning with push protection where available. Ask before adding hooks or workflows (see
core/agent-safety).
Verify
- Re-run the same scan; it must report no leaks (or only approved, documented ignores).
- The user has confirmed the secret is revoked at the provider. Rewriting history isn't a substitute.
- If history was rewritten:
gitleaks git . --redact --no-banneron a fresh clone of the remote finds nothing.
Safety
- Never print a secret's value, in full or in part, in chat, files, commit messages or logs.
- Never send a secret to an external service to "check" it.
- Never rewrite history or force-push without explicit consent; never force-push yourself.
- Never add
.gitleaksignoreentries orgitleaks:allowcomments without the user's approval. - Never disable push protection or a secret-scanning hook to get a commit through.
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.

