Guardbee.ai
@guardbee/mcp-prompt-injection-scanner

Prompt Injection Scanner

Prompt injection scanner for documents, web pages and RAG content: instruction overrides, spoofed chat roles, hidden text and data-exfiltration attempts, as a CLI and an MCP server

v1.2.0MIT · Open sourceNode.js · stdio
Install
$ npx -y @guardbee/mcp-prompt-injection-scanner
Claude Desktop / Cursor config
{
  "mcpServers": {
    "prompt-injection-scanner": {
      "command": "npx",
      "args": [
        "-y",
        "@guardbee/mcp-prompt-injection-scanner"
      ]
    }
  }
}
@guardbee/mcp-prompt-injection-scanner

@guardbee/mcp-prompt-injection-scanner scans content, not code: a RAG chunk, scraped page, or document. In classic prompt injection the attacker talks to the model; in indirect injection they embed instructions in data the model later reads via RAG or fetch — and those instructions can look as authoritative as the user’s.

What does it do?

It finds phrases like “ignore previous instructions”, spoofed System: roles, chat-template markers (<|im_start|>, [INST]), zero-width hidden text, display:none + instructions, HTML-comment commands, “Dear AI” addresses, and exfiltration patterns (reveal system prompt, templated img beacons, send-data-to-URL).

Who is it for?

  • RAG / knowledge-base product teams
  • Apps that put scraped pages or tool results into LLM context
  • DevSecOps scanning document repos on every PR
  • Developers who want this check inside Claude or Cursor

What it is not

  • Source-code / MCP-tool SAST (use AI Code Scanner or Server Auditor)
  • Replacing a runtime WAF that blocks every LLM call
  • A full semantic jailbreak model (heuristic text patterns)

Features

FeatureDescription
10 patterns / 5 categoriesinstruction-override, role-spoofing, hidden-text, direct-address, exfiltration
RecommendationsWhy it’s risky and what to do
SARIF 2.1.0For knowledge-base CI gates
guardbee.ymlfail-on, max-files, exclude rules
FP-awareEmoji ZWJ and ordinary display:none modals are tested

MCP tools

ToolDescription
scan_textScan a text/document snippet
scan_fileSingle file
scan_directoryDirectory / knowledge base (skips node_modules, .git, dist)
list_patternsList supported patterns

Install with npm

Global install (handy for Claude Desktop / Cursor):

bash
<code class="language-bash">npm install -g @guardbee/mcp-prompt-injection-scanner</code>

or via npx (recommended with -y in config):

bash
<code class="language-bash">npx -y @guardbee/mcp-prompt-injection-scanner</code>

npm: @guardbee/mcp-prompt-injection-scanner

CLI
<code class="language-bash">npx @guardbee/mcp-prompt-injection-scanner scan ./knowledge-base --fail-on=high --format=sarif > results.sarif</code>

Opt out of telemetry with GUARDBEE_TELEMETRY=0.

Claude Desktop configuration

Config file paths:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Merge this block, then restart Claude Desktop:

claude_desktop_config.json
<code class="language-json">{
  "mcpServers": {
    "guardbee-prompt-injection-scanner": {
      "command": "npx",
      "args": [
        "-y",
        "@guardbee/mcp-prompt-injection-scanner"
      ]
    }
  }
}</code>

Cursor and other MCP clients

In Cursor, add the same command / args / env under Settings → MCP. stdio MCP servers use the same contract as Claude Desktop.

Example prompts in Claude

  1. “Scan this knowledge-base folder for prompt injection: ./docs”
  2. “Does this scraped HTML hide instructions?”
  3. “Which patterns do you support? list_patterns”

Frequently asked questions

Vs AI Code Scanner?+

AI Code Scanner scans code; Prompt Injection Scanner scans the data/documents the model will read.

False positives?+

Known FP sources are tested — still review findings manually.

API key?+

No — fully local/filesystem.

More in this category

See your security posture in minutes

Add your domain, run a read-only scan and get a prioritised list of fixes. No installation required.

Prompt Injection Scanner MCP server (@guardbee/mcp-prompt-injection-scanner) · GuardBee