What do you want to do?
3 use cases
-
Create a baseline of secrets already in your repo
Scan the repository once and save every potential secret to .secrets.baseline as your checklist.
View prompt
Using Yelp/detect-secrets, run `detect-secrets scan > .secrets.baseline` in <my repo> and summarize how many potential secrets were found per plugin type.
-
Block new secrets at commit time
Add the pre-commit hook so only staged files are scanned against the baseline before each commit.
View prompt
Set up Yelp/detect-secrets as a pre-commit hook in <my repo> using the README config, then run `git ls-files -z | xargs -0 detect-secrets-hook --baseline .secrets.baseline` and report any new findings.
-
Audit findings and cut false positives
Label baseline results as real or false, then tune plugins and exclusions to raise signal to noise.
View prompt
Using Yelp/detect-secrets, audit <my .secrets.baseline> with `detect-secrets audit .secrets.baseline`, then propose plugin and exclude settings that remove the false positives you labeled.
Quick start with Detect Secrets
- Check you have what it needs: Python with pip (`pip install detect-secrets`) or Homebrew (`brew install detect-secrets`); A git repository to scan; Optional: the pre-commit framework for the hook.
- Open Yelp/detect-secrets on GitHub and read the README and license.
- Install with
pip install detect-secrets - Run
detect-secrets scan > .secrets.baselinein the repository - Include untracked files with
detect-secrets scan test_data/ --all-files > .secrets.baselinewhen needed - Update it later with
detect-secrets scan --baseline .secrets.baseline
These steps come from our top use case, Create a baseline of secrets already in your repo, which also has a copy-paste agent prompt.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for Yelp/detect-secrets
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeAbout this repo
- Who it is forEngineering and security teams who want to stop new credentials landing in git without first cleaning every old one.
- Why it is hot4.7k stars, talked about in 2 AI sources we track
- Sourcegithub.com/Yelp/detect-secrets ยท Back to Hot repos
Requirements
- Python with pip (`pip install detect-secrets`) or Homebrew (`brew install detect-secrets`)
- A git repository to scan
- Optional: the pre-commit framework for the hook
Add this badge to your README
Maintain Detect Secrets? Show readers where to find these use cases.
Markdown
[](https://dedupedai.com/use-cases/yelp-detect-secrets/?utm_source=github&utm_medium=badge&utm_campaign=Yelp-detect-secrets)
HTML
<a href="https://dedupedai.com/use-cases/yelp-detect-secrets/?utm_source=github&utm_medium=badge&utm_campaign=Yelp-detect-secrets"><img src="https://dedupedai.com/badge/Yelp/detect-secrets.svg" alt="Use cases on Deduped" height="20"></a>
A static image, no tracking script. About the badge
Questions about Detect Secrets
What is Detect Secrets?
detect-secrets finds secrets such as API keys, tokens and private keys in a code base. It records the secrets already present in a baseline file, blocks new ones with a pre-commit hook that scans only changed files, lets you audit and label findings, and offers plugins and filters to tune signal to noise. It is an open-source project on GitHub: https://github.com/Yelp/detect-secrets.
How do I use Detect Secrets?
Install with pip install detect-secrets; then run detect-secrets scan > .secrets.baseline in the repository; Include untracked files with detect-secrets scan test_data/ --all-files > .secrets.baseline when needed. The use cases on this page give the full steps and a copy-paste agent prompt for each job.
Who is Detect Secrets for?
Engineering and security teams who want to stop new credentials landing in git without first cleaning every old one.
What can I do with Detect Secrets?
3 use cases so far, for example: Create a baseline of secrets already in your repo; Block new secrets at commit time; Audit findings and cut false positives. Each has steps and a copy-paste agent prompt.
What do I need to run Detect Secrets?
Python with pip (`pip install detect-secrets`) or Homebrew (`brew install detect-secrets`); A git repository to scan; Optional: the pre-commit framework for the hook.
What are alternatives to Detect Secrets?
Other hot AI repos in Security and science: Failproofai, Codex Security, Chgnet, Semgrep, Mace.
Is Detect Secrets safe to run?
Deduped does not own, audit or vouch for it. Read the README and license, run it on your own systems first and review every command before you run it.