Skip to content
| Marketplace
Sign in
Visual Studio Code>Linters>API Guard SEC — Real-Time Secret & Exploit ShieldNew to Visual Studio Code? Get it now.
API Guard SEC — Real-Time Secret & Exploit Shield

API Guard SEC — Real-Time Secret & Exploit Shield

Sumit Chaudhary

|
1 install
| (0) | Free
Background Guardian & Secret Leak Prevention for VS Code. Real-time red squiggly error highlights, 1-click .env refactoring, .gitignore hardener, and Git pre-commit shield.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

🛡️ API Guard SEC

License: MIT Node.js

Production-grade CLI tool, Git Pre-Commit Security Shield, and Secret Leak Prevention engine for Node.js, React, and Full-Stack codebases.

Prevent catastrophic API key leaks, auto-harden .gitignore, extract secrets to .env, and block unsafe Git commits before code leaves your local machine!


🔥 Real-World Problems Solved

  1. Accidental Hardcoded Secrets: Detects 50+ secret key formats (OpenAI, AWS, Stripe, MongoDB, Postgres, GitHub PATs, JWT secrets, Private Keys).
  2. Exposed .env Files: Automatically inspects .gitignore and appends missing rules (.env, .env.local, .env.*, *.pem, *.key).
  3. Automated Refactoring: Extracts string secrets from code and replaces them with process.env.KEY or import.meta.env.VITE_KEY while creating .env and .env.example.
  4. Git Pre-Commit Shield: Blocks git commit if .env is staged or hardcoded secrets are present in staged diffs.

🚀 Quick Start & Installation

Install globally or run on any project with npx:

# Run secret scan on current project
npx api-guard-sec scan

# Auto-harden .gitignore, extract secrets to .env, and install Git Pre-Commit Shield
npx api-guard-sec fix

# Install Git pre-commit hook only
npx api-guard-sec install-hook

🛠️ CLI Commands

Command Description
npx api-guard-sec scan Scans all project files for 50+ secret regex patterns and high entropy strings.
npx api-guard-sec scan --staged Scans only Git staged changes (used by pre-commit hook).
npx api-guard-sec fix Auto-hardens .gitignore, untracks cached .env, refactors secrets, and installs Git hook.
npx api-guard-sec install-hook Installs .git/hooks/pre-commit security script.

📄 License

MIT License © 2026 Sumit Chaudhary

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft