secret-detection

secret-detection is a skill for Claude Code, Codex from sawrus/agent-guides. It costs 52 tokens per session (616 once invoked), scanned A, original, MIT.

Secret-scanning guidance for finding exposed passwords, API keys, and other credentials in code, Git history, and running containers.

In plain words
What is it for?
Use it to set up pre-commit checks, CI scans, repository audits, and secret-rotation procedures.
Why use it?
It helps catch credentials before they are committed or shipped, and guides response when a secret has already leaked.

Skill for Claude CodeCodex

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

Good fit Use it to set up pre-commit checks, CI scans, repository audits, and secret-rotation procedures.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sawrus/agent-guides/secret-detection
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 sawrus/agent-guides --skill secret-detection
Clone the repo
git clone --depth 1 https://github.com/sawrus/agent-guides

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-detection

README.md
[![agentmods](https://agentmods.dev/badge/skills/sawrus/agent-guides/secret-detection/github.svg)](https://agentmods.dev/skills/sawrus/agent-guides/secret-detection)
Your own site
<a href="https://agentmods.dev/skills/sawrus/agent-guides/secret-detection"><img src="https://agentmods.dev/badge/skills/sawrus/agent-guides/secret-detection/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-detection

Your own site · 80×15
<a href="https://agentmods.dev/skills/sawrus/agent-guides/secret-detection"><img src="https://agentmods.dev/badge/skills/sawrus/agent-guides/secret-detection.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 616 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: 1 finding, 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 Tool Misuse · line 161
    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.00052 $0.00616
Opus 5.5 $0.00021 $0.00246
Sonnet 5.5 $0.00010 $0.00123
Haiku 4.5 $0.00005 $0.00062

Measured 1mo ago against content hash 3cd77e83abb1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

secret-detection 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 1mo 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.

areas/devops/devsecops/skills/secret-detection/SKILL.md · 56 lines

How it starts

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

Secret detection and leak response

1. Scan

gitleaks dir . --redact --report-format json --report-path /tmp/gitleaks.json   # working tree
gitleaks git . --redact --log-opts="--all"                                       # full history

Use --redact so the output does not print the secret again.

2. Triage each hit

  1. Open the file and line. Decide: real secret, test fixture, or false positive.
  2. A test fixture or false positive goes into .gitleaks.toml as an allowlist entry with a path or a regex and a comment with the reason. Do not allowlist a whole directory of source code.
  3. A real secret is a leak, even if the branch was never merged. Go to step 3.

3. Respond to a real leak

  1. Tell the user at once: which secret, where, and since which commit.
  2. Rotate first. Ask the user first, because revoking the old value can break running services. Create the new value in the secret store, deploy it, then revoke the old one.
  3. Check the provider audit log for use of the old value between the leak commit and the revocation.
  4. Remove the value from the code and read it from the environment or the secret store.
  5. Rewrite history only if the user asks: git filter-repo --replace-text <file> needs a force push and every clone to re-clone. Rotation is required either way; history rewrite does not undo the leak.

4. Prevent the next leak

  1. Add the pre-commit hook:
- repo: https://github.com/gitleaks/gitleaks
  rev: v8.21.2
  hooks:
    - id: gitleaks
  1. Add a CI job that fails on a hit:
    • GitLab: include the Jobs/Secret-Detection.gitlab-ci.yml template, or run gitleaks git . --redact --log-opts="$CI_MERGE_REQUEST_DIFF_BASE_SHA..HEAD" in a job.
    • GitHub: run gitleaks git . --redact in a job, or enable push protection in the repository settings.
  2. Add .env and key file patterns (*.pem, *.key) to .gitignore.

5. Done

  • The full-history scan has no untriaged hits.
  • Every real secret is rotated, and the old value is revoked.
  • Pre-commit and CI run the scan.

Read the full file on GitHub · 56 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. 1mo ago Changed · -135 lines · +21 tokens per session 3cd77e83abb1
  2. 3mo ago First seen · 191 lines · 31 tokens per session scan A 73c39680eea1

Subscribe to this mod's changes

secret-detection is a skill published in the GitHub repository sawrus/agent-guides (21 stars, last pushed today), licensed MIT. It adds 52 tokens to every session and 616 once invoked, about $0.0002 per session on Opus 5.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-30.

Related

secret-detection compared with skills from other repositories

secret-detection next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
secret-detectionsawrus/agent-guidesSkill21todayMITA52Claude Code, Codex
idea-refineaddyosmani/agent-skillsSkill122k7d agoMITA75Claude Code
agent-framework-azure-ai-pysickn33/agentic-awesome-skillsSkill51ktodayMITA24Claude Code
apify-integration-developmentsickn33/agentic-awesome-skillsSkill51ktodayMITA25Claude Code
ai-image-generation-studiosickn33/agentic-awesome-skillsSkill51ktodayMITA30Claude Code
aws-cdk-developmentsickn33/agentic-awesome-skillsSkill51ktodayMITA24Claude Code
azd-deploymentsickn33/agentic-awesome-skillsSkill51ktodayMITA37Claude Code