.env & Config Secret Detector + Redactor
Scan .env files, YAML snippets, and config exports locally for leaked API keys, database credentials, and high-entropy secrets, then generate a clean <REDACTED_...> template to share safely.
Input & Options
Local JS Execution
Parsed Output & Diagnostics
Ready
Status
...
Generated Output
Secret Detection Heuristics
| Detector Layer | Examples Caught | Action Taken |
|---|---|---|
| Known Vendor Prefixes | sk-*, sk_live_*, ghp_*, AKIA*, AIza*, xox*, eyJ* | Immediate redaction + key type tag |
| Credentialed URIs | postgres://user:pass@host, redis://:pass@host | Replaced with <REDACTED_KEY> |
| Sensitive Key Names | *_SECRET, *_TOKEN, *_PASSWORD, *_KEY, *_DSN | Redacts non-placeholder values |
| Shannon Entropy | >= 3.7 bits/char strings (>= 24 chars) | Catches unnamed random tokens |
Parser Methodology & Privacy Guarantees
Combines vendor prefix regex patterns, URI userinfo matching, sensitive key name heuristics, and per-character Shannon entropy scoring offline in browser memory.
- Parses key=value and key: value lines while preserving comments and blank lines.
- Skips existing placeholders like <REDACTED_...>, changeme, or HTTPS URLs without userinfo credentials.
- Outputs sanitized config preserving quote style for instant copy or .env.sanitized download.
Scope & limitations: Multi-line PEM blocks require line-by-line or single-line escaped formatting for individual variable assignment parsing.
Frequently Asked Questions
Why sanitize .env files before pasting into AI chats or bug reports?
Accidentally pasting live Stripe, OpenAI, AWS, or database connection strings into issue trackers or LLM prompts exposes production systems immediately.
What does Shannon entropy detect?
Random cryptographic keys and API tokens have higher character unpredictability (~3.7 to 5.5 bits/char) than normal human words or file paths.
Can I download the sanitized output as .env.example?
Yes. Click Download File to export .env.sanitized directly from browser memory.