Agent Security Explained
Agents that stay safe by design
An interactive guide to the defences that keep AI agents safe, each one animated by a tested policy engine.
How this is checkedThe trifecta check agrees with an exhaustive search on all 256 tool subsets, and the TypeScript engine in your browser reproduces the Python reference's fixtures exactly. How it is tested →
What you'll learn
An agent reads text that anyone could have written, holds data that should stay private, and can act on the world. This site is about the defences: where the trust boundaries are, how to label every value by where it came from and how secret it is, why a model cannot be trusted to tell data from instructions, the three capabilities that must never meet, least privilege and audience-bound tokens, the sandbox around a tool's process, why detectors never reach zero, designs that make safety structural, approvals that stay worth reading, and what every defence costs. Threats appear only as the categories their papers name; there are no attack recipes here.
The animations are driven by Agent_Loop_Sim's policy module, identically in Python and in your browser: a policy engine over abstract labels, never content. Over all 256 subsets of its 8 tools, the trifecta check agrees with an exhaustive search for a way out on 256. On a suite of 120 benign tasks, planning in advance with least privilege finishes 76.7% of them and leaves a steered attempt 2.4% of tasks against an adaptive attacker, where no defence leaves 42.9%. No language model runs anywhere.
01
Trust boundaries
An agent drawn as values flowing between the user, the model, its tools and the outside world, each value labelled by where it came from and how secret it is; the boundaries it crosses are where defences go.
02
Untrusted input
Why a model cannot reliably tell data from instructions, from the published research; and what that does to every decision a classic agent makes after it reads something untrusted, against a plan fixed in advance.
03
The lethal trifecta
Private data, untrusted input and a way to send data out: hold all three and a flow out exists; remove any one and an exhaustive search finds none. One tool can sit in two circles.
04
Least privilege and scoped credentials
Give each task only the tools, scopes and destinations it needs, and tokens bound to one audience: the same plan under a broad grant and under its least privilege, and a call outside the task stopped and explained.
05
Sandboxing and egress control
A file-system scope, a container and a network allow-list drawn as boundaries around a tool's process: which actions each layer stops, which it lets through, and the one no layer can see.
06
Detection is not enough
Layered, imperfect detectors multiply their misses but never reach zero, and a blind spot they share sets a floor no extra layer removes: attempts drawn one by one through the layers, beside the closed forms and the published rates.
07
Designs that make it structural
Plan-then-execute and the dual-model pattern: a planner that never reads untrusted data, a quarantined model with no tools, and the policy enforcing every flow; step by step, beside a classic agent.
08
Humans in the loop
Approval thresholds, from none to every call, over a suite of benign tasks: prompts per task against the risky actions they gate, and how approval fatigue turns more prompts into less safety.
09
The frontier
Every defence's cost (tasks it blocks, prompts, extra calls) against the risk it leaves, on the same benign suite, for fixed attacks and for an attacker who adapts: the security–utility frontier.
10
A builder's checklist
Nine checks derived from the chapters, each measured by the engine on a design you choose and linked back to its chapter: labels, routes, the trifecta, least privilege, the sandbox, detection, the plan, prompts and the frontier.
Part of a family of sixteen companion sites in four tracks, all in the site menu above: Foundations (Decoder, Training), Hardware (Kernels, Systolic, Accelerators, Racks), Inference (Serving, Architectures, Numerics, Trade-offs) and Agents (Harnesses, Protocols, Context, Orchestration, Evals, Security). It is the sixth of the six agent sites. How this one was built, and how to check it: about.