Part I
The attack surface
Why agents break the old model, how an agent system is built, and a method for tracing untrusted text to consequential actions.

A book in progress by Rez Khan, PhD
Systems, Security, and the Boundaries of Code
A practical guide to building AI agent systems when the model at the centre cannot be trusted to enforce its own boundaries. Agents read email, tickets, web pages, and code, and then they act. Anyone who can put text in front of an agent can try to direct it. This book shows how to design the system around the model so that the outcome stays acceptable when they succeed.
Advance review edition. All seventeen chapters drafted; labs and fact-checking under way.
The argument
A language model reads its operator's rules, its user's request, and a stranger's web page as one stream of text. It has no reliable way to tell an instruction from a piece of data. Agent security is therefore classic security reappearing in a new place: the confused deputy, in-band signaling, and stored cross-site scripting, with an interpreter that reads natural language and takes requests from other agents.
The book does not rely on the model resisting manipulation. It asks what the surrounding system lets a steered model do, and it builds controls that hold whatever the model has been persuaded of.
What you learn
How it works
Part I
Why agents break the old model, how an agent system is built, and a method for tracing untrusted text to consequential actions.
Part II
Prompt injection, tool abuse, memory poisoning, agent against agent, supply chain, and exfiltration, each run against Linden, a fictional five-agent platform, with labs.
Parts III and IV
Least privilege, isolation, identity and delegation, human approval, guardrails, red teaming, observability, and governance, with every attack re-run against the hardened system.
How firmly it is known
An appendix states the book's core rules as theorems over a model in which the language model may do anything at all with what it reads. The main results are checked in the Lean 4 proof assistant.
They say nothing about how often a model is steered. That is measured, in labs that report a rate with the number of runs, the model, and the date. They also assume the harness labels every source correctly and checks every action when it runs. The book lists those assumptions and maps each to the code that must meet it.
Who it is for
Readers should program fluently in Python or TypeScript and know basic security vocabulary. No background in machine learning is needed. By the end, a reader can threat-model a multi-agent system, attack it in a lab, and ship it with controls they can defend.
Advance copies