Stop accidental secret leaks before they leave your laptop.
Leak-Proof is a zero-config CLI that blocks you from committing
.envfiles or hardcoded secrets (AWS keys, Tokens, Private Keys).
- 🔒 Automatic Secret Detection - Instantly spots AWS keys, private keys, and generic secrets in staged files.
- 👥 Team-Wide Protection - Auto-installs for every team member via
npm install. No manual setup required. - 🎨 Beautiful CLI - Clear, colored output with actionable security alerts.
- ⚡ Zero Config - Best-practice security defaults out of the box.
- 🛡️ Smart Filtering - Intelligently ignores binary files, lock files, and safe assets.
Install leak-proof as a development dependency in your project:
npm install leak-proof --save-dev-
Initialize in your project:
npx leak-proof init
This sets up the necessary Git hooks and configuring your project for safety.
-
Commit as usual:
git add . git commit -m "feat: amazing new feature"
-
That's it! If you accidentally stage a file with secrets (like
.envor a hardcoded API key),leak-proofwill block the commit and show you exactly what needs to be fixed.
- You run
npx leak-proof init. - A
preparescript is added to yourpackage.json. - When your teammates pull the code and run
npm install, the hooks are automatically set up for them too. - Everyone is protected effectively immediately. 🎉
We welcome contributions! Whether you're fixing a bug, improving the docs, or adding a new secret pattern, here's how to get started.
-
Clone the repository:
git clone https://github.com/sayan365/leak-proof.git cd leak-proof -
Install dependencies:
npm install
-
Link locally: This allows you to test your local changes as if they were an installed global package.
npm link
Now you can run the
leak-proofcommand anywhere in your terminal to test your changes. -
Verify your setup: Run the help command to see if your local version is active:
leak-proof --help
We love contributions! Here's how you can help make Leak-Proof better:
- Fork & Clone the repository.
- Create a Branch for your feature (
git checkout -b feature/amazing-feature). - Commit your changes (
git commit -m 'feat: add amazing feature'). - Push to the branch (
git push origin feature/amazing-feature). - Open a Pull Request and describe your changes.
💡 Note: Validation is currently manual. Please run the scanner against dummy files to verify your changes before submitting.
.env.env.local,.env.test,.env.production, etc.
- AWS Access Keys:
AKIA... - Private Keys:
-----BEGIN PRIVATE KEY----- - Generic Secrets:
api_key = "..."auth_token: "..."client_secret = "..."
Sometimes you need to commit a dummy key for testing purposes. You have two options:
Force Commit (Emergency)
If you need to bypass the entire hook for a specific commit:
git commit -m "fixing stuff" --no-verifyIf you want to remove Leak-Proof from your project, run:
npx leak-proof removeThis cleans up the git hooks and removes the scripts from your package.json.
Built with ❤️ by Sayan.