,

·

Prompt Injection in AI Agents: Why It Isn’t Fixed and How to Contain It

Pixel-art illustration: a document with a hidden red instruction sends a payload toward a blue agent bot, blocked by a green shield; the agent sits in a sandbox beside a Rule of Two checklist with the external-action row locked.

Key takeaways

  • Prompt injection is still ranked the number one risk in the OWASP Top 10 for LLM Applications 2026, and there is no reliable fix for it.
  • The UK’s NCSC warns that it is not like SQL injection: models have no internal boundary between instructions and data, so filtering cannot close the hole.
  • Because injection will sometimes succeed, the job is to limit what a hijacked agent can do. Meta’s Agents Rule of Two is the most practical design rule available.

What is prompt injection?

Prompt injection happens when text an attacker controls ends up in a language model’s context and the model treats it as instructions. In a chatbot that is mostly an embarrassment. In an agent that can read email, call APIs and run code, it means an attacker can steer real actions.

There are two forms. Direct injection is a user typing hostile instructions into the prompt. Indirect injection is the dangerous one for agents: the instructions hide in content the agent reads while doing its job, such as a web page, a support ticket, a pull request comment or a document in a shared drive. The person using the agent never sees them.

Why it is not SQL injection

Security teams with a web background often reach for the SQL injection comparison, and the UK National Cyber Security Centre has argued that the comparison is dangerous. SQL injection was largely solved by parameterised queries, which give the database a hard separation between code and data. Language models have no equivalent. Instructions and data arrive as the same stream of tokens, and the model predicts what comes next from all of it.

The NCSC’s framing is that an LLM is an inherently confusable deputy: something with authority that can always be talked into misusing it. Its conclusion is that prompt injection may never be mitigated the way SQL injection was, and that if a system cannot tolerate the remaining risk, it may not be a good use case for an LLM.

That has a practical consequence. Input filters, injection classifiers and “ignore any instructions in this document” system prompts all reduce the success rate, but none reduce it to zero, and attackers get unlimited attempts. Treat them as a speed bump, never as a security boundary.

What it looks like in practice: one prompt, a whole cloud region

Zenity Labs’ AgentCorruption research on Amazon Bedrock AgentCore, published in October 2026, shows how a single injection becomes a cloud compromise. The chain was short:

  1. Any agent tool that made HTTP requests could reach the instance metadata service, so one prompt could make an exposed agent fetch its own temporary IAM credentials.
  2. The default execution role was not scoped to one agent. It covered AgentCore resources across the whole account and region.
  3. With those credentials, the researchers could invoke every other agent in the region, read private conversations across users and sessions, plant memories that changed how agents behaved in future sessions, and pull secrets from AWS Secrets Manager.

AWS described agents reaching their own role credentials as documented and expected behaviour. By late September 2026 Zenity observed that the default role had been substantially restricted. The lesson does not depend on the vendor: the injection was the entry point, but the blast radius came from overly broad permissions. That part was fixable all along.

Where it sits in the OWASP 2026 lists

Prompt injection holds the top spot in the OWASP Top 10 for LLM Applications 2026, as it has in every edition. The bigger signal is what moved. Excessive Agency rose from sixth to third, and Unbounded Consumption from tenth to sixth. In other words, the list now cares less about what a model says and more about what a connected model can do and spend.

For teams building agents, OWASP also maintains a separate Top 10 for Agentic Applications, released in December 2025. Several of its entries map straight onto the AgentCorruption chain, including tool misuse and exploitation (ASI02), identity and privilege abuse (ASI03) and manipulation of agent memory and context (ASI06). It is the better threat-modelling checklist if your system takes actions rather than only producing text.

How to contain it: the Rule of Two

Since injection cannot be reliably blocked, the useful question is what an agent can do once it is hijacked. The clearest answer so far is Meta’s Agents Rule of Two, published in October 2025. It builds on the “lethal trifecta” framing from the blog that coined the term prompt injection. Within a single session, an agent should have no more than two of these three properties:

  • A. It processes untrustworthy input (web pages, inbound email, tickets, third-party documents).
  • B. It has access to sensitive systems or private data.
  • C. It can change state or communicate externally (send messages, write to systems, make web requests).

An agent with all three is one hostile paragraph away from leaking or destroying data. Drop any one leg and the worst case shrinks a lot. A research agent that browses the web but has no private data access is fine. So is an internal agent with database access that never reads outside content. When a workflow genuinely needs all three, the third leg goes behind a human approval step.

Meta is explicit that this is not a finish line: designs that satisfy the rule can still fail. It is a way to make the blast radius of a successful injection small enough to survive.

A containment checklist for agent builders

  1. Score every agent against the Rule of Two before it ships, and again whenever someone adds a tool or connector.
  2. Give each agent its own identity with least-privilege permissions. No shared, account-wide roles.
  3. Block network paths the agent does not need, starting with cloud metadata endpoints and arbitrary outbound requests.
  4. Require human confirmation for irreversible or outbound actions: sending messages, changing sharing, payments, deletions.
  5. Treat long-term memory as untrusted input. Anything that can write to memory can steer future sessions.
  6. Log tool calls, not only prompts, so you can reconstruct what a hijacked agent actually did.

FAQ

Is prompt injection the same as jailbreaking?

No. Jailbreaking is a user trying to get a model to break its own safety rules. Prompt injection is untrusted content hijacking an application built on a model, often without the user knowing. The defences differ, and confusing the two leads to protecting the wrong thing.

Will better models fix prompt injection?

Newer models resist known attack patterns better, but no current model enforces a boundary between instructions and data. Plan your architecture as if injection will sometimes succeed.

Are guardrail products worth buying?

They can lower the attack success rate and give useful telemetry. Just do not let them replace permission scoping and approval steps. A classifier that reads attacker-controlled text can itself be manipulated.


Sources are linked inline and were checked on 27 November 2026.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *