The PromptGuard VS Code extension highlights unprotected LLM SDK calls in your code and provides quick fixes to add protection.
Installation
From VS Code Marketplace
- Open VS Code
- Go to Extensions (Cmd/Ctrl + Shift + X)
- Search for “PromptGuard”
- Click Install
From Command Line
From VSIX
Download from GitHub Releases:Features
Inline Diagnostics
Unprotected LLM calls are highlighted with squiggly underlines:- Red (Error): Unprotected calls in production code
- Yellow (Warning): Calls in potentially sensitive files
- Blue (Info): Protected calls (informational)
Hover Information
Hover over a highlighted call to see:- Provider name (OpenAI, Anthropic, etc.)
- Whether it’s protected
- Link to fix or learn more
Quick Fixes
Click the lightbulb or pressCmd/Ctrl + . to see fixes:
| Fix | Description |
|---|---|
| Add promptguard.init() | Initialize SDK at file top |
| Wrap with GuardClient | Use direct scanning |
| Add to ignore list | Suppress this finding |
| Open documentation | Learn more |
Problems Panel
All findings appear in the Problems panel (Cmd/Ctrl + Shift + M):Status Bar
The status bar shows protection status:- ✅ Protected - All LLM calls are secured
- ⚠️ 3 unprotected - Click to see findings
- 🔍 Scanning… - Analysis in progress
Configuration
Settings
Open Settings (Cmd/Ctrl + ,) and search for “PromptGuard”:| Setting | Default | Description |
|---|---|---|
promptguard.enable | true | Enable/disable extension |
promptguard.scanOnSave | true | Scan when file is saved |
promptguard.scanOnOpen | true | Scan when file is opened |
promptguard.severity | warning | Diagnostic severity level |
promptguard.exclude | ["**/test/**"] | Glob patterns to exclude |
settings.json
Workspace Settings
Create.vscode/settings.json in your project:
Commands
Access via Command Palette (Cmd/Ctrl + Shift + P):| Command | Description |
|---|---|
| PromptGuard: Scan Current File | Scan the active file |
| PromptGuard: Scan Workspace | Scan all files in workspace |
| PromptGuard: Initialize Project | Run promptguard init |
| PromptGuard: Show All Findings | Open findings panel |
| PromptGuard: Clear Diagnostics | Remove all highlights |
Supported Languages
| Language | File Extensions |
|---|---|
| Python | .py |
| JavaScript | .js, .mjs, .cjs |
| TypeScript | .ts, .mts, .cts |
| JSX | .jsx |
| TSX | .tsx |
Supported Providers
The extension detects calls to:- OpenAI
- Anthropic
- Google AI (Gemini)
- Cohere
- AWS Bedrock
- Azure OpenAI
- Mistral
- Groq
Ignoring Findings
Inline Comment
File-level Ignore
Via Settings
Add topromptguard.exclude:
Integration with CLI
The extension uses the same detection engine as the CLI. If you have the CLI installed, the extension will use it for scanning:Troubleshooting
Extension not activating
Extension not activating
Check:
- Is the file a supported language (.py, .ts, .js)?
- Is
promptguard.enableset totrue?
- Reload window: Cmd/Ctrl + Shift + P → “Reload Window”
- Check Output panel for errors: View → Output → PromptGuard
Findings not showing
Findings not showing
Check:
- Is the file excluded in settings?
- Does the file have LLM SDK imports?
- Run “PromptGuard: Scan Current File” manually
- Check the Problems panel (Cmd/Ctrl + Shift + M)
Too many findings / false positives
Too many findings / false positives
Solutions:
- Add test directories to
promptguard.exclude - Use
# promptguard-ignorecomments - Lower severity to
information
Performance issues
Performance issues
Solutions:
- Disable
scanOnSavefor large projects - Add
node_modules,.venvto exclude list - Install CLI for faster native scanning
Telemetry
The extension collects anonymous usage data to improve the product:- Extension activation events
- Command usage counts
- Error reports (no code content)
Changelog
v0.2.1 (February 2026)
- Added AWS Bedrock provider detection
- Improved TypeScript parsing
- Fixed false positives in JSX
v0.2.0 (January 2026)
- Quick fix actions
- Status bar indicator
- Workspace scanning
v0.1.0 (December 2025)
- Initial release
- Python and JavaScript support
- Inline diagnostics
Contributing
The extension is open source:- Repository: github.com/promptguard/vscode
- Issues: Report bugs or request features
- Pull Requests: Contributions welcome