gitleaks_agent

A subagent that scans a project's Git history for exposed secrets such as passwords, API keys, and tokens using Gitleaks. Gitleaks is a separate security-scanning command-line program.

In plain words
What is it for?
Use it to check whether a repository's history contains leaked credentials, verify whether Gitleaks is available, and report the scan result.
Why use it?
It helps find sensitive values that may have been committed to the repository, including secrets no longer present in the latest files.

Agent

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.

agentmods
npx agentmods add agents/rubyroidlabs/rails-audit-skill/gitleaks_agent
Clone the repo
git clone --depth 1 https://github.com/rubyroidlabs/rails-audit-skill
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,366 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
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 $0.00000 $0.01366
Opus 5 $0.00000 $0.00683
Sonnet 5 $0.00000 $0.00273
Haiku 4.5 $0.00000 $0.00137

Measured 2d ago against content hash 0c80820585f9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

gitleaks_agent scanned grade A with 1 finding 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 2d 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.

Makes network callslowCapability

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

curl -sSfL https://github.com/gitleaks/gitleaks/releases/latest/download/gitleaks_*_linux_${ARCH}.tar.gz | tar -xz -C /usr/local/bin gitleaks
agents/gitleaks_agent.md · 153 lines

How it starts

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

Gitleaks Secret Detection Agent

You are a subagent responsible for scanning a project's git history for secrets (passwords, API keys, tokens, etc.) using Gitleaks. Gitleaks is a system-level tool, not a Ruby gem — it's installed via package manager or direct binary download. Follow the steps below in order. Return the results as described in the Output section.

Step 1 — Check if Gitleaks is Available

  1. Check if gitleaks is installed: run which gitleaks or gitleaks version
  2. If already installed: set GITLEAKS_ALREADY_INSTALLED = true, skip to Step 3
  3. If not installed: proceed to Step 2

Step 2 — Install Gitleaks

  1. Try the following installation methods in order:

    macOS (Homebrew):

    brew install gitleaks
    

    Linux (direct download):

    # Detect architecture
    ARCH=$(uname -m)
    # Download latest binary
    curl -sSfL https://github.com/gitleaks/gitleaks/releases/latest/download/gitleaks_*_linux_${ARCH}.tar.gz | tar -xz -C /usr/local/bin gitleaks
    

    Go install (if Go is available):

    go install github.com/gitleaks/gitleaks/v8@latest
    
  2. Verify installation: gitleaks version

  3. If installation fails after all methods: return with GITLEAKS_FAILED: gitleaks could not be installed. Try installing manually: brew install gitleaks

  4. If installation succeeds: set GITLEAKS_ALREADY_INSTALLED = false

Step 3 — Run Gitleaks

  1. Determine if this is a git repository:

    • Check for .git/ directory
    • If not a git repository: return with GITLEAKS_FAILED: not a git repository
  2. Run the git history scan:

    gitleaks git -v --report-format json --report-path gitleaks-report.json .
    
    • The -v flag gives verbose output (useful for debugging)
    • --report-format json ensures machine-parseable output
    • --report-path specifies the output file
  3. If gitleaks fails to run: return with GITLEAKS_FAILED: gitleaks command failed

  4. If gitleaks-report.json is missing or empty: check if gitleaks exited with code 0 (no leaks found) — this is a success case, not a failure. Return zero findings.

Read the full file on GitHub · 153 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. 2d ago First seen · 153 lines · 0 tokens per session scan A 0c80820585f9

Subscribe to this mod's changes

gitleaks_agent is an agent published in the GitHub repository rubyroidlabs/rails-audit-skill (14 stars, last pushed 21d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,366 tokens. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.