tags:
- secrets
- security
- continuous-integration
- python
title: What is detect-secrets?
date created: Thursday, December 5th 2024, 1:27:43 pm
date modified: Thursday, September 25th 2025, 5:45:37 pm
permalink: what-is-detect-secretsdetect-secrets is a Python package from Yelp for detecting secrets within a code base.
pip install detect-secrets
Create an initial blank baseline.
detect-secrets scan > .secrets.baseline
Detect unknown secrets against the baseline.
detect-secrets scan --baseline .secrets.baseline
Allow certain secrets to be committed to the code base. For example, a variable named secret in a test file.
detect-secrets audit .secrets.baseline
A wizard will pop up and ask you if you want to allow each detected secret into code base. It will update the .secrets.baseline file depending on your answer.
For example, if you say "yes" and allow a secret, it will flag that secret with "is_secret": false in the baseline.