# detect-secrets

> An enterprise friendly way of detecting and preventing secrets in code.

Source: https://talira.ai/catalog/detect-secrets-eb4tk1py
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Command-line tool, Library
- Categories: [security / secret scanning](https://talira.ai/categories/security/secret-scanning), [developer tools / git / hooks](https://talira.ai/categories/developer-tools/git/hooks)
- Platforms: linux, macos, windows, cli[^2]
- Licence: Apache-2.0[^3]
- Pricing: Free and open source[^3]
- Free tier: yes[^3]
- Self-hostable: yes[^2]
- Plugins: yes[^2]
- Backed by: [Yelp](https://talira.ai/orgs/yelp.md)
- Funding: public company (NYSE:YELP)[^4]

detect-secrets is Yelp's Python tool for keeping new secrets out of a codebase. Instead of digging through the whole git history, it records the secrets a repository already has in a `.secrets.baseline` file and then blocks new ones, usually from a [pre-commit](https://talira.ai/catalog/pre-commit-ymy35rpp.md) hook (`detect-secrets-hook`), so a team can stop the problem growing before it cleans up what's there. Plugins detect AWS, [GitHub](https://talira.ai/catalog/github-ppcgj756.md), [GitLab](https://talira.ai/catalog/gitlab-y85n5jcy.md), [Slack](https://talira.ai/catalog/slack-bp8cdfdq.md), [Stripe](https://talira.ai/catalog/stripe-7hv028ya.md), OpenAI and other keys, private keys, JWTs and high-entropy strings; `detect-secrets audit` labels each finding as real or a false positive, and filters and custom plugins tune the noise. It's Apache-2.0; compare [Gitleaks](https://talira.ai/catalog/gitleaks-b0pf99yg.md) and [TruffleHog](https://talira.ai/catalog/trufflehog-0249f3m2.md).

## Links

- GitHub: https://github.com/Yelp/detect-secrets

## Ways to install

### Package managers

- [Homebrew](https://talira.ai/catalog/homebrew-djy17yn9.md): <https://formulae.brew.sh/formula/detect-secrets>[^1]

## Problems it solves

- stop developers committing new API keys and passwords without first cleaning up every old secret in a huge repo
- a pre-commit hook that blocks commits containing secrets
- record the secrets our repository already has as a baseline and only alert on new ones
- audit a list of suspected secrets and mark which ones are false positives
- get a checklist of credentials in our code that need rotating and moving to a vault
- detect high-entropy strings that look like keys or tokens in source files
- write a custom detector for our own internal token format
- scan files that aren't tracked by git for hardcoded secrets
- check in CI whether someone bypassed the secrets pre-commit hook

## Features

- detect-secrets scan writes a .secrets.baseline of current findings
- detect-secrets-hook checks staged files against the baseline as a pre-commit hook
- detect-secrets audit labels findings as true or false positives
- plugins for AWS, Azure Storage, Artifactory, Discord, GitHub, GitLab, IBM Cloud, Mailchimp, npm, OpenAI, PyPI, SendGrid, Slack, Square, Stripe, Telegram and Twilio keys
- Base64 and hex high-entropy string detectors with adjustable limits
- keyword, private key, basic auth, JWT and public IP detectors
- custom plugins and filters loaded from files
- allowlist secret inline comments
- --only-verified to report only secrets that verify against their service
- usable as a Python library (SecretsCollection)

## Limitations

- Doesn't scan git history: it scans current files and new changes against a baseline[^2]
- Doesn't catch multi-line secrets or default passwords that don't trigger its keyword detector[^2]

## Capabilities

- Has a command line tool: plan not known
- Takes plugins: plan not known
- Has official SDKs: plan not known

## Trust

Overall: 0.48 out of 1.
Signals: backing 0.55, extensibility 0.40.

- backed by Yelp
- funding: public company (NYSE:YELP)
- has a plugin system

Warnings:

- GitHub activity not fetched yet

## Alternatives

- [GitGuardian](https://talira.ai/catalog/gitguardian-d4py8bka.md): Detect and validate hardcoded secrets across your SDLC
- [Gitleaks](https://talira.ai/catalog/gitleaks-b0pf99yg.md): Find secrets with Gitleaks
- [Kingfisher](https://talira.ai/catalog/kingfisher-84p0ekrp.md): Detect secrets. Validate them live. Map blast radius. Revoke fast.
- [TruffleHog](https://talira.ai/catalog/trufflehog-0249f3m2.md): Find, verify, and analyze leaked credentials
- [GitHub Secret Protection](https://talira.ai/catalog/github-secret-protection-wya2z0sz.md): Secret scanning and push protection for private repositories, per active committer
- [SonarQube](https://talira.ai/catalog/sonarqube-hv6cp5td.md): Code confidence for the agentic software factory

## Sources

[^1]: https://formulae.brew.sh/api/formula.json (checked 21 Nov 2026)
[^2]: https://github.com/Yelp/detect-secrets/blob/master/README.md (checked 20 Nov 2026)
[^3]: https://github.com/Yelp/detect-secrets/blob/master/LICENSE (checked 20 Nov 2026)
[^4]: https://data.sec.gov/submissions/CIK0001345016.json (checked 20 Nov 2026)
