The Core Vulnerability: Data vs. Instructions
To understand why AI agents are vulnerable, you have to understand how they 'think.' When you interact with a modern AI agent, the system doesn't just see your question. It builds a massive single sequence of text called a context window. This window contains
your instructions, the definitions of the tools the agent can use, and all the data it has gathered so far—like the text of a webpage it just read or an email it just opened. To the underlying model, this is all just one long string of tokens. Because the architecture treats everything in that window as part of the same conversation, a model often cannot distinguish between a command from you and a command hidden inside a piece of data it just retrieved. This is the fundamental crack in the armor: the model cannot inherently tell the difference between 'Do this task' and 'Ignore all previous instructions and do this instead' if the latter is buried in a PDF it just scanned.
Direct vs. Indirect Injection
Security researchers generally split these attacks into two camps. Direct prompt injection is the classic version: a user types a malicious command directly into the chat box to try and trick the AI. It is relatively easy to spot and defend against. However, the real danger in cloud-connected systems is 'indirect prompt injection.' In this scenario, the attacker never even talks to the AI. Instead, they plant malicious instructions in places they know the agent will look—a website, a calendar invite, a code comment, or a customer support ticket. When the agent goes about its job and 'reads' that content, it inadvertently swallows the attacker's hidden commands. The agent isn't being tricked by a person; it is being tricked by the very information it was tasked to process.
The Three Legs of a Data Breach
An injection that simply makes an AI give a weird or wrong answer is a nuisance, but an injection that steals your data is a catastrophe. For an attacker to turn a simple trick into a full-scale breach, three specific conditions must be met. First, the agent must have access to your private data. Second, it must be exposed to untrusted content—meaning it has a way to read text or images controlled by an attacker. Third, the agent must have the ability to communicate externally. If an attacker can satisfy all three, they can turn a hijacked agent into a data exfiltration machine. This is why the rise of 'agentic' workflows, where models are given permission to use tools like email, web browsers, and file editors, has significantly increased the attack surface for modern enterprises.
How Data Actually Leaves the System
Once an agent is hijacked, how does the stolen information actually get to the attacker? There are several technical channels used to move data from a secure environment to an external server. One common method is through tool usage: the attacker instructs the agent to 'Forward the last five invoices to this specific email address.' Another is via HTTP requests, where the agent is told to fetch a URL that includes the stolen data as a parameter in the web address. Perhaps most insidious is the 'image channel.' If an agent is using a chat interface that renders markdown, an attacker can command the agent to include a specific image link in its response. When the user's browser automatically tries to load that image, the request carries the stolen data straight to the attacker's server logs, often without the user ever clicking a single button.













