Instructions Are Data: Systems, Security, and the Boundaries of Code
Rez Khan, PhD · Advance Review Edition · doctorkhan.github.io/instructions-are-data · LinkedIn · GitHub
What it is
A technical book in progress, of about 100,000 words, on securing AI agent systems. These are language models that read email, tickets, web pages, and code, and then act: they send messages, change records, push code, and move money.
The problem it addresses
A language model cannot reliably tell an instruction from a piece of data. Anyone who can put text in front of an agent can try to direct it. Organisations are connecting agents to payment systems, source repositories, and each other faster than the security practice around them is settling.
What the book does
- It gives engineers a method for tracing every route by which outside text can reach an action that matters, and for deciding which routes to cut.
- It attacks a realistic system. LindenPay is a fictional company with five cooperating agents. Part II attacks it the way real incidents have unfolded. Part III hardens it and re-runs each attack.
- It separates controls that hold from controls that help. It distinguishes controls enforced in code around the model from filters and prompt instructions that only lower the odds of an attack.
- It proves its core rules. An appendix states the central rules as theorems, and the main results are checked by machine in the Lean 4 proof assistant, so they do not rest on the author’s care alone.
- It comes with labs. Python labs let a reader run the attacks against the fictional platform and measure how often they succeed.
Skills it demonstrates
| Area | Evidence in the book |
|---|---|
| AI and agent security architecture | Threat model and hardening of a five-agent platform; delegation, isolation, approval, and egress design |
| Threat modeling | An original method, with a worksheet and review checklist (Appendices A and B) |
| Offensive testing | Attack walk-throughs and labs for prompt injection, tool abuse, memory poisoning, agent-to-agent attacks, supply chain, and exfiltration |
| Formal methods | A formal model with machine-checked proofs in Lean 4 |
| Technical communication | A book for working engineers, with each claim labelled as proved, measured, documented, or judged |
Status
All seventeen chapters and three appendices are drafted. The labs for Part II exist, and the labs for Part III are in progress. Measured results are marked as pending until the experiments run. The fact-checking pass is under way.