The PromptGuard VS Code extension shows the LLM SDK calls in your workspace that are not routed through PromptGuard, and runs the PromptGuard CLI to protect them. It is a front end for the CLI: detection, setup and scanning are all done by the CLI binary.
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 the.vsix from GitHub Releases:
Cursor, Windsurf and other VS Code forks
The extension is published on the VS Code Marketplace only, not on Open VSX, so the extension search in Cursor, Windsurf and other forks that use Open VSX does not find it. Install the.vsix instead:
- Download
promptguard-vscode-<version>.vsixfrom the latest release - Open the Command Palette (Cmd/Ctrl + Shift + P) and run Extensions: Install from VSIX…
- Choose the downloaded file
.vsix this way is not updated for you: install the next release’s .vsix the same way.
The CLI
The extension needs the PromptGuard CLI. If it cannot find one on yourPATH or at promptguard.cliPath, it offers to download the latest CLI release from GitHub, checks it against the release’s .sha256 file, and installs it in the extension’s own storage. promptguard.autoInstallCli decides whether it asks first, installs silently, or never offers. You can also run PromptGuard: Install/Update CLI at any time, or install the CLI yourself (see CLI installation).
Features
Inline Diagnostics
After the CLI is found, and again whenever you save a supported file (ifpromptguard.scanOnSave is on), the extension runs promptguard scan over each workspace folder and marks what it finds:
- Warning (yellow): an LLM SDK client that is not routed through PromptGuard
- Hint: an SDK client that is already protected
Quick Fixes
Click the lightbulb or pressCmd/Ctrl + . on a PromptGuard warning:
Problems Panel
All findings appear in the Problems panel (Cmd/Ctrl + Shift + M), with the sourcePromptGuard:
Status Bar
The status bar item readspromptguard status and shows one of:
- PromptGuard: Active — the project is initialized and protection is on
- PromptGuard: Disabled — the project is initialized but protection is off
- PromptGuard: Not initialized — PromptGuard has not been set up in this project
- PromptGuard: Unavailable — the CLI could not report a status
- PromptGuard: Unknown — the CLI reported a status the extension does not recognise
Sidebar
The PromptGuard view in the Activity Bar shows the project’s status and the files PromptGuard manages, with buttons to install the CLI or initialize the project when either is missing.Threat Scanning and Redaction
Select text and run Scan Selection for Threats or Redact PII from Selection (also in the editor’s context menu), or run Scan File for Threats on a file. These call the PromptGuard API through the CLI, so they need an API key: set one with PromptGuard: Set API Key, which keeps it in VS Code’s secret storage. A scan opens the PromptGuard output panel with the decision, confidence, threat type and reason, and shows a notification with the verdict. A redaction replaces the selected text with the redacted text and lists the PII types it found in the same panel; if the document changed while the request ran, nothing is replaced.Configuration
Settings
Open Settings (Cmd/Ctrl + ,) and search for “PromptGuard”:settings.json
Commands
Access via Command Palette (Cmd/Ctrl + Shift + P):Supported Languages
Supported Providers
The extension shows what the CLI detects:- OpenAI
- Anthropic
- Cohere
- Hugging Face
- Google Gemini
- Groq
- AWS Bedrock
init and apply can route through PromptGuard.
Excluded Files
There is no ignore comment. The scan skips dependency, build and test locations:node_modules, .git, dist, build, __pycache__, __tests__, venv, .venv, .next and .mypy_cache directories, and *.test.js, *.test.ts, *.spec.js and *.spec.ts files. To stop scans on save altogether, set promptguard.scanOnSave to false.
Troubleshooting
Nothing happens / CLI not found
Nothing happens / CLI not found
Check:
- Is the CLI installed? Run PromptGuard: Install/Update CLI, or set
promptguard.cliPath - Is
promptguard.autoInstallCliset tonever?
- 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 in an excluded location (see Excluded Files)?
- Does the file construct a supported SDK client?
- Run “PromptGuard: Detect LLM SDKs” manually
- Check the Problems panel (Cmd/Ctrl + Shift + M)
Threat scan or redaction fails
Threat scan or redaction fails
Check:
- Have you set an API key with PromptGuard: Set API Key?
- Has your plan’s monthly quota run out? The extension offers a link to Billing when the API reports it.
Performance issues
Performance issues
Solutions:
- Disable
promptguard.scanOnSavefor large workspaces; every save re-scans the whole workspace
Telemetry
The extension sends no telemetry: no usage data, no activation events and no error reports. It has no telemetry setting because there is nothing to turn off. Its network use is:- The CLI download. Installing or updating the CLI calls the GitHub releases API (
api.github.com/repos/promptguardhq/promptguard-cli/releases/latest) and downloads the binary and its.sha256file from that release. - What the CLI does when the extension runs it. Initialize validates your API key, and threat scanning, redaction and project selection call the PromptGuard API. Detecting SDKs, status, apply, enable and disable work on local files. The CLI sends no telemetry either; see CLI telemetry.
Changelog
Release notes are in the extension’s CHANGELOG.Contributing
The extension is open source:- Repository: github.com/promptguardhq/promptguard-vscode
- Issues: Report bugs or request features
- Pull Requests: Contributions welcome
Next Steps
CLI Tool
Scan from command line
GitHub Scanner
Scan repos on push and PR
Python SDK
Runtime protection
Node.js SDK
JavaScript protection