# Yelp/detect-secrets

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

Repository: https://github.com/Yelp/detect-secrets
Canonical: https://ross.abutalabs.com/products/detect-secrets
Language: Python
License: Apache-2.0
License Family: permissive
Last push: 2026-04-02T17:10:40+00:00

## Health v2 (maintenance only)
Score: 57/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 75, release rhythm 8, longevity 100
- inputs: {"age_days": 3194, "days_push": 153, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4629, forks 565 (observed 2026-08-28T04:08:55.286174+00:00)

## What it is
detect-secrets is a Python CLI tool from Yelp that detects secrets (API keys, passwords, tokens) in codebases using regex and entropy heuristics. It maintains a baseline of existing secrets so teams can prevent new ones from entering the codebase without needing to remediate all legacy secrets at once.

## Use cases
- scan my repo for hardcoded api keys and passwords
- prevent new secrets from being committed to git
- create a baseline of existing secrets in a large legacy codebase
- add secret detection to pre-commit hooks
- audit a codebase for leaked credentials before open-sourcing

## When to choose
- you want enterprise-friendly secret scanning with a baseline workflow that avoids re-scanning git history
- you need pre-commit or CI integration to block new secrets while tolerating a known backlog
- you want a lightweight, fast Python-based scanner without heavy dependencies

## When to avoid
- you need deep git-history scanning to find secrets in past commits
- you require advanced ML-based or verified live-credential detection offered by commercial secret scanners
- you need runtime secret management or vaulting rather than detection

## Facets
- artifact type: cli-tool
- maturity: active
- function: security, vulnerability-scanning, cli, developer-tools
- domain: security, developer-tools, version-control
- platform: python, cli, cross-platform, windows
- tags: secrets-detection, pre-commit, baseline-scanning, credential-scanning, static-analysis, macos, linux

## Member repositories
- Yelp/detect-secrets (main) score 57

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:55.286174+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:19:36.699739+00:00, confidence not recorded.
  - readme: https://github.com/Yelp/detect-secrets (fetched 2026-08-28T04:08:55.286174+00:00, sha d88a270660d9)
  - registry_pypi: https://pypi.org/pypi/detect-secrets/json (fetched 2026-08-29T09:04:23.197038+00:00, sha b68bcd5ea143)
- Data as of 2026-08-30T08:39:29.467469+00:00.
