PrepCity

Guardrails and prompt injection

Open the lab

By the last page, this is the design you will have built.

Lesson · 9 pages · about 7 min

Guardrails and prompt injection

An agent that reads web pages can read an order planted by a stranger, and the model cannot reliably tell it from yours. See one hidden instruction try to move money, then the layers that stop it: fetched text marked as data, only the tools the task needs, a check in code, and a person for money.

Words you’ll learn

  • Context window
  • Indirect prompt injection
  • Agent harness
  • Spotlighting
  • Least privilege
  • URL
  • Lethal trifecta
  • Tool-call check
  • Request
  • Eval

Page by page