Skip to main content
The PromptGuard CLI scans your codebase locally to detect unprotected LLM SDK calls before you push to Git. It supports Python, JavaScript, and TypeScript projects.

Installation

macOS (Homebrew)

Linux / macOS (Binary)

Cargo (Rust)

Verify Installation

Quick Start

Scan Your Project

Output:

Initialize Protection

This interactively:
  1. Detects which LLM providers you use
  2. Installs the PromptGuard SDK
  3. Adds promptguard.init() to your entry point
  4. Shows you what changed

Commands

promptguard scan

Scan for unprotected LLM SDK calls.
Examples:

promptguard init

Initialize PromptGuard SDK in your project.
Examples:

promptguard check

Check if protection is properly configured.
Output:

promptguard fix

Auto-fix unprotected calls by adding SDK initialization.
Examples:

promptguard providers

List detected LLM providers in your codebase.
Output:

promptguard redteam

Run adversarial security tests against your configuration.
Examples:

promptguard policy

Manage guardrail configurations as YAML files (policy-as-code).
Examples:

Supported Providers

This table is generated from sdk-patterns.json, the single source of truth the scanner reads. Mistral and Groq were previously listed here but have never been in it, and neither SDK patches them — the rows advertised detection that did not exist. Azure OpenAI is detected through the OpenAI patterns (AzureOpenAI is one of the recognised class names).

Configuration

.promptguardrc

Create a config file in your project root:

Environment Variables

CI/CD Integration

GitHub Actions

Security Gate Action

Use the official PromptGuard Security Gate for automated red team testing on PRs:

GitLab CI

Pre-commit Hook

Output Formats

Pretty (Default)

Human-readable colored output for terminal use.

JSON

SARIF

GitHub Code Scanning compatible format:
Upload to GitHub:

Troubleshooting

Solution: Add to PATH
Check:
  • Are you in the right directory?
  • Are the files in the include patterns?
  • Try: promptguard scan --include "**/*.py"
The CLI uses AST parsing, not regex. If you see false positives:

MCP Server

The CLI includes a native MCP server for AI-powered editors:
This lets Cursor, Claude Code, Windsurf, and other MCP-compatible editors call PromptGuard tools directly. See the MCP docs or Cursor plugin for setup instructions.

Next Steps

Cursor Plugin

AI-native security in Cursor

MCP Server

Connect to any AI editor

GitHub Scanner

Scan repos on push and PR

VS Code Extension

See findings in your editor