agentleFS
y-a-v-ay-a-v-a/skills/scan-secrets/SKILL.md

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

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    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.

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
  1. Very specific:

    Never cat, grep, sed, or otherwise print a matched line unmasked.

    line 35
  2. Distinctive:

    Never put a value, or a partial value beyond the masked prefix the script shows, in a reply, file, ticket, commit, or message.

    line 38
  3. Distinctive:

    Do not test whether a credential works by calling the service with it.

    line 42
  4. Very specific:

    Check for gitleaks: Run command -v gitleaks && gitleaks version.

    line 49
  5. Distinctive:

    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 …

    line 107
  6. Distinctive:

    Do not upload findings anywhere (tickets, chats, issue trackers) unless the user asks.

    line 110

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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:
FlagEffect
--allTurn off the false-positive filters of the heuristic rule
--context=NShow N masked lines around each built-in finding
--no-gitleaksSkip gitleaks even when it is installed
--no-historySkip the gitleaks scan of the git history
--jsonMachine-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 --redact through the script. Do not run it yourself without --redact.
  • Do not test whether a credential works by calling the service with it.

Steps

  1. Resolve the target. The path from the arguments, or the current working directory. Confirm it exists.
  2. 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.
  3. 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).

  4. 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=3 and 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.
  5. 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; --all shows 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

ScannerScope
Built-in, git repoTracked plus untracked, non-ignored files (git ls-files --cached --others --exclude-standard)
Built-in, plain directoryAll files, skipping .git, node_modules, vendor, dist, build, virtualenvs, and similar
gitleaks dirEvery file on disk, including gitignored ones such as a local .env
gitleaks gitEvery 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.