Find and scrub leaked secrets in local AI coding logs, SQLite state, MCP configs, and plugins, or wrap live CLI and MCP sessions to stop secrets from leaving your machine.
Use Gitleaks or TruffleHog for your git history. Use leaktap for everything git never sees: local agent transcripts (~/.claude, ~/.codex, ~/.cursor, ~/.gemini), SQLite -wal files, .mcp.json configs, installed hooks, and live agent traffic.
Live wrapping supports Claude Code (claude), Codex CLI ( codex), Antigravity CLI ( agy), and local MCP servers. Offline scan also checks configs and state left by Cursor, Windsurf, Cline, Roo Code, Zed, Continue, Aider, and similar editors.
I also used leaktap to check the top 20 MCP servers on GitHub: 5 opened outbound internet connections on startup before any tool ran, 7 ship telemetry on by default, 2 put API keys in CLI flags visible in ps aux, and 0 of 470 live tools had hidden prompt injections.
npx leaktap@0.4.3
brew install vssinghh/tap/leaktap && leaktap
npx (prebuilt native binaries published with npm provenance):
npx leaktap@0.4.3
Homebrew (macOS and Linux):
brew install vssinghh/tap/leaktap
Cargo:
cargo install --git https://github.com/vssinghh/leaktap --tag v0.4.3 --locked
Shell installer (macOS and Linux; inspect the script first):
curl -fsSLO https://raw.githubusercontent.com/vssinghh/leaktap/v0.4.3/install.sh
less install.sh
LEAKTAP_VERSION=v0.4.3 sh install.sh
gh attestation verify ~/.local/bin/leaktap --repo vssinghh/leaktap
Prebuilt binaries, .sha256 checksums, and build attestations for macOS, Linux, and Windows are on GitHub Releases.
Runs offline by default. Scans ~/.claude, ~/.codex, ~/.gemini, ~/.cursor, ~/.codeium/windsurf, ~/.continue, installed plugins and skills, shell hooks, and workspace MCP or rule files.
Catches API keys, private keys (PEM, OpenPGP, JWK, GCP service accounts, Kubernetes secrets), database URLs, and passwords, including encoded blobs (Base64, gzip+Base64, hex, UTF-16) and SQLite -wal pages.
leaktap
leaktap scan --all --ci
leaktap scan --verify --fail-on critical
leaktap --mcp-pins-file ./mcp-pins.lock scan --inspect-mcp --ci
leaktap --mcp-pins-file ./mcp-pins.lock scan --inspect-mcp --update-mcp-pins
leaktap scan ./my-project --ci
leaktap scan ./third-party-skill --ci
LEAKTAP_FINGERPRINT_SALT="$SARIF_SALT" leaktap scan . --policy-git-ref origin/main --format sarif --ci > leaktap.sarif
--inspect-mcp blocks loopback, private, and cloud-metadata IPs and does not expand ${ENV} variables from untrusted repo configs.
Start claude, codex, or agy through leaktap. Any extra flags pass straight through:
leaktap claude
leaktap codex
leaktap agy
leaktap --scrub-ssh-agent claude
leaktap --allow-env GH_TOKEN,GOOGLE_APPLICATION_CREDENTIALS claude
leaktap --block-secrets claude
leaktap --redact-secrets claude
When wrapping a session, leaktap:
- Strips unrelated shell secrets (
AWS_SECRET_ACCESS_KEY,STRIPE_SECRET_KEY,DATABASE_URL, etc.) while keeping profile selectors (AWS_PROFILE,KUBECONFIG), the CLI's own API key, and anything passed to--allow-env. - Routes supported
*_BASE_URLenv vars through a local loopback proxy so prompts, headers, and MCP tool results are checked in memory before forwarding upstream over HTTPS. - Inspects non-TTY MCP
tools/listandtools/calltraffic for poisoned schemas or rug-pulls, logsHTTP CONNECTdestination hostnames without custom root certificates, and writes live events to~/.leaktap/live.jsonl(0600).
To wrap a single MCP server inside .mcp.json:
leaktap tap --scrub-env --scrub-ssh-agent --quiet --log ~/.leaktap/mcp.jsonl -- npx @org/some-mcp@1.2.0
Dry run by default. On a folder, clean only edits AI session logs and skips source code and backups unless you pass --include-code or point directly at a file.
With --apply, it scrubs text logs, prompt history in ~/.claude.json (leaving login accounts and mcpServers untouched), and SQLite/-wal databases after checking for active locks so open IDEs are not corrupted.
leaktap clean
leaktap clean --apply
leaktap clean ./leaked.env --apply
leaktap clean ./my-repo --include-code --apply
leaktap clean --apply --backup
leaktap ui
Opens a 4-tab view (Transcript Leaks, MCP / Plugin Risks, Live Wiretap, and Context & PII). Press / to filter, c then y to scrub just the selected secret across local logs and SQLite files, or q / Ctrl+C to exit.
leaktap loads ~/.config/leaktap/config.toml automatically. In CI, pass --config path/to/policy.toml or --policy-git-ref origin/main so a PR branch cannot weaken its own policy.
For test keys in source or config files, add # leaktap:ignore on the same line (or // leaktap:ignore[rule-id], /* leaktap:ignore */, <!-- leaktap:ignore -->, or # leaktap:ignore-next-line). Inline ignores are disabled under --policy-git-ref and --no-inline-ignore, never apply to chat logs or SQLite stores, and never silence MCP or hook alerts.
Example .leaktap.toml allowlist and custom rule #
[allowlist]
paths = ["tests/fixtures/**"]
rules = ["internal-hostname"]
stopwords = ["acme-sandbox-dummy"]
fingerprints = ["9f86d081884c7d65"]
[allowlist.rule_paths]
mcp-unpinned-package = ["docs/examples/**"]
[[rules]]
id = "acme-prod-token"
name = "Acme Internal Prod Token"
description = "Internal Acme production service token (acme_live_...)."
severity = "critical"
category = "secret"
anchors = ["acme_live_"]
pattern = 'acme_live_[A-Za-z0-9]{24,64}'
min_entropy = 3.2
leaktap rules
leaktap rules --format json
-
leaktapruns in user space withoutsudo, custom root certificates, or eBPF hooks so it works out of the box on macOS and Linux. Third-party HTTPS traffic from child tools is logged byHTTP CONNECThostname or OS socket polling (15mson Linux,500mson macOS), without decrypting TLS payloads. -
A hostile binary that ignores
*_BASE_URLandHTTPS_PROXY, uses gRPC or QUIC, finishes a request faster than the poll interval, or sends raw UDP/DNS can bypass user-space checks. Run untrusted code inbubblewrap,landlock,sandbox-exec, or a VM/container. -
PII checks only cover developer emails and internal hostnames, not SSNs, payment cards, or medical records.
-
leaktap clean --applyonly removes secrets from local disk. Rotate any key that was already sent to an API or pushed to git. -
Repo
.leaktap.tomland.leaktapignorefiles are ignored by default so a cloned repo cannot hide its own findings. Pass--trust-project-configor--policy-git-refto load them. -
SARIF output omits unsalted hashes on email and hostname findings unless
LEAKTAP_FINGERPRINT_SALTorfingerprint_saltis set. -
leaktap scanandleaktap cleanmake zero network requests by default. Live checks only run when--verifyor--inspect-mcpis passed. -
Zero telemetry, analytics, or accounts.
-
Matched secrets are masked (
sk_live_9f...4c21) in terminal, UI, JSON, SARIF, and~/.leaktap/live.jsonloutput.