DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to scan a repo's full history for leaked secrets with Gitleaks

Run Gitleaks over every commit to find passwords, API keys and tokens that were ever committed.

Short answer: 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. All steps.

Who it is forA team lead inheriting an old repo who needs to know whether credentials ever leaked into it.

The problemA secret deleted in a later commit is still in git history, where anyone with the repo can find it.

The outcomeA report of every secret found, with the file, line, commit and author, so you can rotate them.

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

  1. Install with brew install gitleaks or docker pull zricethezav/gitleaks:latest
  2. Run gitleaks git -v inside the repo to scan its git history with verbose output
  3. Save a report with gitleaks git --report-path gitleaks-report.json
  4. Use --redact so secrets are hidden from logs and stdout when you share output
  5. Rotate every real credential it finds; removing it from the code alone is not enough

Prompt for your agent

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.

Caveat. Gitleaks is feature complete and now gets security patches only; the maintainer points to Betterleaks for new development.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for gitleaks/gitleaks and "Scan a repo's full history for leaked secrets"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer