Detect prompt injection, jailbreaks, and code injection in untrusted text before it reaches an LLM.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Prompt injection detection API. One line of code blocks the attack before your AI reads it.
Protect AI apps, chatbots, and automations from prompt injection, jailbreaks, and data exfiltration. Built for developers who ship fast.
Quick Start Β· Why SafePrompt Β· Benchmarks Β· How It Works Β· Detection Β· LangChain Β· Tests Β· Uninstall
That's it. One API call between your user input and your LLM. Get a free key at safeprompt.dev.
[!IMPORTANT] Scope. SafePrompt is integration-boundary security: it blocks the instructions that would hijack the AI reading them. That means prompt injection and jailbreaks (instruction override, DAN-style impersonation), system-prompt extraction, exfiltration imperatives, and indirect injection or RAG poisoning. It does not police what your users are allowed to ask: harmful-topic knowledge questions ("what is a keylogger", "how do firewalls work"), harmful-artifact generation with no exfiltration target, and code payloads carried as data (SQL, XSS, shell, template) pass through, because they attack your database or your browser, not the reading AI. Pair it with your LLM provider's moderation layer for content policy. The benchmark numbers are scored under this scope.
Real incidents of the attack class SafePrompt is designed to detect:
| Incident | What Happened | Cost |
|---|---|---|
| Chevrolet (Dec 2023) | Chatbot agreed to sell a new Tahoe for $1 | Viral PR disaster |
| Air Canada (Feb 2024) | A tribunal held the airline to what its chatbot said (an accuracy failure rather than an injection; the lesson is the same) | CA$812 in damages plus fees |
| DPD (Jan 2024) | Support bot wrote hate poems about the company | Viral embarrassment |
These attacks use plain language. A reworded attack walks past a regex and still works on the model, so SafePrompt reads the meaning of the message, not its spelling.
Reproducible detection benchmark on the public API (benchmarks/):
| Metric | Where to find it |
|---|---|
| Attack catch rate and false-positive rate | Rendered on safeprompt.dev at every deploy from the continuous production eval (trailing 30 days, current suite version) |
| Latency | AI-path median and p95 from production api_logs, same page |
| Cadence | Every 6 hours against the production API; runs and failing cases in benchmarks/results/ |
| Suite in this repo | v2.2, 165 cases (85 safe + 80 attack). The production eval moved to suite v3 on 2026-09-04; see benchmarks/README.md |
The runner POSTs every prompt in benchmarks/prompts.json to the live API and prints per-category confusion + writes raw results to benchmarks/results/<timestamp>.json. The API requires an X-User-IP header on every call and answers HTTP 400 without it; run.js sends one by default (override with --user-ip or the SAFEPROMPT_USER_IP env var). See benchmarks/README.md for methodology.
3-layer defense system:
Layer 1: Pattern Detection
Layer 2: AI Validation
Layer 3: Network Intelligence
Result: the suite runs against the production API every 6 hours; current detection and false-positive rates are published on safeprompt.dev and in benchmarks/README.md. We do not measure accuracy on production traffic and do not claim to. (An earlier version of this README reported a single perfect run; continuous measurement since has never reproduced it, and that run was an earlier 100-prompt suite, not the larger current one; see benchmarks/README.md for the full history.)
session_token on the raw call and the verdict sees the earlier turns of the same session (sessions expire after 2 hours idle, 24 hours at most)| Package | Source | Registry |
|---|---|---|
safeprompt (JS / TS) | packages/safeprompt-js | npm |
safeprompt (Python) | packages/safeprompt-python | PyPI |
@safeprompt.dev/langchain | packages/safeprompt-langchain | npm |
safeprompt-langchain (Python) | packages/safeprompt-langchain-python | PyPI |
Validates every prompt flowing through a LangChain chain before it reaches the LLM. See packages/safeprompt-langchain/README.md.
Factual signals from GitHub, npm, and our automated checks β not a rating.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/mcp-171)<a href="https://allmcps.com/mcp/mcp-171"><img src="https://allmcps.com/api/badge/mcp-171?style=directory" alt="Safeprompt MCP on AllMCPs" /></a>