Who it is forA security engineer rolling out scanning on a large repo with years of known findings.
The problemHundreds of old findings make a new scanner useless because nobody can see the new ones.
The outcomeScan reports that contain only issues introduced after the baseline.
What you need first
- Homebrew, Docker, Go to build from source, or a release binary
- pre-commit if you want the hook
- Read access to the repos or folders you scan
Steps
- Create a baseline report with
gitleaks git --report-path gitleaks-report.json - Triage the baseline once and rotate anything real
- Run later scans with
gitleaks git --baseline-path gitleaks-report.json --report-path findings.json - Tune rules in a custom .gitleaks.toml that extends the default config with useDefault
- Choose a report format such as sarif or junit with --report-format to feed your CI
Prompt for your agent
For <repo>, create a gitleaks/gitleaks baseline report, then add a CI step that runs gitleaks with --baseline-path so only new findings fail the build, writing SARIF output. Add a .gitleaks.toml that extends the default config.
Caveat. A baseline hides old findings; it does not make them safe, so rotate real secrets before you baseline them.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for gitleaks/gitleaks and "Adopt secret scanning on an old repo without the noise"
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 freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer