secrets-leak-scan

secrets-leak-scan is a skill for Claude Code, Codex from isaacsight/kernel. It costs 33 tokens per session (1,027 once invoked), scanned A, original, MIT.

A scan for credentials accidentally left in files or Git history, including API keys, private keys, tokens, and environment-file contents.

In plain words
What is it for?
Use it before publishing a repository, after risky configuration changes, or when checking the full Git history for leaked credentials.
Why use it?
It finds secrets before they are pushed or published and highlights credentials that remain exposed in old commits.

Skill for Claude CodeCodex

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

Good fit Use it before publishing a repository, after risky configuration changes, or when checking the full Git history for leaked credentials.

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

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/isaacsight/kernel/secrets-leak-scan.svg)](https://agentmods.dev/skills/isaacsight/kernel/secrets-leak-scan)
Your own site
<a href="https://agentmods.dev/skills/isaacsight/kernel/secrets-leak-scan"><img src="https://agentmods.dev/badge/skills/isaacsight/kernel/secrets-leak-scan.svg" alt="Measured on agentmods" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,027 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Privilege Escalation · line 3
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
  • high Tool Misuse · line 76
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
How audits are shown
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.00033 $0.01027
Opus 5 $0.00016 $0.00513
Sonnet 5 $0.00007 $0.00205
Haiku 4.5 $0.00003 $0.00103

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

Security

Grade A, and why

secrets-leak-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 4d 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.

packages/kbot/skills/security-audit/secrets-leak-scan/SKILL.md · 110 lines

How it starts

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

Secrets Leak Scan

A leaked key in git history is a leaked key forever. This skill catches them before they ship and rotates them when they already did.

When to Use

  • Before pushing a new branch to a public remote
  • After any git rebase that touched config files
  • After a teammate says "I think I committed something I shouldn't have"
  • Quarterly, against the entire history, even if no one reported anything
  • Before open-sourcing a previously private repo

Iron Laws

A SECRET IN HISTORY IS A SECRET LEAKED.
ROTATE FIRST, EXPLAIN SECOND.
NEVER REWRITE PUBLIC HISTORY WITHOUT TEAM CONSENT.

Four Phases

Phase 1 — Working tree

Sweep what is on disk right now. The cheapest catch.

Patterns to grep, ranked by signal:

  • AKIA[0-9A-Z]{16} — AWS access key
  • sk-[A-Za-z0-9]{20,} — OpenAI / Anthropic / generic
  • xox[baprs]-[A-Za-z0-9-]+ — Slack tokens
  • ghp_[A-Za-z0-9]{36} / github_pat_[A-Za-z0-9_]{82} — GitHub PAT
  • -----BEGIN (RSA |OPENSSH |EC )?PRIVATE KEY----- — any private key
  • eyJ[A-Za-z0-9_-]{20,}\.[A-Za-z0-9_-]{20,}\.[A-Za-z0-9_-]{20,} — JWT
  • [A-Za-z0-9+/]{40,}={0,2} — long base64 (high false-positive, last resort)

Files that warrant a manual look regardless of grep hits: .env*, config/*.yml, *.pem, *.key, *credentials*, *secrets*.

Phase 2 — Git history

git rev-list --all | xargs -I{} git grep -E '<pattern>' {} -- '*.json' '*.yml' '*.env*' 2>/dev/null

For each hit:

  1. Identify the commit hash and author
  2. Determine the secret class (rotate-able? revoke-able?)
  3. Check whether the commit was ever pushed to a remote you don't fully control

Phase 3 — Rotate

Order of operations matters. Rotate before rewriting history — the old secret is already out there.

  1. Rotate the credential at the source (cloud console, OAuth app, GitHub).
  2. Audit the credential's recent usage — was anything done with it since the leak commit?
  3. Update the live deployment with the new credential.
  4. Confirm the old credential no longer works.

Read the full file on GitHub · 110 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. 4d ago First seen · 110 lines · 33 tokens per session scan A 9a2a382e67b6

Subscribe to this mod's changes

secrets-leak-scan is a skill published in the GitHub repository isaacsight/kernel (16 stars, last pushed 9d ago), licensed MIT. It adds 33 tokens to every session and 1,027 once invoked, about $0.0002 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-09-03.