secret-detection

secret-detection is a skill for Claude Code from sawrus/agent-guides. It costs 31 tokens per session (1,331 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 Code

Written for Claude Code: allowed-tools in frontmatter.

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.

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 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,331 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.00031 $0.01331
Opus 5 $0.00015 $0.00665
Sonnet 5 $0.00006 $0.00266
Haiku 4.5 $0.00003 $0.00133

Measured 9d ago against content hash 73c39680eea1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, 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 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.

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

How it starts

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

Skill: Secret Detection

Expertise: trufflehog, gitleaks, git-secrets, pre-commit hooks, CI scanning, secret rotation playbook.

When to load

When setting up secret scanning pre-commit or in CI, investigating a potential credential leak, or remediating secrets found in git history.

Pre-Commit Hook Setup

# Install pre-commit
pip install pre-commit

# .pre-commit-config.yaml
repos:
  - repo: https://github.com/trufflesecurity/trufflehog
    rev: v3.88.0
    hooks:
      - id: trufflehog
        name: TruffleHog — secret scan
        entry: trufflehog git file://. --since-commit HEAD --only-verified --fail
        language: system
        pass_filenames: false

  - repo: https://github.com/gitleaks/gitleaks
    rev: v8.21.0
    hooks:
      - id: gitleaks
        name: Gitleaks — detect hardcoded secrets
# Install hooks for all team members (add to onboarding docs)
pre-commit install
pre-commit install --hook-type commit-msg

# Run against all files (one-time audit)
pre-commit run trufflehog --all-files
pre-commit run gitleaks --all-files

CI: trufflehog (GitHub Actions)

- name: Scan for secrets (trufflehog)
  uses: trufflesecurity/trufflehog@main
  with:
    path: ./
    base: ${{ github.event.repository.default_branch }}
    head: HEAD
    extra_args: >
      --only-verified
      --fail
      --format json
      --json-output trufflehog-results.json
  continue-on-error: false    # hard fail

- name: Upload results
  if: failure()
  uses: actions/upload-artifact@v4
  with:
    name: secret-scan-results
    path: trufflehog-results.json

CI: gitleaks (GitLab CI)

secret-scan:
  stage: validate
  image: zricethezav/gitleaks:latest
  script:
    - gitleaks detect
        --source .
        --config .gitleaks.toml
        --redact
        --exit-code 1
        --report-format json
        --report-path gitleaks-report.json
  artifacts:
    when: on_failure
    paths: [gitleaks-report.json]

gitleaks Configuration (.gitleaks.toml)

Read the full file on GitHub · 191 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. 9d 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 (17 stars, last pushed 8d ago), licensed MIT. It adds 31 tokens to every session and 1,331 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-08-30.