secrets-scan

secrets-scan is a skill for Claude Code, Codex from chipi/agentic-ai-homelab. It costs 88 tokens per session (679 once invoked), scanned A, original, MIT.

A read-only check for exposed secrets such as API keys, tokens, passwords, private keys, and real environment files. It scans staged changes, selected differences, or the whole repository and hides matched secret values in its report.

In plain words
What is it for?
Use it before committing or pushing, especially after changing configuration. It helps inspect staged files or history and report suspicious matches by file and line.
Why use it?
It catches credentials before they enter version control or get pushed. This reduces the risk of exposing access to services and accounts.

Skill for Claude CodeCodex

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

Good fit Use it before committing or pushing, especially after changing configuration. It helps inspect staged files or history and report suspicious matches by file and line.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/chipi/agentic-ai-homelab/secrets-scan
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 chipi/agentic-ai-homelab --skill secrets-scan
Clone the repo
git clone --depth 1 https://github.com/chipi/agentic-ai-homelab

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 secrets-scan

README.md
[![agentmods](https://agentmods.dev/badge/skills/chipi/agentic-ai-homelab/secrets-scan/github.svg)](https://agentmods.dev/skills/chipi/agentic-ai-homelab/secrets-scan)
Your own site
<a href="https://agentmods.dev/skills/chipi/agentic-ai-homelab/secrets-scan"><img src="https://agentmods.dev/badge/skills/chipi/agentic-ai-homelab/secrets-scan/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 secrets-scan

Your own site · 80×15
<a href="https://agentmods.dev/skills/chipi/agentic-ai-homelab/secrets-scan"><img src="https://agentmods.dev/badge/skills/chipi/agentic-ai-homelab/secrets-scan.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 88 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 679 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 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.00088 $0.00679
Opus 5 $0.00044 $0.00340
Sonnet 5 $0.00018 $0.00136
Haiku 4.5 $0.00009 $0.00068

Measured 9d ago against content hash 3eafa11f7113, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

secrets-scan scanned grade A with 0 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 9d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

workstation/claude/skills/secrets-scan/SKILL.md · 45 lines

What it actually says

secrets-scan

Catch secrets before they land in git. Enforces the non-negotiable: .env, credentials, tokens, API keys — never in git, never in fixtures, never in a commit message. Read-only — it never writes; it blocks by reporting.

Scan (prefer a real scanner, else patterns)

  1. gitleaks (preferred) — if installed:
    • staged / pre-commit: gitleaks protect --staged --no-banner -v
    • whole tree/history: gitleaks detect --no-banner -v If gitleaks isn't installed, say so and use the fallback.
  2. Pattern fallback — over git diff --cached (staged) or the target diff. Redact the matched value in output. High-signal markers:
    • Provider keys: sk-[A-Za-z0-9]{16,}, ghp_[A-Za-z0-9]{20,}, github_pat_, glpat-[A-Za-z0-9_-]{20,}, AKIA[0-9A-Z]{16}, AIza[0-9A-Za-z_-]{20,}, xox[baprs]-, sk-ant-
    • Private keys: -----BEGIN (RSA |EC |OPENSSH |DSA )?PRIVATE KEY-----
    • Generic assignments: (api[_-]?key|secret|token|password|passwd|bearer|auth) followed by =/: and a 16+ char value
  3. .env guard — flag any real .env (not .env.example) being added: git diff --cached --name-only | grep -E '(^|/)\.env$'.

Report

  • End with SECRETS SCAN: PASS or SECRETS SCAN: FAIL.
  • On FAIL, list each hit as file:line — <rule> with the value redacted (never echo the secret). Tell the operator to remove it AND rotate — a secret committed to git is compromised even if later deleted.
  • Don't cry wolf on obvious placeholders: buddy-is-the-king, hf_xxx…, <your-…>, ${VAR}, changeme, example, empty values. Note them as skipped.

Conventions this enforces

  • Never commit secrets (rule #29). If one ever lands, treat it as compromised and rotate immediately.
  • .env stays gitignored; only .env.example with placeholders is tracked.
  • Install gitleaks for real coverage; the pattern fallback catches the common shapes but is not exhaustive — say so when you use it.
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. 9d ago First seen · 45 lines · 88 tokens per session scan A 3eafa11f7113

Subscribe to this mod's changes

secrets-scan is a skill published in the GitHub repository chipi/agentic-ai-homelab (2 stars, last pushed 3d ago), licensed MIT. It adds 88 tokens to every session and 679 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.