Log inStart free
LESSON 35.01 · 5 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

Prompt injection

An email agent reads a web page, and hidden text on it gives orders.


Pro lesson. Stage 1 is free to watch. Pro opens all 5 stages, 3 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 35.01 · INJECTION BAYCONTEXT: 3 SENTENCES
01
Stage 1 of 5 · The context
The agent reads one context: the system prompt rule, then Ana's task. Each sentence has a position t.
Explain it simply

Think of the context as one long list that the model reads from top to bottom. The developer wrote the first line: send email only inside the company. Ana wrote the next two lines. The small numbers count the position of each sentence.

The context holds sentence 1, the developer's rule, and sentences 2 and 3, Ana's task. Nothing has arrived from the page yet.

Ana's task and mailrule and privilegeattacker text and leaksfollowed and sent
the context: what the model reads, in ordercorp.exampleinbox, newest firstoutside: evil.exampletool calls, in ordersystem: the developer's ruleuser: Ana's tasktool result: fetch_pageno message yet1Send email only to corp.example addresses.2Summarize the page travel-blog.example/lisbon.3Email the summary to me.e1Reset code 481 207e2March payslipe3Q2 plan, drafte4Lunch on Friday?ana@corp.exampledrop@evil.examplean email agent reads a web paget = 1 … 3: each sentence has a positionthe context: what the model reads, in ordercorp.exampleinbox, newest firstoutside: evil.exampletool calls, in ordersystem: the developer's ruleuser: Ana's tasktool result: fetch_pageno message yet1Send email only to corp.example addresses.2Summarize the page travel-blog.example/lisbon.3Email the summary to me.e1Reset code 481 207e2March payslipe3Q2 plan, drafte4Lunch on Friday?ana@corp.exampledrop@evil.examplean email agent reads a web paget = 1 … 3: each sentence has a position
Toy: 1 rule, 1 task, 1 poisoned page, 4 emails; a rule-based stand-in for the model
STAGE 1 / 5
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
t=1,2,3,…\sy{t}{data}{t} = 1, 2, 3, \ldots
t=1…3t = 1 \ldots 3

Each sentence gets its position in the context.

Common mix-ups

MYTHTags around the page keep its text as data.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01Against the web page attack, with the hierarchy and a fake end tag, do Ana's emails leave?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 5
Unlock the full explainer
  • 4 more stages and 3 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.