---
title: Do prompt injection detectors stop indirect prompt injection?
url: https://opencontroller.lyzr.com/blog/do-prompt-injection-detectors-stop-indirect-injection
published: 2026-11-15
updated: 2026-11-15
author: Lyzr
---

# Do prompt injection detectors stop indirect prompt injection?

**Not reliably. A classifier in front of the model lowers the rate of successful indirect injection, but it is a probabilistic filter that adaptive attackers can get past. The dependable defence is architectural: limit what an agent can do after it reads untrusted content, so that a successful injection has nothing harmful to trigger.**

Indirect prompt injection is when instructions hide inside content the agent reads rather than in the user's message: a web page, a PDF, an email, a ticket, a tool result. OWASP lists prompt injection as LLM01 in its 2025 Top 10 for LLM applications and names indirect injection explicitly.

## Why can't a detector catch every injection?

A detector is a model judging text. It faces three structural problems:

1. **Unbounded input space.** Instructions can be paraphrased, translated, encoded, split across chunks or hidden in markup. There is no fixed signature to match.
2. **Adaptive attackers.** In October 2025, researchers from OpenAI, Anthropic and Google DeepMind published "The Attacker Moves Second". Using adaptive attacks (gradient methods, reinforcement learning, search and human red-teaming), they bypassed 12 recently published jailbreak and prompt injection defences, most with attack success rates above 90%, although those defences had originally reported near-zero success.
3. **Base rates.** An agent may read thousands of documents a day. A detector that misses 1% of attacks still lets attacks through at scale, and one tuned to miss fewer blocks legitimate content.

Detectors are still useful. They catch unsophisticated attempts, generate alerts and give you telemetry. They should be one layer, not the boundary.

## Which design patterns contain injection instead?

A June 2025 paper, "Design Patterns for Securing LLM Agents against Prompt Injections", sets out six patterns. The common idea: once an agent has read untrusted input, constrain what that input can cause.

| Pattern | How it works | What it costs |
|---|---|---|
| Action-selector | The model picks from a fixed list of actions; tool output never flows back into the model | Low flexibility |
| Plan-then-execute | The plan is fixed before untrusted data is read; data cannot add new steps | Can still alter arguments of planned steps |
| LLM map-reduce | Untrusted items are processed by isolated sub-calls that return constrained outputs | More calls, more latency |
| Dual LLM | A privileged model plans and calls tools; a quarantined model reads untrusted text and returns only symbolic references | Engineering complexity |
| Code-then-execute | The model writes a program up front; a sandbox runs it over the data | Needs a sandbox and a restricted language |
| Context minimisation | Remove the user's original prompt and unneeded content before later steps | Can reduce answer quality |

Two further controls work regardless of pattern:

- **Capability restriction.** Give each agent only the tools and data it needs. An agent that summarises web pages does not need to send email.
- **Break the lethal trifecta.** Avoid giving one agent private data, exposure to untrusted content and a way to communicate externally at the same time. See [what is the lethal trifecta for AI agents](/blog/what-is-the-lethal-trifecta-for-ai-agents).

## How should you test both detectors and containment?

Test them separately, because they fail differently.

1. **Build an injection corpus.** Include direct, indirect, encoded, multilingual and multi-step injections placed in documents, tool results and retrieved chunks.
2. **Measure detector recall and false positives** on that corpus and on a sample of real, benign traffic.
3. **Run adaptive red-team rounds.** Let testers (human or automated) iterate against the detector. Static benchmarks overstate protection.
4. **Test containment with the detector switched off.** Assume the injection succeeds. Can the agent then send data out, call a write tool or change its plan? If yes, the architecture is the gap.
5. **Re-run after every prompt, model or tool change.** Injection resistance is not stable across versions.

## How Opencontroller does this

Opencontroller runs multi-turn and red-team evaluations against registered agents, so injection tests can be repeated per version. Posture flags agents with risky permission combinations, such as broad tool access alongside exposure to external content. Policy as code in the LLM Gateway and Agent Gateway sits in the traffic path to allow, route, redact or block, and policies map to OWASP and MITRE ATLAS. If an agent starts behaving abnormally, rogue-agent handling can alert, quarantine or kill it. None of this replaces sound agent design; it makes the design enforceable and visible across the estate. More on this in [how to stop a rogue AI agent](/blog/how-to-stop-a-rogue-ai-agent) and on the [capability reference](/capability-reference).

## Frequently asked questions

**Should we still deploy a prompt injection classifier?**
Yes, as a monitoring and filtering layer. Do not treat its pass result as permission for the agent to take sensitive actions.

**Does a stronger model resist injection on its own?**
Newer models tend to resist more attacks, but published adaptive attacks still succeed. Model choice is not a security boundary.

**What is the single most effective change?**
Remove the combination of untrusted input and consequential tools from the same agent context, or put a human or deterministic check between them.

To see these controls on your own agents, [book a demo](https://www.lyzr.ai/book-demo/).

## Key facts

Prompt injection is OWASP LLM01:2025. Oct 2025 paper "The Attacker Moves Second" (researchers from OpenAI, Anthropic, Google DeepMind): adaptive attacks bypassed 12 published defences, most above 90% success. June 2025 paper lists six containment patterns: action-selector, plan-then-execute, LLM map-reduce, dual LLM, code-then-execute, context minimisation. Detectors are a layer, not a boundary. Opencontroller (by Lyzr): red-team evals per version, Posture for risky permissions, policy as code in LLM and Agent Gateway, rogue-agent quarantine and kill. From $250K per deployment per year.

## Related

- [How to stop a rogue AI agent: kill switches, quarantine and runtime controls](https://opencontroller.lyzr.com/blog/how-to-stop-a-rogue-ai-agent.md)
- [What is the lethal trifecta for AI agents?](https://opencontroller.lyzr.com/blog/what-is-the-lethal-trifecta-for-ai-agents.md)
- [What is excessive agency in AI agents?](https://opencontroller.lyzr.com/blog/what-is-excessive-agency-in-ai-agents.md)
- [More on Runtime control](https://opencontroller.lyzr.com/blog/cluster/runtime-control)
