SafePrompt · Prompt injection detection API
Get a free API key
SafePrompt
Prompt injection detection API for LLM apps and agents.
Back to blog
Ian Ho
•
9 min read

Prompt injection detection tools: six options, ranked by fit

Where each tool runs, what it costs, and which projects are still maintained. Every vendor fact read at the source today.

Prompt InjectionAI SecurityComparisonLLM SecurityTools

Key points

Six tools read prompt injection out of your input before your model sees it. SafePrompt is the hosted API for teams that want one call, any model, and a free start. Lakera Guard clears an enterprise security review. LLM Guard runs entirely on your own hardware, and its repository is archived. Azure Prompt Shields fits a stack already inside Azure. GuardrailsAI hands you every validator to tune. Rebuff is a research base, read-only since 2024. Start with SafePrompt when the constraint is time.

You shipped a feature with a text box, and that box talks to a model. The harmless version of what a stranger types is a strange answer. The costly version is a message telling your model to drop its rules, print the system prompt, or spend your API budget on someone else's work.

The support text box can become an attack entry point when its messages reach a model.

The fix is a check in front of the model. Six tools do that job, and they split on three things: where the check runs, what it costs, and whether anyone is still maintaining it.

SafePrompt is one of the six, so each competitor fact in this comparison comes from that vendor's own page, linked, and each section names the constraint that should send you elsewhere. For the case against writing your own filter, read why regex fails at prompt injection detection.

Quick Facts

Tools compared:6
Repositories archived:2 of 6
Hosted, nothing to run:3 of 6
Free path to a first call:6 of 6

What are the six prompt injection detection tools?

Each comparison row was read on the vendor's own page or registry today. The two rows that decide most shortlists are the last maintained date and where the check runs.

FeatureSafePromptLakera GuardLLM GuardAzure Prompt ShieldsGuardrailsAIRebuff
Where it runsHosted APIHosted APIYour own hardwareAzure resourceYour own hardwareYour own hardware
LanguagesAny, over HTTPAny, over HTTPPythonAny, over HTTPPythonPython
Free path10,000 free validations a month, no cardCommunity plan, 10k requests a monthOpen source5,000 text records a monthOpen sourceOpen source
Paid from$29 a monthEnterprise, sales-quotedYour infrastructure$0.375 per 1,000 text recordsYour infrastructureYour infrastructure
Still maintainedYesYesRepository archivedYesYesRepository archived
Self-hostingNoEnterprise planYesNoYesYes
SOC 2 on the vendorNoYesNot applicableThrough AzureNot applicableNot applicable
Input size cap50,000 characters8,000 tokens on CommunityYours to set1,000 characters per billed recordYours to setYours to set

Read at the sources listed at the foot of this post on 2026-09-12. Prices and plans move, so check before you commit.

Which tool works with any model and needs no infrastructure?

SafePrompt is one HTTP call in front of whatever model you already call, and the free tier starts at 10,000 free validations a month with no card. It reads the user's text, returns a verdict, and leaves your model provider, your language and your hosting exactly as they are.

Our public benchmark suite re-runs against the production API every six hours. Over the last 30 days it recorded 97.5% of attack prompts blocked, and the suite is in the public repository so you can run it yourself with your own key.

259 public cases, 120 runs over the last 30 days, suite v3.0+vector-rule-2026-09-04.

The response carries a safe boolean, a confidence value, the threat labels that fired, and a short reason. That is enough to branch on and enough to log. An npm package exists (npm install safeprompt) for teams who prefer a dependency to a fetch call.

// One call in front of any model, any language
const res = await fetch('https://api.safeprompt.dev/api/v1/validate', {
  method: 'POST',
  headers: {
    'X-API-Key': process.env.SAFEPROMPT_API_KEY,
    // The END USER's IP, not your server's
    'X-User-IP': endUserIp,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({ prompt: userInput, sensitivity: 'strict' })
});

// Fail closed: an outage is not a pass
if (!res.ok) throw new Error('Validation unavailable: ' + res.status);

const { safe, threats, confidence } = await res.json();
if (!safe) throw new Error('Injection detected: ' + threats.join(', '));

// Now call OpenAI, Anthropic, Gemini, Mistral, anything

Pick it when you want protection today, across more than one model, without adding a service to your deployment. Teams that must keep every byte inside their own network want LLM Guard instead, and teams whose buyer demands SOC 2 on the vendor want Lakera Guard.

Which tool clears an enterprise security review?

Lakera Guard arrives with the paperwork a procurement team asks for, including SOC 2 certification and EU data residency on its published plan. It is a hosted API like SafePrompt: you send text, it returns a verdict, and it detects prompt injection alongside other content risks.

Lakera is now part of Check Point, whose copyright notice runs across lakera.ai today.

The published pricing page lists two plans. The free Community plan covers 10k requests a month, caps prompts at 8,000 tokens, and is SaaS-only. The Enterprise plan is sales-quoted, and it carries SSO, role-based access control, SIEM integration and the self-hosted option.

Lakera also runs its own PINT benchmark. Only Lakera can run it, so it gets no row in the table above. The Lakera Guard alternative comparison goes deeper on the self-serve side of that trade.

Pick it when a signed audit report is a gate on the purchase and a sales cycle is acceptable.

Which open source prompt injection scanner is worth running?

LLM Guard is still the most complete open-source toolkit in this list, with scanners for prompt injection, invisible text, secrets, PII, toxicity and more, all running on hardware you control. You install it with pip install llm-guard and no user text leaves your network.

Read the repository before you build on it. The project page now opens with an archive notice: "THIS PROJECT HAS BEEN ARCHIVED. This project and its associated models on Hugging Face are no longer under active development or maintained."

PyPI still serves version 0.3.16 under the MIT licence, so the package installs and runs. Attack techniques move, and an archived detector does not move with them.

That is the whole case for an LLM Guard alternative. If the reason you chose it was data residency, the replacement has to be another self-hosted scanner such as GuardrailsAI. If the reason was cost, a hosted free tier removes the maintenance you were about to inherit.

Pick it when no data may leave your network, you write Python, and you accept ownership of a detector nobody else is updating.

Which tool fits a team already inside Azure?

Azure Prompt Shields gives an Azure team a screening call that is already inside their subscription, their billing and their compliance boundary. Microsoft documents it as a unified API in Azure AI Content Safety that screens user prompts and documents before content is generated, which means it screens text for any model you go on to call.

The constraint is the platform, not the model. You need an Azure subscription, a Content Safety resource, and one of the supported regions. Billing is per 1,000 text records, a record being up to 1,000 characters, so one long prompt plus its retrieved documents can bill as several records.

Microsoft publishes no accuracy figure for Prompt Shields. Its own page says the service may miss attack vectors or flag legitimate prompts.

Pick it when your stack is already on Azure and one more resource is no friction. Our Azure Prompt Shields alternative post has the side-by-side code and the full cost picture.

Which tool gives you control over every validator?

GuardrailsAI lets you assemble exactly the checks you want and nothing you do not. You define aGuard, attach validators from the hub (Detect Prompt Injection is one of them), and wrap your model calls with input and output validation in one place.

The price of that control is the assembly. You choose validators, tune their thresholds, run the embedding models somewhere, and keep the guard definitions current as attacks change. Detection quality follows the configuration you built, and no vendor number describes it.

Pick it when you have Python engineers who want to own the pipeline and a reason to validate output as well as input.

Which tool is a research base, not a product?

Rebuff is the most interesting architecture here to read: heuristics, a model-based check, and a vector database of past attacks, layered so each catches what the others miss. It is a good starting point if you are building your own detector and want a structure to borrow.

Rebuff is archived: GitHub reports the repository archived with its last push in August 2024, and PyPI still serves 0.1.1. The vector layer also expects you to bring and maintain your own attack corpus, which is the part that ages fastest.

Pick it when you are studying detection design and not shipping a product this month.

What about NVIDIA NeMo Guardrails?

NeMo Guardrails solves a neighbouring problem, which is why it has no row above. You describe allowed conversation paths in Colang, its own modelling language, and the framework keeps a conversation inside them. That restricts what your assistant will discuss rather than reading the incoming text for an attack.

It sits alongside a detection tool rather than replacing one. Teams running a complex multi-turn product often want both.

Which one should you pick?

Start from your hardest constraint and the list collapses fast.

  • No data may leave your network. GuardrailsAI, or LLM Guard with the archive notice understood.
  • Your stack is already on Azure. Azure Prompt Shields, billed per 1,000 text records.
  • A buyer requires SOC 2 on the vendor. Lakera Guard.
  • You need it working this afternoon, on any model. SafePrompt, free tier, no card.
  • You are building your own detector. Read Rebuff, then write something newer.

What SafePrompt covers

SafePrompt screens submitted text for attempts to redirect the AI reading it. Your app enforces the verdict before model consumption, and keeps control of permissions and tool actions. Evaluate both attacks and ordinary traffic before choosing a setting.

LayerWhat SafePrompt handlesStays in your app
Attacks in the user messageDetects and blocks before your model reads it
Hidden instructions in retrieved contentValidate the chunk before it reaches the model
Escalation built up over a sessionDeployment-enabled tracking; neither conversation isolation nor gradual escalation is established
Who is allowed to call your endpointYour auth, where it already lives
What your AI is allowed to doLeast privilege on tools and data
Sign-off on high-risk actionsA human in the loop

Frequently asked questions

What is the best prompt injection detection tool?

SafePrompt for most teams: any model, one HTTP call, and a free tier with no card. Lakera Guard is the pick when a security review needs SOC 2 on the vendor. LLM Guard is the pick when no data may leave your network, with the caveat that its repository is now archived.

Is there a free prompt injection detection tool?

Every tool here has a free path. SafePrompt gives 10,000 free validations a month with no card. Lakera publishes a free Community plan at 10k requests a month. Azure Prompt Shields includes 5,000 text records a month. LLM Guard, GuardrailsAI and Rebuff are open source, so the cost moves to the hardware you run them on.

Is LLM Guard still maintained?

No. The repository carries an archive notice saying the project and its Hugging Face models are no longer under active development or maintained. The package still installs and runs, and nobody is shipping fixes for it.

Do you still need a detection tool if your app has a system prompt?

Yes. A system prompt is an instruction, not a wall. An attacker can talk a model out of its instructions in plain English. A detection tool reads the input before your model does, so the override never lands.

Sources

Further reading

Try the shortlist in an afternoon

A free key takes a minute, with 10,000 free validations a month. No card, no sales call.

Protect Your AI Applications

SafePrompt checks untrusted text before your model reads it. Add the API call to your input path and use its verdict to block flagged messages, documents and tool results.

Add SafePrompt as a preferred source on Google. You tick one box on Google's own page. Google then shows you more of our posts in your own results.