scan-secrets
Skill0 starsChanged 19 days agoMITView on GitHub
Scan a repository or directory for plaintext secrets — cloud keys, API tokens, passwords, private keys — and report them with every value masked. Uses a built-in Node.js scanner and, when installed, gitleaks for the working tree and the full git history. Invoked as /scan-secrets, optionally with a path and flags, for example "/scan-secrets ~/Projects/api --no-history". Read-only; it never changes, commits, or uploads anything.
- Reads credentials
- Installs packages
1 other project uses a version of this.
Adopted by
Most recently taken up by
- GitGuardian/agent-skillstheir own version, first seen Oct 13, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- GitGuardian/agent-skills★ 12same 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 repository14 other files it gives its agents.
- ambitiousSkill
- attributionSkill
- ggSkill
- grill-meSkill
- guide-meSkill
- htmlSkill
- jfdiSkill
- local-urlSkill
- flushcacheSkill
- scpushSkill
- sendmailSkill
- social-previewSkill
- stern-code-reviewSkill
- strunkSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
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 35
Never cat, grep, sed, or otherwise print a matched line unmasked.
- Distinctive: line 38
Never put a value, or a partial value beyond the masked prefix the script shows, in a reply, file, ticket, commit, or message.
- Distinctive: line 42
Do not test whether a credential works by calling the service with it.
- Very specific: line 49
Check for gitleaks: Run command -v gitleaks && gitleaks version.
- Distinctive: line 107
Read-only. Do not edit, delete, commit, or rewrite history to remove a finding, even when asked to "clean it up" in the same breath — that …
- Distinctive: line 110
Do not upload findings anywhere (tickets, chats, issue trackers) unless the user asks.
≈ “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
scan-secrets — find plaintext secrets
Answer one question: does this repository contain credentials in plain text, now or in its git history? Report where, never what.
Invocation
Arguments provided: $ARGUMENTS
/scan-secrets— scan the current working directory./scan-secrets <path>— scan that directory.- Flags are passed through to the script:
| Flag | Effect |
--all | Turn off the false-positive filters of the heuristic rule |
--context=N | Show N masked lines around each built-in finding |
--no-gitleaks | Skip gitleaks even when it is installed |
--no-history | Skip the gitleaks scan of the git history |
--json | Machine-readable report |
Rule zero: never reveal a secret
The script masks every value (AKIA…(20 chars)). Keep it that way.
- Never
cat,grep,sed, or otherwise print a matched line unmasked. To see context, rerun the script with--context=N; its context lines are masked too. - Never put a value, or a partial value beyond the masked prefix the script shows, in a reply, file, ticket, commit, or message.
- gitleaks always runs with
--redactthrough the script. Do not run it yourself without--redact. - Do not test whether a credential works by calling the service with it.
Steps
- Resolve the target. The path from the arguments, or the current working directory. Confirm it exists.
- Check for gitleaks. Run
command -v gitleaks && gitleaks version.- Present: the script uses it automatically.
- Missing: say so once, with install options —
brew install gitleaks(macOS), or a binary from https://github.com/gitleaks/gitleaks/releases. Do not install it without the user's go-ahead; continue with the built-in scan only.
Run the scan. The script lives next to this file:
node <skill-dir>/scripts/scan-secrets.js <target> [flags]<skill-dir>is the directory this SKILL.md is in. Exit code 0 means nothing found, 1 means findings, 2 means an error (bad path, or gitleaks failed — the message is in the output).- Review the findings.
- High-confidence built-in matches and gitleaks findings: known token formats, treat as real until shown otherwise.
- Heuristic matches: rerun with
--context=3and judge each one. Drop variable references, templating ({{ }},${ }), lookups from a secrets store, and documentation examples. Keep literals that look like real credentials. - Discard known false positives with the reason, for example
key_algorithm: "EC_secp384r1"is an algorithm name. - Findings that are only in git history were removed or changed later but are still retrievable by anyone with clone access.
Report. Lead with the verdict (secrets found: yes / no). Then:
- a table of current findings: type, file, line(s), your judgment;
- a table of history-only findings: type, file;
- the false positives you dropped, in one line each;
- what was not covered: gitleaks missing or skipped, files over 5 MB,
binaries, lines over 2000 characters, and the fact that pattern
matching misses secrets in unusual formats. The heuristic rule also
skips letters-only values without digits or symbols
(
password: "onlyletters"), because they cannot be told apart from identifiers;--allshows them.
Close with the standard advice, in two lines: rotate or revoke anything that is or was valid (removing it from the repo does not remove it from history), then move it to a secrets manager.
What gets scanned
| Scanner | Scope |
| Built-in, git repo | Tracked plus untracked, non-ignored files (git ls-files --cached --others --exclude-standard) |
| Built-in, plain directory | All files, skipping .git, node_modules, vendor, dist, build, virtualenvs, and similar |
gitleaks dir | Every file on disk, including gitignored ones such as a local .env |
gitleaks git | Every commit in the history |
Ansible Vault encrypted files and !vault values are skipped; they are
encrypted, not plaintext.
Constraints
- Read-only. Do not edit, delete, commit, or rewrite history to remove a finding, even when asked to "clean it up" in the same breath — that is a separate task the user must confirm, and it does not undo the leak.
- Do not upload findings anywhere (tickets, chats, issue trackers) unless the user asks; when they do, include file paths and secret types only.
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.

