detect-secrets
detect-secrets scans codebases for credentials using pattern plugins, entropy analysis, and heuristics, and its distinguishing feature is the baseline file: existing secrets are recorded once so only new leaks block the build. It is open source under the Apache-2.0 license. It runs on Linux, macOS, and Windows.
Updated
- Pricing
- Open Source
- License
- Apache-2.0
- Platforms
- Linux, macOS, Windows
- Category
- Application Security Tools
What Is detect-secrets?
detect-secrets scans codebases for credentials using pattern plugins, entropy analysis, and heuristics, and its distinguishing feature is the baseline file: existing secrets are recorded once so only new leaks block the build. Pre-commit hooks and CI integration are first-class, and the companion detect-secrets-server stopped active development in 2021. Microsoft's Code-With Engineering Playbook includes a detect-secrets recipe for pre-commit and CI use.
Use Cases
Introducing secret scanning into a codebase with a history, where blocking all existing findings is impractical.
Strengths and Limitations
Strengths
- +Baseline model enables adoption without an initial fire drill.
- +Documented pre-commit hook blocks new secrets that are not in the baseline.
- +Plugin system extends detection.
Limitations
- -Baseline hygiene requires ongoing review.
- -Fewer detectors than commercial platforms.
Defensive Use
Preventing new secrets from entering source control while tracking a remediation baseline.
detect-secrets Alternatives
3 tools| Tool | License | Platforms | Pricing |
|---|---|---|---|
| GitGuardian Secrets detection platform scanning repositories, CI, and developer tools, with non-human identity governance. | Proprietary | Web | Freemium |
| Gitleaks Open-source secret scanner for git repositories, CI/CD pipelines, and pre-commit hooks, detecting hardcoded API keys, tokens, and passwords. | MIT | Linux, macOS, Windows | Open Source |
| TruffleHog Open-source and commercial secret scanner with verified credential detection across source code, cloud storage, CI/CD, and SaaS platforms. | AGPL-3.0-only | Linux, macOS, Windows | Free / Commercial |
Frequently Asked Questions
What is detect-secrets?→
detect-secrets scans codebases for credentials using pattern plugins, entropy analysis, and heuristics, and its distinguishing feature is the baseline file: existing secrets are recorded once so only new leaks block the build. Pre-commit hooks and CI integration are first-class, and the companion detect-secrets-server stopped active development in 2021. Microsoft's Code-With Engineering Playbook includes a detect-secrets recipe for pre-commit and CI use.
What is detect-secrets used for?→
Introducing secret scanning into a codebase with a history, where blocking all existing findings is impractical.
What are the strengths of detect-secrets?→
- +Baseline model enables adoption without an initial fire drill.
- +Documented pre-commit hook blocks new secrets that are not in the baseline.
- +Plugin system extends detection.
What are the limitations of detect-secrets?→
- +Baseline hygiene requires ongoing review.
- +Fewer detectors than commercial platforms.
How is detect-secrets used defensively?→
Preventing new secrets from entering source control while tracking a remediation baseline.