# gitleaks + ShipGuard: keep gitleaks for history, add ShipGuard for app logic

Canonical: https://agenticcli.dev/shipguard/compare/gitleaks

**Short answer:** Keep gitleaks for git history: it reads past commits, and ShipGuard does not. Add ShipGuard when a coding agent writes your code, or when you also want checks for routes without login, payment webhooks, database migrations and deploy settings. They do not conflict. Both run on your machine, in pre-commit and in CI.

- gitleaks reads git history, files and stdin for secrets. ShipGuard reads the files in your project for secrets and four more risk areas.
- Use gitleaks to ask: did a key ever touch this repo? Use ShipGuard to ask: is this change safe to ship?
- You can run both in one .pre-commit-config.yaml. The snippet is below.

## What gitleaks does well
Read from its own docs on 24 Nov 2026.

- It detects secrets such as passwords, API keys and tokens in git repos, in files, and on stdin. [1]
- It scans history with `gitleaks git` and folders or files with `gitleaks dir`. [1]
- It exits 1 when it finds leaks. The `--exit-code` flag changes that code. [1]
- It writes reports as json, csv, junit, sarif or a template, and takes a baseline so old findings stay quiet. [1]
- It runs from a binary, Homebrew, Docker or a Go build, as a pre-commit hook or as a GitHub Action. [1]
- It is MIT-licensed. Its README says the tool is feature complete and future releases are security patches only; the latest release is v8.30.1. [1][2]

## gitleaks and ShipGuard, side by side

| | ShipGuard | gitleaks |
|---|---|---|
| Best for [4][1] | Founders shipping with a coding agent | Finding secrets in git repos, files and stdin |
| CLI and agent fit [4][1] | ✓ No dashboard to open. One command returns a JSON verdict, and with --strict a failing exit code. Works with Claude Code, Codex and Cursor | ~ A command-line tool with an exit code and json, csv, junit or sarif reports. Your agent reads the findings and decides |
| Where it runs [4][1] | ✓ Your machine. Your code never leaves it | ✓ Your machine or CI. A binary, Docker image or Go build |
| Licence and install [4][1][3] | Open source CLI (Apache-2.0). One line to run, no account for the general rules | MIT. Installs with Homebrew, Docker or Go, or as a binary |
| How you buy [5][1] | ✓ Self-serve, no sales call. One account covers any number of your machines and agents | ✓ Nothing to buy. Free to download, and its README lists no paid plan |
| Pricing model and metering [5][1] | ✓ One flat price, no seats. Only rulebook scans are counted: 1,000 a month on Pro. General-rule scans are free and never counted | ✓ Free to run. No seats and no usage count |
| What it checks [1][4] | Secrets, routes without login, payment webhooks, risky migrations, deploy settings | Secrets: passwords, API keys, tokens |
| Git history [1] | ✗ Files on disk only | ✓ Scans past commits |
| Files and stdin [1] | ✓ Project files, or only changed files with --changed | ✓ Files, folders and stdin |
| Pre-commit hook [1][4] | ✓ Yes | ✓ Yes |
| Blocking [1] | Exit 1 with --strict, plus a JSON verdict | Exit 1 when leaks are found (changeable) |
| Your own rules [1] | ~ A policy file picks what blocks | ✓ Your own rules in a TOML config |
| Report formats [1] | ~ JSON on screen, saved report in .shipguard/ | ✓ json, csv, junit, sarif, template |
| Needs [1][4] | Node.js 20 or newer | One binary, Docker image or Go build |

## When gitleaks is the better pick

- You want to know whether a key ever touched this repo, in any past commit. [1]
- You have a long history and want a baseline so only new findings show. [1]
- You need SARIF or JUnit reports, or your own detection rules. [1]
- You want one small binary with no Node.js on the machine. [1]

## When ShipGuard is the better pick

- A coding agent runs the check before each commit and needs a yes or no: exit code plus a JSON recommendation (SAFE_TO_SHIP, REVIEW_BEFORE_SHIP, DO_NOT_SHIP). [4]
- You also want to catch a route with no login check, an unsigned Stripe webhook, or destructive SQL in a migration. [4]
- You want deploy risks flagged too: open CORS, debug mode, exposed environment values, and secrets in NEXT_PUBLIC_ variables. [4]
- You want the general rules free, unlimited and with no account, at one flat price when you add the full rulebook. [4]

## Where ShipGuard stops

- ShipGuard checks the files on disk. It does not read past commits, so it cannot tell you a key leaked last year. gitleaks can.
- ShipGuard has five check areas: secrets, auth, database, payments and deployment. It is not a dependency scanner and not a code reviewer.
- Its secret checks are pattern rules. A key format they do not know can pass, which is a good reason to keep a second scanner.
- It blocks only with --strict. Without that flag it reports and exits 0.

## Run gitleaks and ShipGuard together

The usual setup: gitleaks guards the commit and the history, ShipGuard guards the change.

Both tools as pre-commit hooks. Each hook definition comes from the tool's own repo. [1][2][4][6]

`.pre-commit-config.yaml`

```
repos:
  - repo: https://github.com/gitleaks/gitleaks
    rev: v8.30.1
    hooks:
      - id: gitleaks
  - repo: https://github.com/agenticcli/shipguard
    rev: main   # pin to a commit or tag you trust
    hooks:
      - id: shipguard
```

ShipGuard scans the checkout. gitleaks reads history, so give that job a full clone. Add `--strict` so ShipGuard fails the job on a blocking finding. [1][4]

`CI (GitHub Actions steps)`

```
- uses: actions/checkout@v4
  with:
    fetch-depth: 0   # only so gitleaks can read history
- run: docker run --rm -v "$PWD:/path" zricethezav/gitleaks:latest git /path
- uses: actions/setup-node@v4
  with:
    node-version: 20
- run: npx --yes @agenticcli/shipguard scan --json --strict
```

1. Keep gitleaks exactly as it is. Nothing to remove.
2. Add the ShipGuard hook to the same pre-commit file, or run `npx @agenticcli/shipguard scan --changed --strict --json` from your agent.
3. Add the ShipGuard step to CI next to the gitleaks step. Use a full scan in CI, not `--changed`.

## gitleaks and ShipGuard: common questions

### Is ShipGuard a gitleaks alternative?

For secrets in the files on disk, it has its own checks, so it can stand in. For git history it cannot: ShipGuard does not read past commits. Most teams keep gitleaks for history and add ShipGuard for the app checks around it.

### Does ShipGuard scan git history like gitleaks?

No. ShipGuard reads the files in your working tree. If you need to know whether a key ever sat in an old commit, run gitleaks on the history.

### Does gitleaks check auth, payments or database migrations?

No. Its README describes it as a tool for detecting secrets. ShipGuard checks routes without login, payment webhook signatures, destructive SQL in migrations and risky deploy settings.

### Can a coding agent run gitleaks?

Yes. It is a command-line tool with an exit code and a json report. ShipGuard adds one thing for agents: a JSON verdict (SAFE_TO_SHIP, REVIEW_BEFORE_SHIP or DO_NOT_SHIP) next to the exit code.

### Is gitleaks still maintained?

Its README says it is feature complete and that future releases are security patches only. The latest release at the time of reading was v8.30.1. It stays MIT-licensed and usable as it is.

## Sources

Facts about other tools were read on 24 Nov 2026. Facts about ShipGuard come from our own README and docs.

1. [gitleaks README](https://github.com/gitleaks/gitleaks#readme)
2. [gitleaks release v8.30.1 (published 21 Mar 2026)](https://github.com/gitleaks/gitleaks/releases/tag/v8.30.1)
3. [gitleaks licence (MIT)](https://github.com/gitleaks/gitleaks/blob/master/LICENSE)
4. [ShipGuard README (our own)](https://github.com/agenticcli/shipguard#readme)
5. [ShipGuard pricing page (our own)](https://agenticcli.dev/pricing)
6. [pre-commit framework](https://pre-commit.com)

More: [ShipGuard](https://agenticcli.dev/shipguard) · [Compare](https://agenticcli.dev/shipguard/compare) · [Pricing](https://agenticcli.dev/pricing)
