
detect-secrets
An enterprise friendly way of detecting and preventing secrets in code.
The Lens
By Erik Loyd, SaaS CEO and former COO/CFO of an AWS Premier Partner.
Updated Jul 2026
detect-secrets stops credentials from getting committed to your repo in the first place. It scans code for things that look like passwords, API keys, and tokens, and it's built to run as a pre-commit hook so a leaked secret gets caught before it ever lands in git history. Open source, from Yelp, free.
Its trick is a baseline file: it records the secrets it already knows about, including false positives you've marked, so it only alerts on new ones. That keeps it quiet enough to actually leave enabled, which is the whole game with secret scanning. Setup is a pip install and a pre-commit config, and it runs locally with no service.
Fully free, no paid tier. It sits in a crowded space: Gitleaks and TruffleHog are the other open source options, and each has a slightly different angle. detect-secrets leans hardest into the pre-commit, baseline-driven workflow, which makes it a strong default for stopping leaks at the source rather than finding them after.
The catch: it catches secrets that match its detectors and heuristics, not every possible secret. A credential in an unusual format can slip past, and the baseline approach means a secret already in your history won't get flagged. It's prevention going forward, not a cleanup tool for what already leaked.
Free vs Self-Hosted vs Paid
fully freeSelf-hosted (free): detect-secrets under Apache-2.0, from Yelp. A Python tool built to run as a pre-commit hook, catching credentials before they land in git. A baseline file records known secrets and false positives so it only alerts on new ones. Runs locally, no service.
Commercial: None.
The call: A strong default for stopping leaks at the source. Gitleaks and TruffleHog are the other free options, each with a slightly different angle.
Completely free and open source. No paid tier.
What to do by team size
- Solo
- Free. Run it as a pre-commit hook.
- Small team
- Free. Baseline file keeps it quiet enough to leave on.
- Medium team
- Free; enforce the pre-commit hook across the team.
- Large team
- Free; larger orgs often pair it with a server-side scanner for coverage.
Get tools like this every Wednesday
One featured tool, three on the radar. No fluff.
Similar Tools

Find vulnerabilities, misconfigurations, secrets, SBOM in containers, Kubernetes, code repositories, clouds and more

Find secrets with Gitleaks 🔑

Open source secret management platform

A vulnerability scanner for container images and filesystems

Prevent cloud misconfigurations and find vulnerabilities during build-time in infrastructure as code, container images and open source packages with Checkov by Bridgecrew.

Deepsec is a security harness for finding vulnerabilities in your codebase powered by coding agents
A low score is not a verdict on quality. Young and niche tools start low by design. How we calculate scores
Trust Signals
About
- Owner
- Yelp.com (Organization)
- Stars
- 4,621
- Forks
- 565
Explore Further
More tools in the directory
openclaw
Your own personal AI assistant. Any OS. Any Platform. The lobster way. 🦞
386.5k ★everything-claude-code
The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
240.5k ★hermes-agent
The agent that grows with you
231.6k ★