Blank white background with no objects or features visible.

Nous vous offrons un accès gratuit à l'intégralité du Gartner Hype Cycle for AI Governance 2026. Obtenez votre exemplaire →

Jailbreak and Prompt-Injection Detection at the Gateway

Par Ashish Dubey

Published: October 16, 2026

TL;DR
  • There are three attacks to catch: direct injection (the user overrides your system prompt), jailbreaks (role-play tricks like “DAN”), and indirect injection (malicious instructions hidden in a retrieved document).
  • Detection has to look in two places — the user prompt and the context/documents — because indirect injection hides in content your app pulled in, not in what the user typed.
  • TrueFoundry’s built-in Prompt Injection guardrail is zero-config, powered by Azure Prompt Shield and fully managed — no keys, thresholds, or categories to set.
  • It runs on LLM Input and MCP Pre-Tool hooks, blocking attacks before the model or tool runs. It’s detect-and-block (validate) only.
  • It’s a layer, not a cure. Pair it with content moderation, secrets detection, and least-privilege tool access for defense in depth.

What prompt injection and jailbreaks are

A prompt injection is any input that makes a model ignore the instructions you gave it and follow the attacker’s instead. Because an LLM can’t reliably tell your system prompt from someone else’s text in the same context window, a well-crafted message can simply overrule it.

The attacks come in recognizable forms. A direct injection is the user telling the model to disregard its rules — “ignore your instructions and…” A jailbreak is a role-play framing that smuggles the model past its safety training — the classic “you are DAN, you can do anything now.” An indirect injection is the dangerous one: the malicious instruction isn’t typed by the user at all, it’s hidden inside a document, web page, or tool result your application retrieves and pastes into the prompt. The user asks an innocent question; the poisoned context does the attacking.

For anything with retrieval or tools — which is most production AI now — indirect injection means you can’t trust the context any more than the user. Detection has to cover both.

Three kinds of attack

Three attacks the guardrail detects

Three attacks the guardrail detects

The distinction matters because it dictates where you have to look. Direct injection and jailbreaks live in the user’s message. Indirect injection lives in the content your pipeline assembled — the retrieved document, the scraped page, the API response an agent pulled back. A detector that only reads the user prompt will miss the third category entirely, and the third category is the one the user can’t even see.

How detection works

The gateway inspects incoming content in two parts and blocks the request if either one trips.

Detecting jailbreaks and prompt injection

Detecting jailbreaks and prompt injection

Dual analysis is the key design point: the guardrail scans the user prompt for direct injection and jailbreak patterns, and separately scans the system prompt and context/document content for indirect injection. An attack found in either location blocks the request before it reaches the model.

Under the hood, TrueFoundry’s built-in Prompt Injection guardrail is powered by Azure Prompt Shield and runs on TrueFoundry-managed infrastructure — there are no credentials, thresholds, or categories to configure. Because it inherits Azure’s 10,000-character limit, long prompts are automatically split into chunks (up to ~9,500 characters each, broken at paragraph or sentence boundaries) and scanned concurrently; detection is a logical OR across chunks, so one flagged chunk blocks the whole request. Transient Azure errors are retried with backoff. All of that is handled for you.

Detection options

The built-in guardrail is the fast path, but the gateway also integrates vendor detectors if you need your own stack or self-hosted deployment.

Prompt-injection detection options in the gateway

Prompt-injection detection options in the gateway

The built-in option needs no keys. If you’re self-hosted or standardized on a vendor, you can bring your own Azure Prompt Shield key, or use Google Model Armor, AWS Bedrock Guardrails (prompt-attack content filters), dedicated LLM-security vendors like HiddenLayer, Akto, or F5, or NVIDIA NeMo’s self_check_input. They all plug into the same guardrail pipeline, so switching or combining them is a config change.

Where teams get this wrong

They only scan the user prompt. That leaves indirect injection — the attack hidden in retrieved content — wide open. Scan the context too.

They treat detection as a silver bullet. No detector catches 100% of attacks. Prompt-injection detection is one layer; combine it with content moderation, secrets detection, and least-privilege tool permissions.

They forget the tool surface. In agentic systems, injected instructions can arrive in tool parameters. Run detection on the MCP Pre-Tool hook, not just LLM input.

They enable hard blocking cold. Turning on enforce with no baseline risks false-positive blocks on legitimate prompts. Start in Audit, review detections in traces, then enforce.

‍

Try now.

One gateway for all your models, MCP servers, and agents.
No credit card needed.

INSCRIVEZ-VOUS
Table des matières

Gouvernez, déployez et suivez l'IA dans votre propre infrastructure

Réservez un séjour de 30 minutes avec notre Expert en IA

Réservez une démo

Le moyen le plus rapide de créer, de gérer et de faire évoluer votre IA

Démo du livre
Summarize with
ChatGPT logo by OpenAI
Perplexity AI logo
Blurry red snowflake on white background, symmetrical frosty design with soft edges and abstract shape.

Découvrez-en plus

Aucun article n'a été trouvé.
October 16, 2026
|
5 min de lecture

Secrets Detection in Prompts: Stop Credential Leaks to LLMs

Aucun article n'a été trouvé.
October 16, 2026
|
5 min de lecture

Jailbreak and Prompt-Injection Detection at the Gateway

Aucun article n'a été trouvé.
October 16, 2026
|
5 min de lecture

Realtime / Live API and Voice Agents Through the Gateway

Aucun article n'a été trouvé.
October 16, 2026
|
5 min de lecture

LiteLLM Tutorial: Install, Configure, Run the Proxy

Aucun article n'a été trouvé.
Aucun article n'a été trouvé.

Blogs récents

Black left pointing arrow symbol on white background, directional indicator.
Black left pointing arrow symbol on white background, directional indicator.

Questions fréquemment posées

What is prompt injection detection?

A guardrail that scans LLM inputs for attempts to override the model’s instructions — direct injections, jailbreaks, and indirect injections hidden in context — and blocks the request before it reaches the model.

What’s the difference between a jailbreak and a prompt injection?

A jailbreak is a type of prompt injection that uses role-play or framing (like “DAN”) to bypass safety behavior. Prompt injection more broadly is any input that overrides your intended instructions, including instructions hidden in retrieved documents (indirect injection).

How does the gateway catch indirect injection?

Through dual analysis: it scans the user prompt and the system prompt/context separately, so an injected instruction hidden in a retrieved document is detected even though the user’s message looks innocent.

Do I need to configure anything?

No. TrueFoundry’s built-in Prompt Injection guardrail is powered by Azure Prompt Shield and fully managed — no keys, thresholds, or categories. You can also bring your own vendor if you prefer.

Does it stop every attack?

No detector is perfect. Prompt-injection detection is one layer of defense in depth — pair it with content moderation, secrets detection, and least-privilege tool access.

Does it work for AI agents?

Yes. It runs on the MCP Pre-Tool hook as well as LLM Input, so injected instructions in tool parameters are caught before a tool executes.

Faites un rapide tour d'horizon des produits
Commencer la visite guidée du produit
Visite guidée du produit