Technical brief: Instructions Are Data

Rez Khan, PhD · Advance Review Edition · doctorkhan.github.io/instructions-are-data · Sample chapters on request

Two pages for an engineer or security reviewer who wants the argument before the manuscript.

Thesis

Agent security is classic security reappearing in systems where the program is natural language and any text an agent reads may act as an instruction. Multi-agent systems add a second problem: agents trust each other, and nothing in the stack verifies that trust.

The stance follows. Assume any agent that reads untrusted content can be fully controlled by the author of that content. Then design the system so that the outcome is acceptable. The book does not rely on the model resisting injection. It asks what the surrounding system lets a steered model do.

Five ideas the book rests on

  1. Gates and guardrails are counted separately. A guardrail, such as a prompt instruction, a delimiter, or a classifier, lowers the rate of successful attacks. A gate is enforced by the harness whatever the model has been persuaded of: a permission, an approval, an egress rule. A gate must be checked when the action executes and on every route to it. A path that passes through a filter is still a path.
  2. Source-to-sink tracing. List every place untrusted text enters a context (sources) and every consequential action or outbound channel (sinks). Trace the paths between them, including paths through memory, stores, and other agents. Rate each path by data exposed, authority spent, and reversibility. Then cut it, gate it, or accept it with a stated bound and owner. Likelihood is assumed, not rated.
  3. The lethal trifecta. Private data, untrusted content, and an outbound channel in one agent or one reachable path is the dangerous combination. The term is Simon Willison’s. Exposure tracking in the harness keeps any session that has read untrusted content from reaching both of the others.
  4. Delegation is attenuated at every hop. A request between agents carries a signed grant from the platform, naming the original principal. Each hop can only intersect the grant’s scope, set its exposure flag, and move its expiry earlier. The attack that moves from a support ticket to a change of vendor bank details fails because the customer’s original grant never contained that operation, and no agent can add it.
  5. Untrusted content crosses into privileged code only as typed values. A quarantined reader extracts fields with narrow types. The privileged side never sees the prose. The attacker can still choose among values the types allow, and the book bounds how much that choice can carry.

A worked example

At LindenPay, the support agent reads customer tickets and can message the finance agent over an internal bus. The finance agent can update vendor records. The bus accepts any message on the internal network, and a delegated request runs with the receiver’s full tools. So a ticket that persuades the support agent to send one message can change where a vendor’s payments go. That path is rated Critical: the data is sensitive, the authority is far beyond the task, and the money may not come back.

The book tries five partial fixes first: authenticating the bus, restricting who may message the finance agent (first in the prompt, then in the harness), confirming with the sender, a reviewer agent, and a cap on messages. Each shows why a single-layer fix shifts the problem. The fix that holds has three parts. Requests between agents become typed, so there is no field for prose. Every request carries a grant whose scope began with the customer. Vendor changes are held for a person, who reviews a screen drawn from the systems of record. What remains is recorded too: a well-formed but false business request still reaches the workflow that judges it.

What is proved, and what is not

Appendix D states the core rules as theorems over a small model in which the language model is an arbitrary function of what it has read. The main results are checked in Lean 4, the appendix lists exactly which, and the axiom report shows only Lean’s standard axioms. They include:

The proofs do not say how often a model is steered; that is measured, not proved. They assume the labels on sources are correct and that the harness checks every action when it runs. The appendix lists each assumption, and a table maps each to the code that must meet it.

Status

The draft is complete across seventeen chapters and three appendices. Part II labs exist, and Part III labs are in progress. Every measured rate in the text is marked pending until the experiments run under a fixed protocol: number of runs, model, date, and a success criterion read from what the platform did. Facts about real incidents are being checked to primary sources, and those still open are marked in the text.

Topics I am glad to go deep on