Prompt injection has been the top item on the OWASP Top 10 for LLM Applications since the list existed, and it has not been dethroned in the agentic version either. What changes in agentic systems is the blast radius. A prompt injection against a chatbot produces a bad sentence. A prompt injection against an agent produces an action: a tool call, a database write, a wire transfer, a message sent on behalf of the user, an instruction handed off to another agent. The defense problem is no longer "stop the model from saying something wrong." It is "stop the system from doing something wrong, even when the model has been talked into wanting to." That reframing is what most teams shipping agents today have not yet done. For the broader risk taxonomy these defenses map to, the OWASP Top 10 for Agentic Applications remains the canonical reference.

Why prompt injection breaks differently in agentic systems

The original framing of prompt injection, articulated by Simon Willison in 2022, was about user inputs overriding system prompts in a single-turn LLM. Two years and a generation of agents later, the dominant failure mode is no longer the user trying to jailbreak the chatbot — it is untrusted content arriving through retrieval, tools, or other agents that the model treats as authoritative because it cannot reliably distinguish trusted from untrusted text in its own context window. Greshake et al.'s "Not what you've signed up for" formalized this as indirect prompt injection in 2023, and every credible threat model since has treated it as the central agentic risk. The reason it scales worse than direct injection is mechanical: every new retrieval source, tool, and agent peer is another untrusted input channel, and the agent's action space grows with each one.

#1
Prompt injection remains the top-ranked risk on both the OWASP Top 10 for LLM Applications and the OWASP Top 10 for Agentic Applications

The persistence of prompt injection at the top of the ranking is not because mitigations have failed — it is because the underlying problem is architectural. LLMs do not have a structural mechanism for separating instruction from data in the way operating systems separate code from input. Until that distinction is enforced outside the model — at the runtime layer — every new context channel an agent gains is a new injection vector.

The four entry points: where injection actually enters an agent

1

Direct User Input

The classic vector — a user types something designed to override the agent's instructions or extract its system prompt. Input filters catch the obvious cases but cannot enumerate adversarial creativity. The OWASP LLM Top 10 has placed direct prompt injection (LLM01) at the top of every revision since 2023.

2

Retrieved Content (RAG)

An agent's retrieval pipeline pulls in documents, web pages, or knowledge-base entries that may contain instructions the agent will execute. Indirect prompt injection through RAG bypasses every perimeter input filter because the malicious instruction was never typed by a user — it was sitting in a document the agent was asked to summarize.

3

Tool Outputs

API responses, scraped web pages, file contents, and search results all return text that the agent reads and acts on. A compromised or attacker-controlled endpoint can return crafted output that redirects the agent's next action. The OWASP Agentic Threats and Mitigations guidance flags this as one of the highest-leverage attack paths in multi-tool agents.

4

Inter-Agent Messages

In multi-agent deployments, one agent's output becomes another agent's input. A compromised or manipulated upstream agent can pass instructions downstream as data, and the receiving agent has no built-in way to verify the message wasn't authored under duress. This is the cascade vector behind ASI08 (Cascading Agent Failures).

Why filters, system prompts, and "model alignment" cannot solve this

The most common defensive moves teams reach for first are the weakest. Input filtering — pattern-matching for suspicious strings like "ignore previous instructions" — degrades into a whack-a-mole exercise within days, because adversaries iterate faster than filters do and the space of natural-language attacks is unbounded. System prompts that instruct the model to "ignore any injected instructions" rely on the model being able to distinguish injected from legitimate instructions in its own context, which is precisely the capability the threat model assumes it lacks. Model-level alignment improves the floor on direct injection but provides no architectural guarantee against the indirect case, because the model's job is to read and act on the content in its context — including the content that was placed there by an attacker.

Microsoft's Prompt Shields documentation is explicit about this limitation: content-level classifiers are one defense layer, but they are not sufficient on their own and must be paired with action-level controls. Anthropic's research on Constitutional AI takes a similar position — model-side defenses raise the cost of attack but do not constitute a security boundary on their own.

"The defense problem is no longer 'stop the model from saying something wrong.' It is 'stop the system from doing something wrong, even when the model has been talked into wanting to.'"

Provenance and trust boundaries: the architectural fix

The defensible architecture treats every piece of text in an agent's context as having a provenance label — user, retrieved document, tool A, tool B, agent peer — and uses that label to gate what the content is allowed to influence. A document retrieved from an untrusted source can inform the agent's response but cannot trigger a privileged tool call. A tool output from an external endpoint can be summarized but cannot redirect the agent to a new task. The model still gets to reason over everything in its context; the runtime layer decides which reasoning paths can become real-world actions. This is the agentic equivalent of the same-origin policy that made the modern web tractable — content from one trust domain cannot exercise the privileges of another.

Building this requires three things that most agent frameworks do not provide by default: content provenance tracking through the entire pipeline (not just at the entry point), explicit trust tiers for tools and data sources, and a policy layer that knows how to evaluate "action X requested by content from source Y" rather than just "action X." For a fuller picture of how this layer fits into the broader control stack, see our piece on runtime security for AI agents.

Runtime enforcement of injection-aware policies

The control that actually stops a successful injection from becoming a successful attack is action-level enforcement at runtime — the same execution-time decision function described in Microsoft's runtime authorization model. The model can be persuaded to want to do anything; the runtime decides what it is allowed to do, scoped by the provenance of the content that motivated the action and the privilege tier of the tool being invoked.

Content Trust TierSourcesAllowed Action Surface
TrustedAuthenticated user, internal signed system prompts, vetted tool outputsFull scoped action surface, subject to least-agency permissions
Semi-trustedInternal documents, first-party APIs, governed knowledge basesRead, summarize, draft — no privileged writes, no external sends
UntrustedPublic web content, third-party tool outputs, inter-agent messages from external peersInform reasoning only — cannot directly trigger any tool invocation

The practical implication is that even if an attacker successfully embeds a "transfer funds to X" instruction in a retrieved web page, the runtime sees a privileged tool call originating from untrusted-tier content and denies it — or escalates it for human review under the tiered oversight model described in our guardrails piece. The model was hijacked. The system was not.

The dual-LLM (planner-executor) pattern

For high-risk agents where the cost of a successful injection is unacceptable, the strongest pattern available today is the dual-LLM architecture popularized by Simon Willison's dual-LLM proposal and used in production by several agent platforms. A "planner" LLM reads untrusted content and produces a structured plan in a constrained schema. An "executor" LLM (or a deterministic policy engine) takes only the structured plan — never the raw untrusted text — and decides which tool calls to make. The executor is never exposed to attacker-controlled prose, so it cannot be talked into anything. The planner can be hijacked; its hijack just doesn't propagate.

This pattern trades some capability for a substantial reduction in attack surface, and it is increasingly the default in regulated deployments. Google's CaMeL research describes a closely related approach using capability-based access control between planner and executor, with formal guarantees that untrusted content cannot influence tool selection.

Detection: knowing an injection happened

Prevention is not perfect, and detection is the second line of defense. Effective detection for prompt injection in agentic systems combines four signals: provenance-tagged audit logs that show which content motivated which action, anomaly detection on action sequences (an agent that suddenly attempts an out-of-pattern tool call after reading a new document is a signal), output-side classifiers that catch suspicious agent outputs before they propagate, and human review queues for any action originating from untrusted-tier content above a risk threshold. The NIST AI Risk Management Framework's Measure and Manage functions both require this kind of continuous observability — not as a compliance artifact, but as the operational substrate that makes incident response possible.

Without this layer, prompt injection incidents are detected by their downstream consequences — a wrong wire transfer, an exfiltrated record, a complaint from a customer — rather than by the security team. By that point, the cost of the incident is locked in.

Agent Security Checklist: A practical sequencing guide for working through prompt injection defenses, provenance tracking, runtime enforcement, and red-teaming — organized by priority.

Download Free →

Pre-Production Prompt Injection Checklist

Every piece of content entering the agent's context carries a provenance label (user, retrieval source, tool, agent peer)
Tools are tiered by privilege; untrusted-tier content cannot trigger privileged-tier tools at runtime (Microsoft runtime authorization)
Indirect injection through RAG documents and tool outputs is part of the red-team test plan, not just direct user-input testing
High-risk agents use a planner/executor split so untrusted prose never reaches the action-decision layer (dual-LLM pattern)
Inter-agent messages are authenticated and provenance-tagged, not treated as trusted because they came from another internal agent (ASI08 cascade prevention)
Action logs record which content provenance motivated each tool call — sufficient to reconstruct an injection incident post-hoc
Anomaly detection runs continuously on agent action sequences, with alert thresholds tuned to the deployment's risk profile

Frequently Asked Questions

What is indirect prompt injection, and why is it harder to defend against than direct injection?

Indirect prompt injection is an attack in which the malicious instruction arrives through content the agent retrieves or reads — a document, a web page, a tool response, a message from another agent — rather than from the user's typed prompt. It was formalized in Greshake et al.'s 2023 paper "Not what you've signed up for." Direct injection has a single, well-defined entry point (the user input field) where filters and classifiers can be applied. Indirect injection has as many entry points as the agent has data and tool sources, none of which the user typed and most of which the perimeter does not inspect. Defending against it requires architectural controls — provenance tracking and runtime policy enforcement on the action surface — rather than content-level filtering alone. For the broader risk picture, see our OWASP Agentic Top 10 overview.

Why don't input filters or "ignore injected instructions" system prompts solve the problem?

Input filters can only catch attacks they have been trained or programmed to recognize. The space of natural-language attacks is unbounded, and adversaries iterate faster than filter rules do — within days of a new filter pattern, public jailbreak repositories carry working bypasses. System prompts that instruct the model to "ignore injected instructions" presuppose that the model can reliably distinguish injected from legitimate instructions inside its own context window — the exact capability the threat model assumes it lacks. Both Microsoft's Prompt Shields documentation and Anthropic's Constitutional AI research describe content-level defenses as one layer in a defense-in-depth stack, not as a security boundary on their own. The boundary has to live outside the model, in the runtime that decides which actions the model's outputs are allowed to trigger.

How is prompt injection in agentic systems different from prompt injection in a chatbot?

A successful prompt injection against a chatbot produces a wrong or harmful sentence. A successful prompt injection against an agent produces a wrong or harmful action: a privileged tool call, a database modification, an external API write, a message sent on behalf of the user, an instruction passed to another agent. The blast radius scales with the agent's action surface — every additional tool, data source, and agent peer is another channel both for the injection to arrive through and for the consequences to propagate. The OWASP Top 10 for Agentic Applications reflects this by treating prompt injection as the root cause of multiple downstream risks, not a standalone category. The defensive shift is from "stop the model from saying something wrong" to "stop the system from doing something wrong, even when the model has been talked into wanting to" — which is fundamentally a runtime enforcement problem.

What is the dual-LLM pattern and when should I use it?

The dual-LLM pattern, articulated by Simon Willison in 2023, separates the agent into a "planner" that reads untrusted content and produces a structured plan, and an "executor" that takes only the structured plan — never the raw untrusted text — and decides which tool calls to make. Because the executor never sees attacker-controlled prose, it cannot be persuaded by it. The planner can be hijacked; the hijack does not propagate to actions. Google's CaMeL research extends the pattern with capability-based access control and formal guarantees. Use it for high-risk agents where the cost of a successful injection is high — financial actions, infrastructure changes, regulated data handling, privileged write operations. For lower-risk agents, runtime policy enforcement with provenance-tagged tool tiers usually provides sufficient protection without the dual-LLM complexity.

How does prompt injection defense relate to EU AI Act and NIST AI RMF compliance?

The EU AI Act's obligations for high-risk AI systems, fully in force August 2026, require demonstrating that autonomous systems operate within actively enforced boundaries and maintain logs sufficient to reconstruct decisions. A successful prompt injection that produces an unauthorized action is, by the Act's definitions, a failure of those boundaries — and is reportable. Runtime enforcement of provenance-aware policies, paired with action-level audit logs, is the technical substrate that makes both compliance with the Act and incident reconstruction possible. The NIST AI Risk Management Framework's Map, Measure, and Manage functions map directly to provenance tracking, anomaly detection, and tiered response. Organizations already aligned to the AI RMF and operating a runtime policy layer will find their prompt injection defense and their regulatory documentation largely satisfied by the same infrastructure. Our piece on organizational AI agent governance covers how these frameworks compose at the program level.

See how Skyrelis stops prompt injection at runtime

Provenance-aware policy enforcement across every input, tool call, and inter-agent message — without changing your agent code.