Skip to main content

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:
curl -fsSL https://raw.githubusercontent.com/acebot712/promptguard-cli/main/install.sh | sh
Or install manually from GitHub Releases.

Step 2: Install the Extension

From VS Code:
  1. Open VS Code
  2. Go to Extensions (Cmd+Shift+X / Ctrl+Shift+X)
  3. Search for “PromptGuard”
  4. Click Install
From Command Line:
code --install-extension promptguard.promptguard-vscode
From Marketplace: Visit the VS Code Marketplace and click “Install”

Quick Start

1. Initialize PromptGuard

  1. Open Command Palette (Cmd+Shift+P / Ctrl+Shift+P)
  2. Run PromptGuard: Initialize
  3. Enter your API key when prompted (or sign up if you don’t have one)
  4. Select providers (or press Escape to use all)
That’s it! Your project is now protected.

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 Status from 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
Warnings appear as you type, helping you identify where PromptGuard should be applied.

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
Click the status bar to view detailed configuration.

Commands

All PromptGuard commands are available via the Command Palette:
CommandDescription
PromptGuard: InitializeSet up PromptGuard in your project
PromptGuard: Scan for LLM SDKsScan project for LLM SDK usage
PromptGuard: Show StatusDisplay current configuration
PromptGuard: Apply TransformationsApply PromptGuard transformations
PromptGuard: DisableTemporarily disable PromptGuard
PromptGuard: EnableRe-enable PromptGuard

Signup Flow

If you don’t have an API key, the extension guides you through signup:
  1. Choose “Sign up / Get API key” when initializing
  2. Browser opens to the signup page
  3. After signing up, paste your API key
  4. Setup continues automatically

Configuration

CLI Path

If the CLI is not in your PATH, you can set a custom path:
  1. Open Settings (Cmd+, / Ctrl+,)
  2. Search for “PromptGuard”
  3. Set PromptGuard: Cli Path to the full path to the binary
Example: /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:
  1. Verify the CLI is installed: promptguard --version
  2. Check it’s in your PATH: which promptguard (macOS/Linux) or where promptguard (Windows)
  3. Set the promptguard.cliPath setting to the full path

Extension Not Working

  1. Check the Output channel: View → Output → Select “PromptGuard”
  2. Reload the window: Cmd+Shift+P → “Developer: Reload Window”
  3. Check VS Code version: Must be 1.80.0 or higher

Diagnostics Not Showing

  1. Ensure PromptGuard is initialized: Run PromptGuard: Initialize
  2. Check that your files have supported extensions (.ts, .js, .py, etc.)
  3. Verify the CLI is working: Run PromptGuard: Scan for LLM SDKs

Next Steps

Open Source

The PromptGuard VS Code Extension is open source: