SecretGuard v0.1.3 is live on Homebrew, Cargo, and GitHub Releases. Press C to copy install
0.016ms Native Rust • Instant Terminal Secret Protection

Stop Leaking Secrets to Your Terminal.
Scrubbed in 15 Microseconds.

The moment you paste an API key or password into your terminal, it gets permanently saved in your ~/.zsh_history. SecretGuard catches credentials the exact millisecond you hit Enter — before they ever touch your disk.

Quick Install:
Press C to copy Homebrew
Homebrew brew tap hemanathk636/tap && brew install secretguard
Curl Script curl -fsSL https://raw.githubusercontent.com/hemanathk636/secretguard/main/install.sh | bash
Cargo (Rust) cargo install secretguard
PowerShell irm https://raw.githubusercontent.com/hemanathk636/secretguard/main/install.ps1 | iex

Commands & Capabilities

Every command is ready out of the box with zero runtime configuration.

History Scanner
2. Find Past Leaks (`secretguard audit`)
Scans thousands of commands in your existing shell history in milliseconds and shows you every secret currently saved on your disk with exact line numbers.
history audit
$ secretguard audit Scanning ~/.zsh_history (4,820 commands)... ⚠️ Line 142: AWS Access Key (AKIA...) ⚠️ Line 891: Database Password (postgres://admin:P@ss...) ──────────────────────────────────────── Found: 2 exposed secrets in your history
secretguard audit
Safe Cleaner
3. Clean History Safely (`secretguard clean-history`)
Scans and scrubs exposed secrets from your history. Automatically creates a timestamped backup before touching anything so your history is never lost or corrupted.
history cleanup
$ secretguard clean-history Found 2 exposed secrets. Safely sanitize 2 secrets in history? (y/N): y 📦 Safe backup created: ~/.zsh_history.backup.1741 ✓ Successfully sanitized 2 commands!
secretguard clean-history
AI Agent Shield
4. Shield AI Coding Agents (`secretguard protect-agent`)
AI coding agents (Claude Code, Cursor, Aider) often cache approved commands in working files like .claude/settings.local.json. This command scans local agent files and protects them from accidental Git pushes.
agent protection
$ secretguard protect-agent Checking local AI agent configs in '.'... ⚠️ Found unmasked API key in .claude/settings.local.json 🔒 Added '.claude/' to .gitignore automatically ✓ Agent workspace shielded from Git push
secretguard protect-agent
Screen Share Cloak
5. Cloak Screen Shares (`secretguard wrap`)
Prefix any command or dev server with secretguard wrap to dynamically mask database passwords, authorization tokens, and API keys from ever showing on your screen during Zoom calls or live demos.
stdout cloaking
$ secretguard wrap npm run dev [dotenv] Loaded environment variables: DATABASE_URL="postgres://user:[REDACTED]@db:5432/main" OPENAI_API_KEY="sk-proj-[REDACTED]" ✓ Safe for screen sharing: sensitive output cloaked
secretguard wrap npm run dev
System Diagnostics
6. Instant Health Check (`secretguard doctor`)
Runs an instant diagnostic checkup to verify your engine latency, shell integration status, history health, and AI agent shield in 5 milliseconds.
system diagnostics
$ secretguard doctor ✓ Dual-Tier Engine: Active (RegexSet + Shannon Entropy) ✓ Live Latency: 15.68 µs — Sub-millisecond verified ✓ Shell Hook: Zsh installed (~/.zshrc active) ✓ AI Agent Shield: .claude/ and .env* in .gitignore ✓ Binary Size: 1.56 MB (100% Offline / Zero Telemetry)
secretguard doctor

Interactive Live Sandbox

Test any command line or select a preset to evaluate detection latency and redaction.

dual-engine verification LATENCY: 0.016ms
Type any command or select a preset: Hotkeys: 1, 2, 3, 4, 5
Shannon Entropy Analysis: H = 3.84 bits/symbol (High Entropy Secret Detected)
Status Secret Intercepted
Signature OpenAI API Key
Latency 15.68 µs (0.016 ms)
Line Saved to ~/.zsh_history:
curl -H 'Authorization: Bearer sk-p[REDACTED]' https://api.openai.com

Comparison & Architecture

How SecretGuard compares to traditional pre-commit scanners and secret managers.

FEATURE GITGUARDIAN / TRUFFLEHOG 1PASSWORD CLI / DOPPLER SECRETGUARD (NATIVE RUST)
Interception Timing ✕ Too late (Git commit / CI only) ⚠ Manual wrapper (Requires op run --) ✓ Real-Time Line Hook (Millisecond you press Enter)
Stops .zsh_history Leaks ✕ No (History gets poisoned) ✕ No (If wrapper is omitted) ✓ 100% Protected (Native Zsh/Bash/PWSH hook)
AI Agent Cache Shield ✕ No (Ignores agent caches) ✕ No ✓ Built-In (Protects Claude Code & MCP configs)
In-Place History Cleanup ✕ No (Read-only scanner) ✕ No ✓ Atomic Clean (secretguard clean-history w/ backups)
Live Screen Share Cloaking ✕ No ✕ No ✓ Built-In (secretguard wrap masks live stdout)
Typing Latency ✕ 450ms+ (CI / Python runtime) ⚠ 80ms+ (IPC daemon) ✓ 0.016ms (15µs) (Zero typing stutter)
App Footprint & Memory ✕ Heavy (Python/Go/Docker runtimes) ⚠ Heavy (Electron app + daemon) ✓ Ultra-Light (1.56 MB single binary, 0 background CPU)
Privacy & Offline Guarantee ⚠ Cloud-dependent (Sends tokens to API) ⚠ Cloud account required ✓ 100% Offline (Zero telemetry, zero network calls)

Speed Benchmarks: Why Native Rust Matters

Terminal hooks slower than 50ms cause noticeable typing lag. SecretGuard runs in 15 microseconds.

SecretGuard (Native Rust) 0.016 ms (15.68 µs) — Instant
Python / Node Shell Hook 45.0 ms (Noticeable stutter)
Pre-Commit Hook (GitGuardian / TruffleHog) 480.0 ms (30,000x slower)

Frequently Asked Questions

Simple answers to common questions about shell integration, privacy, and safety.

Will SecretGuard slow down my terminal?
No. Humans cannot perceive lag under 50 milliseconds. SecretGuard runs in 0.016 milliseconds (15.68 microseconds)—over 3,000 times faster than human perception. It feels completely instantaneous.
Does SecretGuard send my data anywhere?
Never. SecretGuard has zero telemetry, zero analytics, and zero network calls. It is a 100% offline compiled binary running solely on your local CPU.
Can 'clean-history' corrupt my shell history file?
No. SecretGuard uses atomic file replacement: it writes the cleaned history to a temporary file, verifies it, creates a timestamped copy (e.g. .zsh_history.backup.<time>), and renames atomically. Your original file is always backed up.
How does it protect Claude Code and Cursor?
AI coding assistants often save approved shell commands in .claude/settings.local.json. Running secretguard protect-agent audits these files and automatically makes sure they are excluded in your .gitignore.

Zero Leaks. Zero Lag. 100% Free & Open Source.

Install via Homebrew or standard curl installer in 5 seconds. Dual-licensed under MIT and Apache-2.0.

brew tap hemanathk636/tap && brew install secretguard
View source on GitHub →
✓ Copied to clipboard — paste into terminal!