secret-scanning

secret-scanning is a skill for Claude Code, Codex from valtterimelkko/agent-workflow-skills. It costs 131 tokens per session (1,412 once invoked), scanned C, original, MIT.

A procedure for finding credentials, such as API keys and passwords, in Git repositories and directories using gitleaks, a tool that detects likely secrets. It also describes keeping credentials outside the repository.

In plain words
What is it for?
Use it before pushing or publishing a repository, sharing evidence or transcripts, or adding secret checks to a project.
Why use it?
It helps prevent credentials from being committed, published, or copied into logs and other shared files. It treats ignore files as a backup rather than the main protection.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it before pushing or publishing a repository, sharing evidence or transcripts, or adding secret checks to a project.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/valtterimelkko/agent-workflow-skills/secret-scanning
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add valtterimelkko/agent-workflow-skills --skill secret-scanning
Clone the repo
git clone --depth 1 https://github.com/valtterimelkko/agent-workflow-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for secret-scanning

README.md
[![agentmods](https://agentmods.dev/badge/skills/valtterimelkko/agent-workflow-skills/secret-scanning/github.svg)](https://agentmods.dev/skills/valtterimelkko/agent-workflow-skills/secret-scanning)
Your own site
<a href="https://agentmods.dev/skills/valtterimelkko/agent-workflow-skills/secret-scanning"><img src="https://agentmods.dev/badge/skills/valtterimelkko/agent-workflow-skills/secret-scanning/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for secret-scanning

Your own site · 80×15
<a href="https://agentmods.dev/skills/valtterimelkko/agent-workflow-skills/secret-scanning"><img src="https://agentmods.dev/badge/skills/valtterimelkko/agent-workflow-skills/secret-scanning.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 131 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,412 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00131 $0.01412
Opus 5.5 $0.00052 $0.00565
Sonnet 5.5 $0.00026 $0.00282
Haiku 4.5 $0.00013 $0.00141

Measured 24d ago against content hash 663813f708fd, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

secret-scanning scanned grade C with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 24d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

tar xzf gl.tgz gitleaks && install -m 0755 gitleaks /usr/local/bin/gitleaks; cd /; rm -rf "$D"

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -sSfL -o gl.tgz "https://github.com/gitleaks/gitleaks/releases/download/v$V/gitleaks_${V}_linux_x64.tar.gz"
skills/secret-scanning/SKILL.md · 112 lines

How it starts

The opening of the file, as written. The whole thing — 112 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Secret scanning

The goal is to keep credentials out of repositories. Scanning is the check; the design rule comes first:

Credentials live outside the repo tree. Code reads them from paths or environment variables that point outside the repository (for example ~/.pi-web-ui/internal-api-token), and should refuse a credential path that resolves inside its own repo. .gitignore is only a backstop: one git add -f or one renamed file defeats it.

The tool: gitleaks

gitleaks is a single binary and needs no account or human step. Check it with gitleaks version. If it is missing, install a pinned release and verify the checksum:

V=8.30.1; D=$(mktemp -d); cd "$D"
curl -sSfL -o gl.tgz "https://github.com/gitleaks/gitleaks/releases/download/v$V/gitleaks_${V}_linux_x64.tar.gz"
curl -sSfL -o sums.txt "https://github.com/gitleaks/gitleaks/releases/download/v$V/gitleaks_${V}_checksums.txt"
grep "gitleaks_${V}_linux_x64.tar.gz" sums.txt | sed "s/gitleaks_${V}_linux_x64.tar.gz/gl.tgz/" | sha256sum -c -
tar xzf gl.tgz gitleaks && install -m 0755 gitleaks /usr/local/bin/gitleaks; cd /; rm -rf "$D"

Never print a secret

Always pass --redact. Never print, paste, quote or store a matched value, including in reports, commit messages, chat or evidence files. Not even partly, and not "masked in context". Triage from metadata only: rule id, file, line, commit, the key name that matched, and whether the file still exists at HEAD. On some hosts the agent's permission layer blocks commands that would expose credential values. Treat that block as correct; do not work around it.

Commands

Need Command
Full history of a repo (before publishing; public-repo audit) gitleaks git --redact -v <repo>
Working tree or any directory (evidence before copying it into a repo) gitleaks dir --redact -v <path>
Only unpushed commits gitleaks git --redact --log-opts="origin/main..HEAD" <repo>
Staged changes (pre-commit) gitleaks git --pre-commit --staged --redact -v
Machine-readable triage add --report-format json --report-path /tmp/gl.json (the report is redacted too; delete it afterwards)

Read the full file on GitHub · 112 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 24d ago First seen · 112 lines · 131 tokens per session scan C 663813f708fd

Subscribe to this mod's changes

secret-scanning is a skill published in the GitHub repository valtterimelkko/agent-workflow-skills (2 stars, last pushed 21d ago), licensed MIT. It adds 131 tokens to every session and 1,412 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it C with 2 findings (recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-01.