leakgate
v0.2.0
Published
A last-second safety check that catches leaked secrets and private files before you publish your code.
Downloads
504
Readme
LeakGate 🛟
Catch leaked secrets and private files before you publish — in one command.
You build fast (especially with AI). LeakGate takes a last-second look at exactly the files you're about to publish and stops you if an API key, password, or private file is about to leak in public.
npx leakgateWhy
AI coding tools make it easy to ship fast — and easy to leak. A hardcoded key, a .env file, or a source map slips into your published package, and it's public forever. It has happened to solo devs and to big companies alike. LeakGate is the babysitter that checks the box before the door closes, so you can keep shipping fast without the fear.
The key difference from other scanners: it checks the real publish set — the exact files npm publish or python -m build would ship — not just your whole folder. Works on npm projects and Python (PyPI) projects.
Use it
npx leakgate # scan the current project
npx leakgate ./my-app # scan a specific folderExit code is 1 if anything serious is found, 0 if clean — so you can use it as a pre-publish guard or in CI.
Python (PyPI)
Point LeakGate at a Python project (one with pyproject.toml or setup.py) and it scans the real PyPI publish set — both the sdist (.tar.gz) and the wheel (.whl) — by building your package the same way twine upload would.
pip install build # one-time — LeakGate uses it to see the real publish set
npx leakgate ./my-py-projectThis matters because build backends like setuptools-scm silently include every git-tracked file in the sdist. A .env you forgot to untrack, or a .pypirc sitting next to your pyproject.toml, can end up on PyPI without you ever noticing. LeakGate builds the package, extracts both archives, and inspects every file inside — including auto-generated ones like PKG-INFO.
Run it automatically before every publish
"scripts": { "prepublishOnly": "npx leakgate" }What it checks
Leaked secrets: AWS, Stripe, OpenAI, Anthropic, Google, GitHub, Slack keys; database URLs with passwords; private key blocks; hardcoded password = "..." values.
Dangerous files: .env, source maps, .git, private keys/certs, database dumps, .npmrc, .pypirc, credential files.
It ignores obvious placeholders (like your-api-key-here) and template files (.env.example, .env.sample, .env.template) so it doesn't cry wolf.
Roadmap
More languages · automatic continuous watching · one-click AI-ready fixes · team dashboard + auto-block.
License
MIT
