Freedom251 › Secrets Scanning Software
detect-secrets

What detect-secrets is
detect-secrets is an open-source Python tool for finding secrets in code changes and helping keep new ones from entering a codebase. Its heuristic checks use regular expressions, entropy detection, and keyword detection to flag potential secrets. A scan can create or update a baseline of potential secrets already in a repository. The project provides scan, hook, and audit commands to build baselines, flag new findings, and review baseline entries; audit lets analysts label findings as true or false positives and compare or report results. The project recommends configuring it as a pre-commit hook with the pre-commit framework. Users can tune detection with built-in or custom detector plugins and filters, exclusions, and inline allowlist comments. The package can also be imported into Python scripts to scan files and serialize findings. Installation is documented with pip or Homebrew, and the repository identifies its license as Apache-2.0. Word-list filtering and the gibberish detector require optional packages, and the gibberish detector is not enabled by default. The project cautions that its heuristic hook does not catch every secret, including multiline secrets and some default passwords.
Who it suits
The project describes itself as designed with enterprise clients in mind. It may suit teams using Git and pre-commit workflows who want configurable secret scanning and a reviewable baseline.
What it does well
- Scans can create or update a repository baseline.
- Audit supports true-or-false-positive labels and comparisons.
- Custom detector plugins and filters are supported.
- Python scripts can import the package to scan files.
What to know first
- The heuristic hook does not catch every secret.
- Some default passwords and multiline secrets can evade detection.
- Word-list filtering and gibberish detection need optional packages.
- The gibberish detector is not enabled by default.
Limits
Its heuristic pre-commit hook does not prevent all secrets, including multiline secrets and some default passwords; word-list filtering and the gibberish detector need optional packages, and the latter is disabled by default.
Plans
| Plan | Billed and limits | Price |
|---|---|---|
| detect-secrets | Open-source Python module; install with pip or Homebrew | Free |
As github.com lists them, read 9 Oct 2026. The maker's own page has the final word.
Getting started
- Install detect-secrets with pip or Homebrew.
- Use the scan command to create or update a repository baseline.
- Configure the project as a pre-commit hook with the pre-commit framework.
- Use the hook to flag new findings and the audit command to review baseline entries.
detect-secrets is a free Python module for spotting likely secrets in Git repositories and checking code changes before they are committed. It is best suited to teams that want a configurable, self-hosted check in their development workflow. Its baseline and review tools help manage existing findings, but its heuristic hook is not a complete barrier to secret leaks.
Overview
Introducing a scanner to an established codebase can surface old findings alongside new risks. detect-secrets addresses that distinction with a baseline: a scan records potential secrets already present, and later checks flag new matches in code changes. The audit command lets analysts label baseline findings as true or false positives, then report or compare results. This makes the tool more practical for repositories with existing findings, though teams still need to review and maintain the baseline.
Detection combines regular-expression rules, entropy heuristics, and keyword checks. That offers several ways to identify suspicious values, but the approach remains heuristic. The project cautions that the pre-commit hook misses some secrets, including multiline values and some default passwords. It is a useful development check, not a guarantee that secrets will stay out of Git.
Key features
Configurable detection
Teams can adjust built-in detectors and filters or develop custom detector plugins and filters. This flexibility suits organizations with coding conventions or secret formats that generic rules may not match. It also puts responsibility on the team to tune rules and keep them useful; customization does not remove the underlying limits of heuristic detection.
False-positive review
Matching lines, files, or secret values can be excluded, and inline allowlist comments can suppress particular matches. These options help keep recurring benign findings from overwhelming review. They require care: exclusions and allowlists can also hide a real secret if applied too broadly.
Development workflow
The project recommends connecting detect-secrets to the pre-commit framework, so checks run as part of the commit workflow. It can also be imported into Python scripts to scan files and serialize findings. Those options make it adaptable for teams that want either a hook-based check or a scripted workflow, but the documented hook limitations mean it should not be the only control.
Word-list filtering and the gibberish detector are optional extensions that require additional packages; the gibberish detector is not enabled by default. Teams that rely on either should account for the extra installation and configuration rather than assuming it is part of the default scan.
Pricing
detect-secrets is open source under the Apache-2.0 license. Its detect-secrets plan costs free and provides the Python module, installable with pip or Homebrew. There is no paid tier or free-trial period to weigh against the free use described here. This is a straightforward fit for teams comfortable installing and maintaining an open-source tool; it does not come with a published hosted-service plan.
Platforms
detect-secrets supports Linux, macOS, and Windows, and can be self-hosted. It works with Git and supports pre-commit scanning. That makes it relevant to teams standardizing checks around Git repositories across these operating systems, rather than readers seeking a browser-based service.
Who it's for
The project describes itself as designed with the enterprise client in mind. Teams that need to establish a baseline, review findings, and tune detection to their own codebase are the strongest fit, especially when they already use Git and can maintain a pre-commit workflow. Smaller teams can use the same free module, but should weigh the setup and review work against their need for a customizable local check. It is a weaker fit for anyone who needs a guarantee that all secrets will be caught or wants the hook to replace broader security controls.
Pros and cons
- Baseline separates old findings from new matches: teams can introduce scanning without treating every existing potential secret as a newly committed issue.
- Several tuning paths: custom detectors, filters, exclusions, and allowlist comments let teams adapt scanning and manage false positives.
- Free and self-hosted: the Apache-2.0 Python module can be installed with pip or Homebrew, without a paid plan.
- Heuristic coverage has known gaps: the hook may miss multiline secrets and some default passwords, so it cannot serve as the sole safeguard.
- Optional detection extras need separate packages: word-list filtering and the disabled-by-default gibberish detector add installation and configuration work.
Alternatives
For a wider set of options, browse Secrets Scanning Software. Choose Vooda AI instead if you want a freemium option with a self-hosted plan that has no seat limits. Amazon Deequ is a free Apache 2.0 open-source library, but it requires Apache Spark and a release matching the Spark version, making it relevant when that dependency fits your stack. ByteHide Secrets offers a free plan capped at 2,000 secrets for readers who want a defined free allowance.
DeepSource may suit teams looking for an open-source plan with unlimited public repositories and team members, alongside a stated cap of 1,000 pull request reviews. Endor Labs offers individual developers free local scans via its AURI MCP server without an account, but its Developer plan has no UI, policies, or scan history. ggshield is another freemium alternative; its CLI is open source, while the secrets detection library behind GitGuardian’s public API is closed source. GitGuardian is worth considering for a freemium option whose Starter plan covers up to 25 developers and includes unlimited real-time scanning, with historical detection capped at 500.
Semgrep Code is a paid product with a free edition that includes Code and Supply Chain for up to 10 repositories and 10 contributors, so it may fit teams wanting those broader code and supply-chain checks within those caps.
Verdict
Choose detect-secrets if your team wants a free, self-hosted Git check with baselines, audit review, and room to tune detection to its own codebase. Its main advantage is a workflow that distinguishes inherited findings from new matches without requiring a paid plan. Look elsewhere if your priority is comprehensive prevention: the project acknowledges that its heuristic hook misses some secrets, so it belongs as one layer in a security process, not the final line of defense.
Verdict
detect-secrets offers configurable scanning, baseline review, and pre-commit integration. Its documented limitations mean the heuristic hook should not be treated as catching every secret.
Questions
Is detect-secrets free?
Yes. The listed plan is free, and the project is open source.
Which platforms does it support?
It supports Linux, macOS, and Windows. It supports Git repositories.
How can I install it?
Installation is documented with pip or Homebrew.
Does it support pre-commit scanning?
Yes. The project recommends configuring it as a pre-commit hook through the pre-commit framework.
Can I customize what it detects?
Yes. Users can adjust built-in plugins and filters or develop custom detector plugins and filters.
What are its detection limits?
The project says its heuristic hook does not catch every secret, including multiline secrets and some default passwords.
Facts from detect-secrets's own pages
- Audit
- The audit command lets analysts label baseline findings as true or false positives and report or compare results. · github.com, 9 Oct 2026
- Baseline
- A scan creates a baseline of potential secrets already present in a repository. · github.com, 4 Oct 2026
- Baselines
- The scan command creates or updates a baseline of potential secrets found in a repository. · github.com, 9 Oct 2026
- Custom detectors
- Users can develop custom detector plugins and use them with the engine. · github.com, 9 Oct 2026
- Customization
- Users can develop custom detector plugins and filters, and adjust built-in plugins and filters. · github.com, 4 Oct 2026
- Detection
- Its detection strategies include regex rules, entropy heuristics, and keyword detection. · github.com, 9 Oct 2026
- Detection approach
- It checks code changes using heuristically crafted regular expressions to identify newly committed secrets. · github.com, 4 Oct 2026
- Detection methods
- Its detection strategies include regex rules, entropy detection, and keyword detection. · github.com, 4 Oct 2026
- False positive handling
- Users can exclude matching lines, files, or secret values and can use inline allowlist comments. · github.com, 4 Oct 2026
- False positives
- Users can tune scanning with built-in or custom filters, exclusions, and inline allowlist comments. · github.com, 9 Oct 2026
- Installation
- The project documents installation with pip or Homebrew. · github.com, 4 Oct 2026
- Integrations
- The README documents installation through pip and Homebrew and integration as a pre-commit hook. · github.com, 9 Oct 2026
- Intended users
- The project describes itself as designed with the enterprise client in mind. · github.com, 4 Oct 2026
- License
- The repository identifies its license as Apache-2.0. · github.com, 9 Oct 2026
- Limitations
- The project says its heuristic hook does not prevent every secret and lists multiline secrets and some default passwords as cases it will not prevent. · github.com, 9 Oct 2026
- Optional extensions
- Word-list filtering and the gibberish detector require optional packages; the gibberish detector is not enabled by default. · github.com, 4 Oct 2026
- Optional extras
- Word-list filtering and a gibberish detector are optional features that require additional packages. · github.com, 9 Oct 2026
- Purpose
- detect-secrets detects secrets in code and helps prevent new secrets from entering a codebase. · github.com, 9 Oct 2026
- Python use
- The package can also be imported into Python scripts to scan files and serialize findings. · github.com, 9 Oct 2026
- Scanning tools
- The project provides scan, hook, and audit commands to create baselines, flag new secrets, and review baseline findings. · github.com, 4 Oct 2026
- Workflow
- The project recommends using detect-secrets as a pre-commit hook through the pre-commit framework. · github.com, 9 Oct 2026
Where detect-secrets stands on Freedom251
- Secrets Scanning Software#4 of 24