Blog

Why AI agents fall for prompt injection, and what stops it

Three attacks, one root cause: the agent cannot tell who an instruction is really from.

An AI agent acts on whatever its context tells it to do. When an instruction arrives through a channel the agent trusts, such as a chat message, a document it was asked to read or an approval from another agent, the agent has no reliable way to tell whether the instruction was meant for it. That is the root of prompt injection, and it shows up in three shapes.

We built Prompt Heist, a free browser game, so you can try all three on fictional agents and then see what stops each one. This post is the short version.

Direct injection: the instruction comes in through the front door

An agent's rules and a user's message reach it through the same channel. A message written as new instructions competes with the original ones, and rules that only block the plain request can miss a reworded or reformatted one. Act I of the game puts you in front of a friendly front desk agent that guards a gate code.

Indirect injection: the instruction comes in through the data

Anything an agent reads becomes part of what it acts on. Text planted in a log, an email, a ticket or a web page can steer the agent, written by someone who never talks to it. In Act II an archivist agent refuses every direct request for a secret, yet it summarizes documents without question.

Approval replay: the instruction comes with a stamp

In a system of several agents, one agent approves and another acts. If the approval is not tied to the exact request, the agent asking and a time window, it proves only that someone was once told yes. Whoever holds the approval can use it for something else, and the agent that executes it is a confused deputy. Act III has a policy gateway and an execution agent that trusts its stamp.

What stops each one

  • Keep secrets out of an agent's context, and gate sensitive actions on verified identity and policy enforced outside the model, not on the model choosing to refuse.
  • Treat retrieved content as untrusted data, and apply least privilege: an agent that only summarizes should never hold a vault credential.
  • Bind every approval to the exact action, the verified identity of the agent asking and a short expiry, and check it again where the action runs.

None of these depends on spotting the malicious text, which an attacker can word a thousand ways.

How Oathera helps

Oathera does not inspect or rewrite prompts, and it does not scan content for injected instructions. It gives every AI agent an identity bound to the machine it runs on, with a named person who answers for it, and checked every time it acts. Each call carries a single-use operation proof, and Oathera Agent Enforcement asks the Oathera Identity Service for a signed, single-use decision before the call goes through. An agent that has been talked into something still cannot call an unknown tool, pass arguments outside a tool's allow-list or reach a service outside its boundary, and a stolen token is useless without the session key it names. That limits what a manipulated agent can do. It does not stop the manipulation itself.

Play it, then see it refused

Prompt Heist is free, runs entirely in your browser and sends nothing you type anywhere. Play it at oathera.ai/prompt-heist. To watch a stolen token, a replayed proof and a tampered call get refused, try the simulator at sim.oathera.org. If you are putting agents into production, become a design partner.