100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
AI Guardrails & Safety Engineering
30 minadvanced

The Trust Boundary: Untrusted Text in a Trusted Loop

A web server that renders a user's comment without escaping it has a textbook cross-site-scripting bug, and the fix is decades old: never let untrusted input execute as code in a trusted context. An LLM application has the same shape of problem with no equivalent decades-old fix, because the model's entire interface is a context window where every token — the developer's system instructions, the user's message, a retrieved document, a tool's return value — sits in the same undifferentiated stream. The model was trained to follow instructions wherever they appear in that stream, which means text that was never supposed to carry authority can carry it anyway, simply by being phrased like an instruction.

This is the trust boundary this course keeps returning to: the model's own reasoning loop is a trusted execution environment, but a large fraction of what feeds into that loop is untrusted content the model reads rather than the developer's own words. A support agent that retrieves a customer's past ticket to summarize it is reading untrusted text; a research agent that fetches a webpage is reading untrusted text; a coding agent that reads a file from a cloned repository is reading untrusted text. None of that content went through the scrutiny the system prompt did, and all of it lands in the same context the system prompt occupies.

Understanding exactly why this boundary is architectural, not a bug someone forgot to patch, is what makes the defenses in Lessons 3, 4, and 6 make sense rather than feel like arbitrary extra work — they exist because there is no simpler fix available.

Analogy🏏Cricket
🏏 Think of it like cricket: A dressing room operates on a single channel of trusted instruction: the captain and coach relay the game plan, and every player on the field executes what that channel says. Now imagine a scenario where a message smuggled in from outside — a fake note passed to a fielder claiming to be from the coach, asking him to switch position — would be executed exactly like a real one, because the fielder has no way to tell a genuine dressing-room instruction from a forged one once it reaches him on the field. A team that discovered this the hard way, would not fix it by telling players to 'be more careful' — the fix has to change how instructions are verified, not just hope the next fielder is more suspicious. Just as the fielder has no built-in way to distinguish a genuine dressing-room note from a forged one once it reaches him, a model has no built-in way to distinguish a genuine developer instruction from user or document text phrased like one once it reaches the context window. Just as the fix for the fielder problem is a verification mechanism, not a plea for more caution, the fix for the model's problem is a structural guardrail, not a plea for the model to try harder. The insight is that a channel with no way to verify a message's source will eventually execute a message that was never meant to carry authority.
Lesson 3 of 35
0% complete