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

detect-secrets

$ detect-secrets Official Low Risk
Yelp · Code & DevOps · Apache-2.0 · macos / linux / windows

Yelp's enterprise secret-scanning CLI combining entropy heuristics and provider regex detectors to flag hardcoded API keys, private keys, and tokens without scanning git history by default. detect-secrets scan writes structured JSON directly to stdout, while detect-secrets audit is interactive.

FCRS-1.0 Score
80 /100
Good
Medium Confidence
Zero-Friction Install
brew install detect-secrets
CLI vs MCP Decision CLI Only

Scans workspace files offline and emits JSON baselines in under a second; never send repo secrets through MCP.

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 20 / 25

detect-secrets scan natively outputs clean JSON to stdout, but detect-secrets audit is interactive-TTY only and scan exits 0 even when secrets are found.

  • detect-secrets scan outputs JSON natively to stdout
  • detect-secrets audit blocks on interactive stdin prompts
  • scan exits 0 unless wrapped with detect-secrets-hook
Trust & Safety 22 / 25

Hashes detected secrets in JSON baselines instead of leaking raw secret values; purely offline.

  • Stores SHA-1 hashes rather than plaintext secrets in baselines
Setup & Portability 12 / 15

Available via Homebrew, PyPI, and uvx, requiring Python.

  • Standard Python package via brew, pip, or uvx
Utility & Efficiency 12 / 15

Great baseline workflow for pre-commit, though gitleaks and trufflehog cover full git history and live verification better.

  • Strong baseline-diffing for incremental CI and pre-commit
Maintenance & Lineage 7 / 10

Created by Yelp (Yelp/detect-secrets) under Apache-2.0, with moderate maintenance cadence.

  • Official Yelp/detect-secrets repository
Docs & Verifiability 7 / 10

Detailed README covering plugins, baselines, and pre-commit integration.

  • Official README at github.com/Yelp/detect-secrets

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

Offline local scanner; stores only hashed secret fingerprints in .secrets.baseline.

Side Effects
Read-Only Local Write
Cost & Quotas

Apache-2.0 open-source Python CLI; completely free.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# detect-secrets Agent Rules
- Use `detect-secrets scan <path>` for non-interactive JSON output; NEVER invoke `detect-secrets audit`, which requires an interactive TTY.
- Never print raw matched secrets back to external logs; inspect only filenames, types, and line numbers.

Agent-Ready Command Recipes

Safe Read-Only Queries

Scan directory and emit JSON findings to stdout
detect-secrets scan src/

Scans src/ and prints a structured JSON report containing results with hashed secrets and line numbers.

Scan all tracked files against existing baseline
detect-secrets scan --baseline .secrets.baseline

Updates or verifies findings against .secrets.baseline (redirect stdout or avoid overwriting if checking read-only).

Controlled Writes & Previews

Generate an initial .secrets.baseline file
detect-secrets scan > .secrets.baseline

Writes the JSON baseline file for pre-commit hook enforcement.

Strengths for Agents

  • + detect-secrets scan outputs clean JSON directly to stdout without extra flags and hashes secret values.
  • + Baseline file model suppresses known test fixtures cleanly in CI.

Caveats & Pitfalls

  • ! detect-secrets audit is strictly interactive and will hang headless agents.
  • ! detect-secrets scan exits 0 even when secrets are detected (must parse results JSON or use detect-secrets-hook).

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI