Helpful first: Jailbreak or prompt injection: who is attacked? · Trust boundaries: the server decides
Thirty days to Halcyon · Case 15: The model from outside · Episode 3 of 4
Thursday. Nyx, the Threat Hunter, has the web proxy log open and a fresh label on her monitor: outbound. On Wednesday at 08:52, a browser showing the ops dashboard fetched an image from cdn-.
The request's address holds lines of text Nyx recognizes. They come from suppliers' anomaly reports that only Meridian should have.
Dax Mercer, Software Engineer, owns the dashboard. "We never show outside images." Nyx turns her screen toward him. "Then what did the page send?"
By the end you can
- Name the places model output can cause harm: browsers, shells, queries, and other tools
- Encode or constrain output for the place it is used
- Explain how a rendered image link can carry data out of a page
Model output is input to the next system
A model's answer is not the end of the line. pathfinder- writes markdown, a plain-text format in which symbols mark headings, links and images. The dashboard turns that markdown into HTML, and a browser renders the HTML. Each step acts on what the step before it wrote.
Anyone who can shape a model's input can shape its output. Wednesday's supplier report showed that an outsider can. So the summary deserves the same trust as the supplier's text, which is none. OWASP's 2026 list for LLM applications calls this risk improper output handling, LLM10. Its advice is to treat the model like any other user, with zero trust.
That puts a trust boundary between the model and every system that uses its output. The rule is old. Text from a web form is encoded or checked before a page, a database or a shell acts on it. Model output gets the same treatment, whoever wrote the model.
Four places output lands, four controls
A sink is the place where data is finally used, such as a web page or a database query. Model output usually lands in one of four. Each fails in its own way and needs its own control.
In a web page, markup in the output becomes part of the page. Script that runs this way is cross-site scripting (XSS). The default control is output encoding for the context. Text placed in the page body is HTML-encoded, text placed in an attribute is attribute-encoded, and so on. Most web frameworks do this unless the code opts out.
In a database query, output pasted into SQL text becomes SQL. Bind it as a parameter instead, so the database treats it as a value. In a shell, output pasted into a command line becomes a command. Do not hand model output to a shell. Call one fixed program, with arguments picked from a list.
In another tool, output becomes an action, which the excessive agency lesson covers. Encoding is the default for display. Sanitizing strips dangerous markup and keeps the rest. Keep it for the rare page that must show real HTML.
| Sink | What goes wrong | Control |
|---|---|---|
| Text in a web page | Markup in the output runs as part of the page (XSS) | Encode for the context it lands in |
| An image, link or link preview in a page | The browser or the server contacts an address the attacker chose | Load only from listed hosts, and show every link's full address |
| A database query | Output becomes SQL (SQL injection) | Bind output as a parameter, never as query text |
| A shell | Output becomes a command (command injection) | No shell. One fixed program, with arguments from an allow-list |
| Another tool | Output becomes an action | Narrow tools, and a gate outside the model |
SORT IT OUT
Dax lists five places the summarizer's output could go next. Which control fits each one?
Show the answers
- Encode as text. The page needs to show the words, never run them. HTML encoding does exactly that.
- Bind as a parameter. A bound parameter is always a value. It cannot change the shape of the query.
- Pick from an allow-list. There are three valid answers. Anything else is refused before it reaches the exporter.
- Pick from an allow-list. Only hosts Meridian controls are allowed. Any other address is shown as text and never fetched.
- Encode as text. A heading is still page content. A name can hold markup, so it is encoded like any other text.
SPOT THE PROBLEM
These are the dashboard's renderer settings as Nyx found them on Thursday. Flag each setting that lets model output do more than show text in the reader's browser.
Show the answers
- Raw HTML inside markdown: passed through to the page Any tag the model writes becomes part of the page, script included.
- Images: any address that starts with https An attacker's host has a certificate too. The browser fetches whatever address the summary names.
- Links: show the link text, hide the address A link that reads full report can point anywhere, and nobody can tell before clicking.
The image link that sent data out
Nyx follows the request back to its source. Wednesday's poisoned supplier report held a second instruction in its chart's alt text. It told the model to end every summary with a status image, at an address on cdn-, with the summary's anomaly lines added to the address.
The model did as it was told. Its summary ended in markdown for an image: > - Before, at the renderer. The old renderer passed HTML inside markdown straight through. The page got a bold tag and an image tag.
- Before, in the browser. The image address
xfails to load, so theonerrorhandler runsalert(1)inside the dashboard. An attacker would read the page instead. - After, at the renderer. The new renderer HTML-encodes the line. Each
<becomes<and each>becomes>. - After, in the browser. The page shows the characters
<b>nominal</as text. Nothing runs and nothing loads.b> <img src=x onerror=alert(1)>
Result: The model wrote the same words both times. The renderer decided whether they were text or code.
CHECK YOUR JUDGMENT
Dax's team wants pathfinder-7b to power a search box. An engineer types a question, the model writes a SQL query, and the app runs it against the anomaly database with the app's read-write account. Nyx asks how the model's output should reach the database. What is the right design?
CASE FILE · CASE 15 · ENTRY 3 OF 4
Answer the closing question correctly to add this entry to your case file.
The image was a messenger
The dashboard rendered an image whose address carried anomaly text to an outside host. Now output is escaped as text and images load only from Meridian's host.
Next episode: The fixes hold on the cases we know. What about the ones we have not thought of?
Review sheet: exam notes and quick reference
Risk The potential for harm, assessed using what could happen, how likely it is, its impact, and what remains uncertain.
Control A process, configuration, or technology meant to reduce a named risk or detect a named failure.
Trust boundary A place where identity, network, or data assumptions change and a fresh check is required.
Log A record emitted by a system that something happened, which may later be used as evidence.
Zero trust An architecture approach that grants no implicit trust from network location or asset ownership and evaluates access to resources using identity, device, and other context.
XSS A flaw in which a page includes untrusted data without encoding it, so the browser runs it as script inside the site's own origin. The script can then act as the user who is viewing the page.