Skip to content

About

SecretFirewall is an open-source, local-first security layer that detects, classifies, redacts, blocks, and auto-fixes exposed API keys, tokens, passwords, and credentials. It protects developer workflows, Git commits, and AI coding agentsβ€”without sending code or secrets to the cloud.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

πŸ”’ SecretFirewall

Open-source, local-first security layer that detects, classifies, redacts, blocks, and safely auto-fixes secret exposure in developer and AI-coding-agent workflows.

Build License Platform

What is SecretFirewall?

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

Features

  • πŸ” 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

🌍 Installation (Anywhere in the world)

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 dashboard

Alternative: Install via Cargo (Source)

If 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 dashboard

⚑ Local Quick Start

If 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 dashboard

CLI Reference

secret-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)

Policy Presets

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

Secret Providers Detected

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.

Architecture

Developer / AI Agent
       β”‚
       β–Ό
 SecretFirewall CLI + Daemon
       β”‚
       β–Ό
 Detection Engine ──▢ Classification ──▢ Context Analyzer
       β”‚
       β–Ό
  Policy Engine (Allow/Ask/Redact/Block)
       β”‚
       β–Ό
 Remediation Engine ──▢ Audit Logger ──▢ Dashboard

Project Structure

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

Running Tests

# 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

Security Model

  • 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.

License

Dual-licensed under MIT and Apache 2.0.

About

SecretFirewall is an open-source, local-first security layer that detects, classifies, redacts, blocks, and auto-fixes exposed API keys, tokens, passwords, and credentials. It protects developer workflows, Git commits, and AI coding agentsβ€”without sending code or secrets to the cloud.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages