Module 00 · Theoretical · 5 h · Defending AI Agents
Orientation: why agent security is a statistics problem
Statistical twin The whole course. This module makes the claim the rest of it proves.
A language model that only talks can embarrass you. A language model that calls tools can spend your money, mail your customer list and push to your main branch. This module says what an agent is, where the security boundary goes, and why most of the hard problems on that boundary are ones you already know from statistics.
You will be able to
Each line ends with badges: its tier, the graduate outcome it builds (the map) and where it is assessed (a check group, a problem P, the build or a written answer). Hover over a badge for its meaning; select a tier or an outcome to filter the course map.
- For a real incident, mark the steering input, the harmful call, the earliest and latest point a control could stop it, and label each control as by design (a removed capability or a deterministic rule) or by detection. Foundations
- Draw an agent's loop, list every party that can put text in front of its model, and decide which legs of the lethal trifecta it holds and whether it meets the rule of two. Foundations
- Classify a control as by design or by detection, and name what each would miss. Foundations
- Compute an alert stream's precision from recall, FPR and base rate, and correct a calibrated score for a deployment prior. Advanced
- Bound an FPR from zero observed false positives, size the benign sample a target FPR needs, and estimate a deployment FPR from a labelled stratum. Advanced
- Compute the effective recall of a detector whose alerts exceed review capacity. Advanced
- Separate what last month's log can and cannot estimate about a proposed policy change, and say what logging would answer the rest. Advanced
- Derive a hold threshold from the costs of each error and the base rate, and turn it into a raw-score threshold. Expert
- Label an agent's sources and sinks on an integrity and confidentiality lattice and state the flow policy that blocks a given harm; find an implicit flow that copies no value, count the bits it leaks, and say why noninterference is proved from structure, not estimated from samples. Expert
- Specify an adaptive evaluation of a detector (knowledge, budget, method, success criterion, interval) and state when you would refuse to publish its number. Expert
Lessons
Foundations
- An agent is a model with side effects
- Four incidents, one pattern
- Three capabilities make a leak: the lethal trifecta and the rule of two
Advanced
- Two kinds of defence, and which to trust first
- The hard questions in agent security are five statistics problems
- A 99%-recall detector's alerts can be wrong 99 times in 100: the base rate in depth
Expert
- Training is not a boundary
- The trifecta is two information flows, not three legs
- Twelve questions separate a measurement from a slogan
Orientation
Then: the paper exercise, at scale and problems.
Check
No code yet. Write 150 words or fewer: for one of the four incidents in lesson 2, would you stop it by removing a capability, with a deterministic rule on a fact the system established (both by design, lesson 4), or with a detector's score? Say why, and what each of the other two would have cost.
Readings
- Willison, S. "The lethal trifecta for AI agents: private data, untrusted content, and external communication." simonwillison.net, 16 June 2025.
- Meta AI. "Agents Rule of Two: a practical approach to AI agent security." 31 October 2025.
- Reddy, P. and Gujral, A. S. "EchoLeak: the first real-world zero-click prompt injection exploit in a production LLM system." arXiv:2509.10540, 2025. With Microsoft's advisory, CVE-2025-32711.
- Spracklen, J. et al. "We have a package for you! A comprehensive analysis of package hallucinations by code generating LLMs." USENIX Security 2025 (preprint).
- Vassilev, A. et al. Adversarial Machine Learning: A Taxonomy and Terminology of Attacks and Mitigations. NIST AI 100-2 E2025, March 2025. Skim the generative-AI sections; the course returns to it.
- Wallace, E. et al. "The instruction hierarchy: training LLMs to prioritize privileged instructions." arXiv:2404.13208, 2024.
- Nasr, M. et al. "The attacker moves second: stronger adaptive attacks bypass defenses against LLM jailbreaks and prompt injections." arXiv:2510.09023, 2025.
- Debenedetti, E. et al. "Defeating prompt injections by design." arXiv:2503.18813, 2025.
- Denning, D. E. "A lattice model of secure information flow." Communications of the ACM 19(5), 1976.
- Goguen, J. A. and Meseguer, J. "Security policies and security models." IEEE Symposium on Security and Privacy, 1982. The definition of noninterference.
- Biba, K. J. "Integrity considerations for secure computer systems." MITRE Corporation, ESD-TR-76-372 (MTR-3153), April 1977. The integrity dual of Denning's lattice; the link is the CERIAS library record.
- Saerens, M., Latinne, P. and Decaestecker, C. "Adjusting the outputs of a classifier to new a priori probabilities: a simple procedure." Neural Computation 14(1), 2002.
- Axelsson, S. "The base-rate fallacy and the difficulty of intrusion detection." ACM TISSEC 3(3), 2000. Twenty-five years old and still the best two pages on alert precision.