The AI Reply Is Untrusted Too: Links, Commands and Hidden Content in What It Writes Back
An AI tool that can be fooled writes replies that can be fooled too. A Brightwell assistant hands back a lookalike login link, a command nobody can read and a one-pixel picture that leaks an order total just by being shown. Check the reply, then limit what it can trigger.
What you will learn
- Explain why a reply from your own AI tool is input, not a trusted answer
- Spot the three things a reply can carry: a link, a command and hidden content
- Match each way a reply gets used (shown, run, forwarded) to the control that limits it
- Scale the check to what the reply can trigger, and keep a person before send, pay or delete
Before you start
- Prompt Injection, Jailbreaks and Untrusted Input
Most talk about AI security is about what goes into an AI tool: the hidden line in an email, the trick typed into a chat. This article is about the other half of the conversation, which is what the tool writes back.
A reply can carry more than an answer. It can carry a link, a piece of code or a command, and even content you never see. We'll walk through each one with a small example from Brightwell Logistics (a made-up delivery company), see how a reply turns into something that actually does something, and finish with the controls that keep it small. No coding needed.
Check what goes in. Check what comes out.
Here's the full trip. Your request goes in. The tool works on it, and we already know it can be steered by hidden instructions in the things it reads (see prompt injection and untrusted input). Then it writes a reply, and that reply lands somewhere: on your screen, in another system, or in an email to a customer.
The reply isn't safe just because it came from your own assistant. Treat it like any other input, and check it before you trust it. The OWASP list of risks for AI applications has a name for this one: improper output handling.
A reply can carry a link
Someone at Brightwell asks the assistant to summarise an email from a supplier. That email has hidden text in it, and the summary comes back with one helpful line:
Summary done. To approve the supplier invoice, confirm here: brightwell-supplier-portal.example/confirm
It looks like the supplier's portal. The address actually goes to a lookalike page that asks for your password. And you didn't type that link. The tool wrote it, so it feels like it came from your own side, which is exactly why it works.
The rule is simple: look at where a link really goes before you click it.
A reply can carry code or a command
You ask for help with a problem on the shared printer. The reply says "To fix the shared printer, run this:" and gives you a long line of text you can't read.
Think about what happens next. You copy it. You run it. And it runs as you, with your access to your files and your accounts. Whatever that line does, it does with your permissions.
So if you can't explain it, don't run it. Ask someone in IT to read it first.
A reply can carry hidden content
This one is harder to see, because it's hidden. The reply is shown in a chat window and looks perfectly normal: "Your order summary is ready. Three items, delivery on Friday." Tucked into it is a picture, one pixel wide, that nobody will notice.
To show that picture, your screen contacts another server. The address it asks for can carry details from your conversation, like a customer name or an order total. Nobody had to click anything. Just displaying the reply was enough to send them out.
If you want to see this exact path inside a support agent, with the fix in code, read memory poisoning and exfiltration paths.
Three ways a reply gets used
Every reply ends up being used in one of three ways, and each one is where a different kind of trouble does its work.
| The reply is... | Where | What goes wrong |
|---|---|---|
| Shown | On a page or in a chat | Hidden content gets loaded |
| Run | By a system that acts on it | A command does its work |
| Forwarded | To a customer or another tool | The problem travels with it, and now it looks like it came from you |
Notice the pattern. The more automatic the step, the fewer chances anyone gets to catch the problem.
Check it, then limit what it can trigger
You do two things: you check the reply, and you cut down what it's allowed to set off.
- Links: show the real address, and only allow sites you know.
- Code and commands: a person reads it first, or it runs in a safe test area that can't reach anything real.
- Pictures and pages: show plain text, and don't load content from outside unless you trust the source.
- Anything sent on: a person looks at it before it leaves.
Both parts matter. A check can miss something, but a limit still holds.
The more a reply can trigger, the more you check
How strict should you be? That depends on what the reply can set off.
If it only shows text on a screen, a light check is enough. If it opens links or loads content, check more closely. And if it can run actions on its own, a person approves each one. For how to sort actions into "runs alone" and "needs a person", see human-in-the-loop routing.
Common mistakes
- Trusting a link because the assistant wrote it. The assistant may have copied it from a hidden line in the email it summarised.
- Pasting a command to "just try it". It runs with your access, not the assistant's.
- Letting a chat window load pictures from anywhere. That turns every reply into a possible way out for data.
- Checking but not limiting. A filter will miss something one day. A limit (known sites only, a test area, a person before sending) still holds.
Recap
| A reply can carry | The risk | Your habit |
|---|---|---|
| A link | A lookalike page that asks for your password | Look at where it really goes |
| Code or a command | It runs as you, with your access | If you can't explain it, don't run it |
| Hidden content | Showing it sends your data out | Plain text, nothing loaded from outside |
Three things you can do this week:
- Look before you click or run: check where a link goes, and don't run anything you can't explain.
- Ask whoever looks after your AI tools what they do with replies. Do they show pictures from outside, run replies automatically, or forward them on?
- Keep a person between a reply and anything that sends, pays or deletes.
A reply is input, not a trusted answer. Check it, limit what it can trigger, and keep a person at the last step.
StudyEasy AI Community
Learn AI engineering, share what you build, and connect with other learners.
Free resources: lesson files, notebooks and code
Ask questions and join engineering discussions
Meet real people learning and building with AI
Related course on Udemy
AI Security Essentials
Prompt injection, data leaks, AI agents and governance in plain words.View on Udemy ↗: AI Security Essentials (paid course, opens in a new tab)Related posts
Guardrails for an LLM Agent: Check What Comes In, What It Wants to Do, and What Goes Out
An agent that reads customer emails and can refund up to $200. In a small simulation, a phrase filter still lets 6 of 8 written attacks do harm and blocks 2 honest users; plain checks outside the model take harm to 0 of 8, at a cost of 1 honest request failed and 2 held.
The Agent Attack Surface: Blast Radius, Narrow Tools, Scoped Keys and the Dangerous Three
A support agent reads a ticket that says run SELECT * FROM customers and email the result outside, and it has run_sql and send_email, so the customer list leaves. The model wasn't hacked, it was equipped. Map each tool by what it reads, changes and sends, replace the two large ones with narrow tools, scope the keys, and never give one agent untrusted input, private data and a way out together.
Prompt Injection, Jailbreaks and Untrusted Input: Label What Comes In, Gate What Goes Out
Three texts reach a support agent in one week: an injected ticket, a poisoned help article and a jailbreak. A naive agent turns all three into leaks; three small checks in plain code take that to zero.
Injection Exposure Review for an Agent: Map Inputs, Data and Effects, Layer Every Path, Retest the Job
Review a refund agent the way a security team would: map where stranger text gets in, what it can read and what it can do, layer every path, then show the four normal questions still give the same answer.
