Dead-simple secret leak scanner for git repos. Zero config. One command.
39 million secrets were leaked on GitHub in 2024. Most developers don't run any scanner because existing tools are heavy and config-intensive. envguard fixes that.
pip install envguardOr just copy the single file — it has zero dependencies.
envguard scan .envguard scan config.py .env deploy.shenvguard scan --stagedenvguard initNow secrets are caught automatically before every commit.
envguard uninstallenvguard scan --json .| Pattern | Example |
|---|---|
| AWS Access Keys | AKIA... |
| AWS Secret Keys | aws_secret_access_key = ... |
| GitHub Tokens | ghp_..., gho_..., ghs_... |
| Slack Tokens | xoxb-... |
| Slack Webhooks | https://hooks.slack.com/... |
| Stripe Secret Keys | sk_live_... |
| Google API Keys | AIza... |
| Private Keys | -----BEGIN RSA PRIVATE KEY----- |
| Database URLs | postgres://user:pass@host |
| Dangerous files | .env, id_rsa, .pem, etc. |
| Pattern | Example |
|---|---|
| Generic API keys | api_key = "abc123..." |
| Generic tokens | token = "xyz..." |
| Generic passwords | password = "..." |
| JWT tokens | eyJ... |
| Hex secrets | secret = "a1b2c3..." |
============================================================
🔒 ENVGUARD — Secret Scan Results
============================================================
🚨 HIGH AWS Access Key
config.py:12
AWS_ACCESS_KEY_ID = "AKIA..."
🚨 HIGH Database URL
settings.py:45
DATABASE_URL = "postgres://admin:pass@..."
⚠️ MEDIUM Generic API Key
utils.py:8
api_key = "a1b2c3d4e5..."
------------------------------------------------------------
🚨 2 high | ⚠️ 1 medium | Total: 3
❌ Commit blocked. Remove secrets before committing.
- Skips binaries (images, fonts, archives, PDFs)
- Skips large files (>1 MB)
- Skips comments (lines starting with
#,//,/*) - Skips noise dirs (
.git,node_modules,__pycache__,venv) - One finding per line (no spam)
envguard init writes a tiny pre-commit hook into .git/hooks/. On every git commit:
- Scans only staged files (
--staged) - If any high severity secrets found → commit is blocked (exit 1)
- Medium findings are shown as warnings but don't block
That's it. No YAML config. No framework. No token needed.
- Python 3.6+
- Zero dependencies
| Tool | Config needed | Language | Zero-dep |
|---|---|---|---|
| envguard | None | Python | ✅ |
| gitleaks | TOML | Go binary | ❌ |
| trufflehog | Flags | Go binary | ❌ |
| detect-secrets | .secrets.baseline |
Python | ❌ |
| git-secrets | Shell setup | Bash | ✅ |
envguard trades flexibility for simplicity. If you need custom regex or enterprise features, use gitleaks. If you want something that works in 10 seconds, use envguard.
MIT