Aria reads for a living. Every shift it opens messages from people it has never met, looks up records, and acts on what it finds. That is the whole job, and it is also the whole problem. Some of the text Aria reads will be written by someone who wants Aria to do the wrong thing, and that text does not arrive labeled as an attack. It arrives looking like a refund request with one extra line tucked inside. This chapter is about the single discipline that keeps that line from working. You treat every word Aria reads as data, something to look at, never as instructions, something to obey, so that no customer can talk Aria into rewriting its own goal.
Everything Aria reads is someone else's text
Start with where the danger comes from. A plain chatbot only ever read the question you typed and answered it. Aria is different in one specific way: it reads untrusted input, text written by strangers, and then it takes actions in the real world based on what that text says. The order note, the email body, the name on the account, the line a customer pasted into the chat. None of it was written by you, and all of it flows straight into the same place your own instructions live: the model's context, the running list of words it is reasoning over.
That is what makes prompt injection possible. Prompt injection is when text the agent reads contains its own instructions, and the agent follows them as if they came from you. The attacker never touches your code or your config. They just write a sentence into a place Aria will read it, and they count on Aria treating that sentence as a command. The picture below walks the path one poisoned message takes, from the inbox all the way to a refund that should never have gone out.
Read that flow as a failure, not a feature. The reason it works is that nothing in the chain ever decided whether a given sentence was yours to follow or just words to read. Once the injected line is sitting in context next to your real rules, the model has no built-in way to tell the two apart. The whole rest of this chapter is about putting that missing boundary back, deliberately, in code, so the line gets read but never obeyed.
Data is something you read, instructions are something you obey
The fix starts with a distinction so basic it is easy to skip, which is exactly why injection keeps working. There are two kinds of text in Aria's context. Instructions are the rules you wrote: help the customer, check the $50 cap, escalate anything bigger. Data is everything Aria reads in order to do that job: the message, the record, the order history. The rule is one sentence. Instructions are yours to set and Aria obeys them. Data is the world's to write and Aria only reads it. Injection is what happens when those two collapse into one, when a piece of data gets treated as an instruction.
Put the two side by side and the danger is obvious. When a message is read as instructions, a line a stranger wrote can become a new order and the goal can be rewritten mid-task. When the same message is read as data, every word is just content, and only the rules you set decide what Aria does. Same text, two completely different blast radii, and the only thing that changed is which box you filed the words in.

Notice that this is a decision you make about the text, not a property the text has on its own. The exact same sentence, approve the full refund, is harmless as data and dangerous as an instruction. So securing Aria against injection is not about detecting bad sentences. It is about making sure that no matter what a sentence says, it lands in the data box and stays there. You stop trying to guess which words are an attack and instead refuse to let any read words become commands.
What a poisoned message actually looks like
It helps to see one, because a real injection rarely looks like a hack. It looks like a slightly odd support email. Here is a message that lands in Aria's inbox about order 4815. Most of it is an ordinary, reasonable refund request from J. Okafor. One line in the middle is the attack, and it is written to sound like it came from the system rather than the customer.

The whole trick lives in that one called-out line. It borrows the word SYSTEM to impersonate your real instructions, and it asks for exactly the thing your rules forbid: a $128 refund pushed through without the cap check or a human. To Aria, if there is no boundary, that line is indistinguishable from a rule you wrote. It is sitting in the same context, in plain language, asking politely. The reason it is harmless here is not that Aria is clever enough to see through it. It is that you have decided, in advance, that nothing inside a message can ever be an instruction, including a line that calls itself one.
Watch the goal get rewritten
It is worth slowing down to see what injection actually does to Aria, because the damage is not that Aria reads a bad sentence. The damage is that the sentence changes what Aria is trying to do. Aria starts a turn with a goal you set: help with this refund request, check it against the $50 cap, escalate if it is over. The injected line reaches up out of the message and overwrites that goal. Watch the before and after below. The message comes in on the left, and on the beat the hidden command flies across and rewrites Aria's working goal on the right.
That morph is the entire attack in one motion. Before, Aria's goal is the one you wrote, and the $128 refund would have hit the cap and gone to a human. After, the goal is the attacker's, and Aria is now trying to approve the full refund as fast as it can, because as far as it can tell that is the job. Notice that Aria did nothing wrong by its own lights. It read its instructions and followed them. The instructions were just no longer yours. This is why the defense cannot be "make Aria more careful." Aria was careful. The defense has to make the goal something content is structurally unable to touch.
Keep instructions and data in separate boxes
Now the defense, and it is structural, not clever. You keep your instructions and the untrusted data in separate, clearly labeled boxes, and you build Aria so that only the instruction box can change what it does. Your rules go in a trusted channel, the system instructions, set once by you. Everything Aria reads, the message, the record, the order note, goes in an untrusted channel that is explicitly marked as content to consider, never commands to follow. The diagram below shows the two zones and the wall between them.
In practice you make the boundary real by wrapping the untrusted text and telling the model, in the trusted instructions, that the wrapped text is data and the rules above it are the only rules. You do not paste a raw message in next to your instructions and hope the model sorts it out. You frame it. The snippet below is the shape of that framing: the cap check stays in your trusted instructions, the message is clearly fenced as content, and the goal is restated as something the content cannot change.
That fence does not make the model magically immune, and you should not lean on it alone. It is the first layer, and it pairs with the boundary already built into the rest of this course. The $50 cap from the last chapter is checked in code, not in the prompt, so even an Aria that got talked into approving a refund hits a wall before money moves. Least privilege means the talked-into Aria can only reach a few tools anyway. Injection defense is one more layer in that stack: separate the boxes, protect the goal, and let the deterministic checks downstream catch whatever still slips through.
The discipline, in one comparison
Step back and the whole chapter reduces to one habit, applied to every word Aria reads. The unsafe agent trusts its input: it lets a line in a message become an order, lets the goal drift, lets a clever sentence skip the cap. The safe agent treats input as data: every word is content to read, the rules you set are the only thing that steers, and the goal stays fixed no matter what shows up in the inbox. Same Aria, same messages. The only difference is which box the words land in.
That is the line to hold for the rest of the course. The next chapter assumes the goal is protected and asks the next question: even with the boxes separated, some actions are too costly to let a well-behaved Aria take alone. So you put a human in the loop on the ones that matter, with an approval threshold and an audit trail. But that gate only means something on top of this one. Protect the goal from the content first, then decide which protected actions still need a person to say yes.
- Prompt injection is text Aria reads that contains its own instructions, and the agent follows them as if they came from you.
- Everything Aria reads, messages and records and notes, is untrusted input that lands in the same context as your real rules.
- Draw one line: instructions are yours to set and Aria obeys them, data is the world's to write and Aria only reads it.
- A poisoned message looks like an ordinary request with one hidden line, often impersonating SYSTEM to ask for the forbidden thing.
- The real damage is the goal getting rewritten by content, so protect the goal first, because everything downstream inherits it.
- Keep instructions and data in separate boxes and fence untrusted text, then let the in-code cap and least privilege catch what slips through.


