Skip to main content
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

  1. Open VS Code
  2. Go to Extensions (Cmd/Ctrl + Shift + X)
  3. Search for “PromptGuard”
  4. 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:
  1. Download promptguard-vscode-<version>.vsix from the latest release
  2. Open the Command Palette (Cmd/Ctrl + Shift + P) and run Extensions: Install from VSIX…
  3. Choose the downloaded file
An extension installed from a .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 your PATH 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 (if promptguard.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 press Cmd/Ctrl + . on a PromptGuard warning:

Problems Panel

All findings appear in the Problems panel (Cmd/Ctrl + Shift + M), with the source PromptGuard:

Status Bar

The status bar item reads promptguard 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
Click it to run PromptGuard: Show Status. 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
See the CLI’s Supported Providers for which of these 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

Check:
  • Is the CLI installed? Run PromptGuard: Install/Update CLI, or set promptguard.cliPath
  • Is promptguard.autoInstallCli set to never?
Try:
  • Reload window: Cmd/Ctrl + Shift + P → “Reload Window”
  • Check Output panel for errors: View → Output → PromptGuard
Check:
  • Is the file in an excluded location (see Excluded Files)?
  • Does the file construct a supported SDK client?
Try:
  • Run “PromptGuard: Detect LLM SDKs” manually
  • Check the Problems panel (Cmd/Ctrl + Shift + M)
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.
Solutions:
  • Disable promptguard.scanOnSave for 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 .sha256 file 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:

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
Last modified on November 16, 2026