{
 "schema_version": 1,
 "generated": "2026-11-09",
 "id": "gitleaks-gitleaks--scan-a-repo-history-for-leaked-secrets",
 "repo": "gitleaks/gitleaks",
 "repo_url": "https://github.com/gitleaks/gitleaks",
 "repo_slug": "gitleaks-gitleaks",
 "title": "Scan a repo's full history for leaked secrets",
 "page_title": "How to scan a repo's full history for leaked secrets with Gitleaks",
 "summary": "Run Gitleaks over every commit to find passwords, API keys and tokens that were ever committed.",
 "who": "A team lead inheriting an old repo who needs to know whether credentials ever leaked into it.",
 "problem": "A secret deleted in a later commit is still in git history, where anyone with the repo can find it.",
 "outcome": "A report of every secret found, with the file, line, commit and author, so you can rotate them.",
 "steps": [
  "Install with `brew install gitleaks` or `docker pull zricethezav/gitleaks:latest`",
  "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`",
  "Use --redact so secrets are hidden from logs and stdout when you share output",
  "Rotate every real credential it finds; removing it from the code alone is not enough"
 ],
 "agent_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.",
 "agents": [
  "claude-code",
  "codex",
  "cursor"
 ],
 "difficulty": "Beginner",
 "time": "15 minutes",
 "basis": "readme",
 "caveat": "Gitleaks is feature complete and now gets security patches only; the maintainer points to Betterleaks for new development.",
 "category": "Security and science",
 "tags": [
  "Security and science"
 ],
 "lang": "go",
 "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"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": true,
 "score": 1.0,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/gitleaks-gitleaks/scan-a-repo-history-for-leaked-secrets/",
 "md": "https://dedupedai.com/use-cases/gitleaks-gitleaks/scan-a-repo-history-for-leaked-secrets/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/gitleaks-gitleaks--scan-a-repo-history-for-leaked-secrets.json",
 "api_version": "v1"
}
