What do you want to do?
3 use cases
-
Scan a repo's full history for leaked secrets
Run Gitleaks over every commit to find passwords, API keys and tokens that were ever committed.
View prompt
Install gitleaks/gitleaks and scan the full git history of <repo> with redaction on, saving a JSON report. Summarize the findings by rule and file, mark likely false positives, and list which credentials I should rotate first.
-
Stop secrets before they are committed
Add Gitleaks as a pre-commit hook so a commit containing a secret fails on the developer's machine.
View prompt
Set up gitleaks/gitleaks as a pre-commit hook in <repo>: write .pre-commit-config.yaml, run pre-commit autoupdate and pre-commit install, then prove it works by trying to commit a file with a fake API key. Do not commit the test file.
-
Adopt secret scanning on an old repo without the noise
Save current findings as a baseline so later scans only report new secrets.
View prompt
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.
Quick start with Gitleaks
- Check you have what it needs: 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.
- Open gitleaks/gitleaks on GitHub and read the README and license.
- Install with
brew install gitleaksordocker pull zricethezav/gitleaks:latest - Run
gitleaks git -vinside the repo to scan its git history with verbose output - Save a report with
gitleaks git --report-path gitleaks-report.json - Use --redact so secrets are hidden from logs and stdout when you share output
These steps come from our top use case, Scan a repo's full history for leaked secrets, 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 gitleaks/gitleaks
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 forDevelopers and security teams who want to catch leaked credentials before they reach a shared repo.
- Why it is hot31k stars, talked about in 2 AI sources we track
- LanguageGo
- Sourcegithub.com/gitleaks/gitleaks ยท Back to Hot repos
Requirements
- 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
Add this badge to your README
Maintain Gitleaks? Show readers where to find these use cases.
Markdown
[](https://dedupedai.com/use-cases/gitleaks-gitleaks/?utm_source=github&utm_medium=badge&utm_campaign=gitleaks-gitleaks)
HTML
<a href="https://dedupedai.com/use-cases/gitleaks-gitleaks/?utm_source=github&utm_medium=badge&utm_campaign=gitleaks-gitleaks"><img src="https://dedupedai.com/badge/gitleaks/gitleaks.svg" alt="Use cases on Deduped" height="20"></a>
A static image, no tracking script. About the badge
Questions about Gitleaks
What is Gitleaks?
Gitleaks detects hardcoded secrets such as passwords, API keys and tokens in git history, directories and files, or anything piped to stdin. It runs as a CLI, a Docker image, a pre-commit hook or a GitHub Action, supports baselines so only new findings are reported, custom TOML rules, redaction and JSON, CSV, JUnit and SARIF reports. The maintainer has declared it feature complete, with future releases limited to security patches. It is an open-source project on GitHub: https://github.com/gitleaks/gitleaks.
How do I use Gitleaks?
Install with brew install gitleaks or docker pull zricethezav/gitleaks:latest; then run gitleaks git -v inside the repo to scan its git history with verbose output; save a report with gitleaks git --report-path gitleaks-report.json. The use cases on this page give the full steps and a copy-paste agent prompt for each job.
Who is Gitleaks for?
Developers and security teams who want to catch leaked credentials before they reach a shared repo.
What can I do with Gitleaks?
3 use cases so far, for example: Scan a repo's full history for leaked secrets; Stop secrets before they are committed; Adopt secret scanning on an old repo without the noise. Each has steps and a copy-paste agent prompt.
What do I need to run Gitleaks?
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.
What are alternatives to Gitleaks?
Other hot AI repos in Security and science: Failproofai, Codex Security, Chgnet, Semgrep, Mace.
Is Gitleaks 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.