> ## Documentation Index
> Fetch the complete documentation index at: https://docs.promptguard.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Cursor Plugin

> AI-native LLM security for Cursor -- rules, commands, and MCP tools

<Info>
  The PromptGuard Cursor plugin gives the Cursor agent real-time LLM security capabilities: scanning for threats, detecting unprotected SDK usage, redacting PII, and enforcing security best practices as you code.
</Info>

## Installation

### One-click install

Use the deep link to install the plugin and MCP server in one step:

```
cursor://anysphere.cursor-deeplink/mcp/install?name=promptguard&config=eyJjb21tYW5kIjoicHJvbXB0Z3VhcmQiLCJhcmdzIjpbIm1jcCIsIi10Iiwic3RkaW8iXX0=
```

### Prerequisites

The plugin requires the PromptGuard CLI for MCP server functionality:

<Tabs>
  <Tab title="macOS (Homebrew)">
    ```bash theme={"system"}
    brew tap promptguard/tap
    brew install promptguard
    ```
  </Tab>

  <Tab title="Linux / macOS (Binary)">
    ```bash theme={"system"}
    curl -fsSL https://raw.githubusercontent.com/acebot712/promptguard-cli/main/install.sh | sh
    ```
  </Tab>

  <Tab title="Cargo">
    ```bash theme={"system"}
    cargo install promptguard
    ```
  </Tab>
</Tabs>

Then configure your API key:

```bash theme={"system"}
promptguard init --api-key pg_live_xxxxxxxx
```

## What's included

The plugin bundles five components that work together:

### MCP Server (6 tools)

The CLI's built-in MCP server (`promptguard mcp`) exposes tools that the Cursor agent can call directly:

| Tool                       | What it does                                                                                                                                                                                                |
| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `promptguard_auth`         | Authenticate with PromptGuard. Opens the dashboard in the browser so you can copy your API key, then saves it locally. The agent calls this automatically when other tools report you're not authenticated. |
| `promptguard_logout`       | Log out by clearing the locally stored API key and configuration.                                                                                                                                           |
| `promptguard_scan_text`    | Scan any text for prompt injection, jailbreaks, PII leakage, and toxic content. Returns a decision (allow/block), confidence score, and threat details.                                                     |
| `promptguard_scan_project` | Scan a directory for unprotected LLM SDK usage across OpenAI, Anthropic, Cohere, Gemini, Bedrock, and more.                                                                                                 |
| `promptguard_redact`       | Redact PII (emails, phones, SSNs, credit cards, API keys) from text before sending to an LLM.                                                                                                               |
| `promptguard_status`       | Check whether PromptGuard is configured, which providers are active, and which key type is in use.                                                                                                          |

### Always-on Rule: Secure LLM Usage

When the agent writes code that imports any supported LLM SDK, this rule automatically guides it to include `promptguard.init()` with proper configuration. No manual invocation needed.

### Skill: Secure LLM Integration

A step-by-step playbook the agent follows when you ask it to add PromptGuard or build AI features:

1. Detect project language and LLM providers
2. Choose the right integration method (auto-instrumentation, Guard API, or HTTP proxy)
3. Install the SDK and add initialization
4. Configure security policies
5. Verify the setup

Includes a full threat model reference covering prompt injection, PII leakage, data exfiltration, agent tool abuse, and more.

### Commands

| Command               | Description                                                                                                                               |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `/promptguard-scan`   | Find unprotected LLM calls, hardcoded secrets, and misconfigurations. Reports findings in a severity-ranked table and offers to fix them. |
| `/promptguard-secure` | Add PromptGuard to the project end-to-end: detect language, install SDK, configure initialization, set up environment variables.          |

### Agent: LLM Security Reviewer

A specialized code reviewer that focuses on LLM-specific threats:

* Prompt injection (direct and indirect)
* PII leakage in prompts and responses
* Agent tool abuse (SQL injection, SSRF, path traversal via LLM tools)
* Secrets exposure in LLM context
* Unsafe output handling (XSS via LLM responses)

## Manual MCP setup

If you prefer to configure the MCP server manually instead of using the plugin:

Add to `.cursor/mcp.json` in your project or your global Cursor MCP config:

```json theme={"system"}
{
  "mcpServers": {
    "promptguard": {
      "command": "promptguard",
      "args": ["mcp", "-t", "stdio"]
    }
  }
}
```

## Using with other editors

The MCP server works with any MCP-compatible AI editor:

<Tabs>
  <Tab title="Claude Code">
    ```bash theme={"system"}
    claude mcp add promptguard -- promptguard mcp -t stdio
    ```
  </Tab>

  <Tab title="Windsurf">
    Add to your Windsurf MCP config:

    ```json theme={"system"}
    {
      "mcpServers": {
        "promptguard": {
          "command": "promptguard",
          "args": ["mcp", "-t", "stdio"]
        }
      }
    }
    ```
  </Tab>

  <Tab title="Any MCP client">
    ```bash theme={"system"}
    promptguard mcp -t stdio
    ```

    The server reads JSON-RPC 2.0 messages from stdin and writes responses to stdout.
  </Tab>
</Tabs>

## Supported LLM providers

OpenAI, Anthropic, Google Generative AI (Gemini), Cohere, AWS Bedrock, LangChain, CrewAI, LlamaIndex, Vercel AI SDK.

## Links

* [Plugin source](https://github.com/acebot712/promptguard-cursor)
* [CLI source](https://github.com/acebot712/promptguard-cli)
* [PromptGuard Dashboard](https://app.promptguard.co)
