Open-source, local-first security layer that detects, classifies, redacts, blocks, and safely auto-fixes secret exposure in developer and AI-coding-agent workflows.
SecretFirewall is a background-running tool that stops developers β and the AI coding agents they rely on β from accidentally exposing API keys, passwords, tokens, private keys, and database credentials. It sits between the developer/agent and the places secrets leak.
Core loop: DETECT β UNDERSTAND β ALLOW/ASK/REDACT/BLOCK β AUTO-FIX β VERIFY
- π Multi-layer Detection: Provider signatures (Stripe, GitHub, AWS, OpenAI, Anthropic, etc.) + Shannon entropy + keyword context
- ποΈ Architecture-Aware: Knows the difference between a Stripe key in a server API route (safer) vs. a React component (CRITICAL β browser-exposed)
- π Framework Support: React, Next.js, Vite, Node/Express, FastAPI β with client vs. server classification
- π Git Protection: Pre-commit and pre-push hooks with safe chaining
- π Policy Engine: Relaxed / Balanced / Strict presets with custom overrides
- π§ Auto-Remediation: Moves secrets to
.env, updates.gitignore, replaces hardcoded values β with diff review and rollback - π€ Agent Protection: Adapter architecture for AI coding agents + MCP tool call inspection
- π Local Dashboard: Beautiful dark-theme web UI running on localhost β no account, no cloud
- π Privacy-First: No source code leaves your machine. Secrets are NEVER logged β fingerprints only
- π» Cross-Platform: macOS, Linux, Windows β single binary
The easiest way to install SecretFirewall is via NPM (no Rust required!). The installer will automatically download the correct highly-optimized native binary for Windows, macOS, or Linux:
npm install -g secret-firewall
secret-firewall start
secret-firewall dashboardIf you prefer to compile from source, anyone with Rust installed can use:
cargo install --git https://github.com/DKP-RGB/LocalFirewall.git
secret-firewall start
secret-firewall dashboardIf you have already cloned the repository locally, you can install and run it globally on your machine with:
cargo install --path . && secret-firewall start && secret-firewall dashboardsecret-firewall init # First-run setup wizard
secret-firewall scan [path] # Scan files/directories for secrets
secret-firewall fix [path] # Review and apply automatic fixes
secret-firewall start # Start background daemon
secret-firewall stop # Stop daemon
secret-firewall restart # Restart daemon
secret-firewall status # Show protection status
secret-firewall watch [path] # Watch for file changes (foreground)
secret-firewall logs [-n COUNT] # View audit log
secret-firewall policy [--show] # View/edit active policy
secret-firewall doctor # Diagnose issues
secret-firewall dashboard # Open local dashboard
secret-firewall update # Check for updates
secret-firewall uninstall # Uninstall (preserves your code)
| Confidence | Relaxed | Balanced (default) | Strict |
|---|---|---|---|
| CRITICAL | Ask | Block | Block |
| HIGH | Ask | Ask | Block |
| MEDIUM | Log | Ask | Ask |
| LOW | Log | Log | Log |
| INFO | Log | Log | Log |
Stripe, GitHub (PAT, OAuth, Server, Fine-grained), AWS (Access Key, Secret Key), GCP, Azure, OpenAI, Anthropic, JWT, PEM private keys, database connection strings, webhook secrets, generic passwords, and high-entropy tokens.
Developer / AI Agent
β
βΌ
SecretFirewall CLI + Daemon
β
βΌ
Detection Engine βββΆ Classification βββΆ Context Analyzer
β
βΌ
Policy Engine (Allow/Ask/Redact/Block)
β
βΌ
Remediation Engine βββΆ Audit Logger βββΆ Dashboard
crates/
βββ core/ # Shared types, config
βββ detector/ # Provider signatures, entropy, keywords
βββ classifier/ # Confidence + secret-vs-public labeling
βββ context/ # Framework-aware client/server analysis
βββ policy/ # Policy engine + presets
βββ redactor/ # Value-level redaction
βββ fixer/ # Remediation engine
βββ git/ # Hook install/scan
βββ agents/ # Per-agent adapters
βββ mcp/ # MCP inspection layer
βββ audit/ # Audit logging
βββ cli/ # CLI entrypoint
βββ daemon/ # Background daemon + dashboard API
# Run all tests
cargo test --workspace
# Run with output
cargo test --workspace -- --nocapture
# Run specific crate tests
cargo test -p secret-firewall-detector
cargo test -p secret-firewall-policy- Local-only: No network access required. No data leaves your machine.
- No raw secrets in logs: All audit entries use SHA-256 fingerprints.
- Least privilege: Daemon runs as your user, no root/admin required.
- Fail-safe: Corrupted config β fail closed to Strict. Auto-fix failure β rollback.
- Signed updates: Checksum and signature verified.
Dual-licensed under MIT and Apache 2.0.