PromptGuard VS Code Extension
The PromptGuard VS Code Extension brings drop-in LLM security directly to your editor. Get real-time diagnostics, one-click setup, and seamless CLI integration without leaving VS Code.Available on VS Code Marketplace
Install directly from VS Code or visit the marketplace page
Why Use the Extension?
Real-time Detection
See LLM SDK usage warnings as you code - no need to run scans manually
One-Click Setup
Initialize PromptGuard with a single command from the Command Palette
Status at a Glance
View PromptGuard status directly in the status bar
Seamless CLI Integration
Wraps the PromptGuard CLI - all commands available in VS Code
Installation
Step 1: Install the PromptGuard CLI
The extension requires the PromptGuard CLI to be installed:Step 2: Install the Extension
From VS Code:- Open VS Code
- Go to Extensions (Cmd+Shift+X / Ctrl+Shift+X)
- Search for “PromptGuard”
- Click Install
Quick Start
1. Initialize PromptGuard
- Open Command Palette (Cmd+Shift+P / Ctrl+Shift+P)
- Run
PromptGuard: Initialize - Enter your API key when prompted (or sign up if you don’t have one)
- Select providers (or press Escape to use all)
2. View Real-time Diagnostics
The extension automatically scans your code and shows warnings for detected LLM SDKs:- Yellow squiggles indicate LLM SDK usage
- Hover to see details
- Click to view in the Problems panel
3. Check Status
- Status Bar (bottom right): Shows “Active”, “Disabled”, or “Not Initialized”
- Click the status bar to view detailed status
- Or run
PromptGuard: Show Statusfrom Command Palette
Features
Real-time Diagnostics
The extension continuously scans your workspace and displays warnings for:- OpenAI SDK usage
- Anthropic SDK usage
- Cohere SDK usage
- HuggingFace SDK usage
Status Bar Indicator
The status bar shows your current PromptGuard status:- 🛡️ PromptGuard: Active - PromptGuard is protecting your app
- 🛡️ PromptGuard: Disabled - PromptGuard is temporarily disabled
- 🛡️ PromptGuard: Not initialized - PromptGuard hasn’t been set up yet
Commands
All PromptGuard commands are available via the Command Palette:| Command | Description |
|---|---|
PromptGuard: Initialize | Set up PromptGuard in your project |
PromptGuard: Scan for LLM SDKs | Scan project for LLM SDK usage |
PromptGuard: Show Status | Display current configuration |
PromptGuard: Apply Transformations | Apply PromptGuard transformations |
PromptGuard: Disable | Temporarily disable PromptGuard |
PromptGuard: Enable | Re-enable PromptGuard |
Signup Flow
If you don’t have an API key, the extension guides you through signup:- Choose “Sign up / Get API key” when initializing
- Browser opens to the signup page
- After signing up, paste your API key
- Setup continues automatically
Configuration
CLI Path
If the CLI is not in your PATH, you can set a custom path:- Open Settings (Cmd+, / Ctrl+,)
- Search for “PromptGuard”
- Set
PromptGuard: Cli Pathto the full path to the binary
/usr/local/bin/promptguard or C:\Program Files\PromptGuard\promptguard.exe
Supported Languages
- TypeScript (
.ts,.tsx) - JavaScript (
.js,.jsx) - Python (
.py)
Supported Providers
- OpenAI
- Anthropic
- Cohere
- HuggingFace
Troubleshooting
CLI Not Found
If you see “CLI not found” errors:- Verify the CLI is installed:
promptguard --version - Check it’s in your PATH:
which promptguard(macOS/Linux) orwhere promptguard(Windows) - Set the
promptguard.cliPathsetting to the full path
Extension Not Working
- Check the Output channel: View → Output → Select “PromptGuard”
- Reload the window: Cmd+Shift+P → “Developer: Reload Window”
- Check VS Code version: Must be 1.80.0 or higher
Diagnostics Not Showing
- Ensure PromptGuard is initialized: Run
PromptGuard: Initialize - Check that your files have supported extensions (
.ts,.js,.py, etc.) - Verify the CLI is working: Run
PromptGuard: Scan for LLM SDKs
Next Steps
CLI Documentation
Learn more about the PromptGuard CLI
Quick Start Guide
Get started with PromptGuard in 5 minutes
GitHub Repository
View source code and report issues
VS Code Marketplace
Install or rate the extension
Open Source
The PromptGuard VS Code Extension is open source:- GitHub: acebot712/promptguard-vscode
- License: Apache 2.0
- Issues: Report bugs or request features