Gitleaks
$ gitleaks Official Low Riskgitleaks 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.
brew install gitleaks Local offline secret scanning via gitleaks --redact guarantees leaked keys never cross an RPC boundary.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
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--redactsafety flag
Purely read-only and offline; --redact prevents found secrets from entering agent transcripts (omitting --redact exposes raw matches).
- Zero network calls; built-in
--redactmasking
Single static Go binary via brew, go install, Docker, and GitHub releases.
- Cross-platform static binary
Essential pre-commit and repo-audit guardrail for coding agents handling .env or config edits.
- Fast regex + entropy rules for hundreds of provider tokens
Widely trusted OSS standard (gitleaks/gitleaks) under MIT license.
- Active upstream with regular rule updates
Clear README, .gitleaks.toml config docs, and --help.
- Detailed README and exit-code documentation
Security, Auth & Guardrails
None required; runs completely offline against local repositories and directories.
100% free, offline, and open-source (MIT).
# 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
gitleaks dir . --redact --report-format json --report-path - --no-banner
Scans working directory files read-only and streams redacted JSON findings to stdout.
gitleaks git --staged --redact --no-banner
Checks staged diffs for accidental credentials with secret values masked.
Strengths for Agents
- +
--redactmasks 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
--redactwill print matched secret strings into stdout—agents should make--redactmandatory.