Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

Gitleaks

$ gitleaks Official Low Risk
Zachary Rice / Gitleaks · Security & Secrets · MIT · macos / linux / windows

gitleaks scans git history, staged changes, and local directories for leaked API keys, tokens, and private keys. Passing --redact replaces matched secret values with REDACTED so agents can pinpoint and remediate leaks without pulling raw credentials into LLM context.

FCRS-1.0 Score
93 /100
Excellent
Medium Confidence
Zero-Friction Install
brew install gitleaks
CLI vs MCP Decision CLI Preferred vs MCP

Local offline secret scanning via gitleaks --redact guarantees leaked keys never cross an RPC boundary.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
✓ Read-Only Mode
✓ NO_COLOR Clean
— Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 24 / 25

Supports --report-format json, --report-path -, --no-banner, --redact, and clean exit codes (0 clean, 1 leaks found).

  • Native JSON stdout via --report-path - and --redact safety flag
Trust & Safety 23 / 25

Purely read-only and offline; --redact prevents found secrets from entering agent transcripts (omitting --redact exposes raw matches).

  • Zero network calls; built-in --redact masking
Setup & Portability 14 / 15

Single static Go binary via brew, go install, Docker, and GitHub releases.

  • Cross-platform static binary
Utility & Efficiency 14 / 15

Essential pre-commit and repo-audit guardrail for coding agents handling .env or config edits.

  • Fast regex + entropy rules for hundreds of provider tokens
Maintenance & Lineage 9 / 10

Widely trusted OSS standard (gitleaks/gitleaks) under MIT license.

  • Active upstream with regular rule updates
Docs & Verifiability 9 / 10

Clear README, .gitleaks.toml config docs, and --help.

  • Detailed README and exit-code documentation

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

None required; runs completely offline against local repositories and directories.

Side Effects
Read-Only
Cost & Quotas

100% free, offline, and open-source (MIT).

Copyable Guardrail for CLAUDE.md / AGENTS.md
# Gitleaks Agent Rules
- ALWAYS pass `--redact` so detected secrets are masked and never echoed into the LLM transcript.
- Pass `--report-format json --report-path - --no-banner` for clean stdout parsing (note exit code `1` means leaks found).

Agent-Ready Command Recipes

Safe Read-Only Queries

Scan current working tree with secrets redacted in JSON
gitleaks dir . --redact --report-format json --report-path - --no-banner

Scans working directory files read-only and streams redacted JSON findings to stdout.

Audit staged git changes before committing
gitleaks git --staged --redact --no-banner

Checks staged diffs for accidental credentials with secret values masked.

Strengths for Agents

  • + --redact masks leaked secret values while preserving exact file, line, and rule metadata in JSON.
  • + 100% offline, strictly read-only, and fast across both git history and working trees.

Caveats & Pitfalls

  • ! Omitting --redact will print matched secret strings into stdout—agents should make --redact mandatory.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI