cd /news/ai-agents/show-hn-leaktap-find-and-scrub-secre… · home › topics › ai-agents › article
[ARTICLE · art-179552] src=github.com ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

Show HN: Leaktap, find and scrub secrets in Claude/Codex/MCP logs

A developer released leaktap 0.4.3, an open-source tool that scans local AI coding agent logs, SQLite state files, MCP configs and plugins for leaked secrets and can wrap live Claude Code, Codex CLI, Antigravity CLI and local MCP server sessions to block or redact secrets before they leave the machine. An audit of the top 20 MCP servers on GitHub using leaktap found 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 contained hidden prompt injections. The tool runs offline by default, exits 0 unless `--ci` is passed, and is installable via npx, Homebrew, Cargo or a shell installer.

key takeaway

leaktap 0.4.3 scans ~/.claude, ~/.codex, ~/.cursor and other agent state plus SQLite -wal files for secrets, and its --block-secrets wrapper returns HTTP 400 on outgoing requests containing secrets or critical prompt injections.

read6 min views40 publishedDec 1, 2026
Show HN: Leaktap, find and scrub secrets in Claude/Codex/MCP logs
Image: Michielbdejong (auto-discovered)

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_URL env 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/list andtools/call traffic for poisoned schemas or rug-pulls, logsHTTP CONNECT destination 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
  • leaktap runs 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 CONNECT hostname or OS socket polling (15ms on Linux,500ms on macOS), without decrypting TLS payloads.

  • A hostile binary that ignores *_BASE_URL andHTTPS_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 --apply only removes secrets from local disk. Rotate any key that was already sent to an API or pushed to git.

  • Repo .leaktap.toml and.leaktapignore files are ignored by default so a cloned repo cannot hide its own findings. Pass--trust-project-config or--policy-git-ref to load them.

  • SARIF output omits unsalted hashes on email and hostname findings unless LEAKTAP_FINGERPRINT_SALT orfingerprint_salt is set.

  • leaktap scan andleaktap clean make zero network requests by default. Live checks only run when--verify or--inspect-mcp is passed.

  • Zero telemetry, analytics, or accounts.

  • Matched secrets are masked (sk_live_9f...4c21 ) in terminal, UI, JSON, SARIF, and~/.leaktap/live.jsonl output.

── more in #ai-agents 4 stories · sorted by recency
── more on @leaktap 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/show-hn-leaktap-find…] indexed:0 read:6min 2026-12-01 · —