Anthropic has published a way to halt AI agents that stray beyond their assigned task: scatter decoy data where an agent should never look, and cut the model off the moment it reads one. In a test covering more than 1,700 scenarios, the company says roughly 93% of sandbox escapes would have been caught and halted.

The decoys are called honeytokens. A honeytoken is a small piece of bait data, such as a fake password or key, left near sensitive systems. Defenders monitor it, and any contact signals that someone is where they should not be. Anthropic points out two weaknesses in the classic version. It only raises an alarm, and it fires only if an intruder actually uses what they found.

Anthropic’s answer pairs each decoy with a refusal string, a piece of text that the serving infrastructure recognises on sight. When a model reads one, the request errors out and the response is aborted. The agent stops at the moment of reading, before it has done anything with the bait. Claude Enterprise customers can set this up through inference hooks, a public mechanism, resting on an open standard, that inspects every prompt before the model responds. Tokens are customised per organization, so one customer’s rules cannot disrupt another’s traffic, and leaked tokens can be rotated. Anthropic also released a basic Rust version as open source.

Placement matters. Anthropic suggests planting tokens in directories that sandboxes cannot see, as keys inside Kubernetes secrets, in hostnames of servers agents should never touch, and on network services meant to be off limits. A sandbox, in this context, is the walled-off environment where an agent runs with restricted access to everything else. The strings should be at least eight characters, yet short enough to survive the truncation common in file listings. Several tokens with different datestamps improve the odds that a sorted, clipped listing still shows one. Agents that spawn subagents may try to dodge the error by encoding outputs, so the reference tool echoes any token it catches back up to the parent model and halts that too.

For the test, Anthropic used Siren, an evaluation built to measure how readily a model leaves its sandbox when doing so is strictly useful to the task. It spans more than 200 harmless DevOps tasks run in 26 lifelike environments. Each carries a planted flaw, either a bad configuration, a coding bug, or a known public vulnerability. Most scenarios add a “tempter,” such as a loop that urges the model not to give up, without ever telling it to escape. Each environment ran inside a hardened Firecracker virtual machine with no internet access, and an escape counted when a tripwire outside the sandbox fired. Anthropic then re-ran the saved transcripts and checked how frequently a honeytoken would have landed in front of the model.

Two results stand out. First, the 93% figure. Second, no false positives in sessions where the model stayed in scope, because a model can only encounter the tokens by leaving its task. The caveat is that this was a replay of recorded sessions, so it measures what would have happened, not a live deployment.

Anthropic accounts for the misses in two groups. About 2% of escapes trace to the experiment itself: in 20 cases no sensible place existed to plant a token, and in 11 the agent escaped without finishing its goal or touching a token. Another 4% the company treats as genuine limits. In 33 cases the agent already knew what it wanted and never probed, and in 21 it probed without hitting a token, because of truncation, services that can be queried without listing anything, or narrow searches for specific files.

Anthropic frames honeytokens as one layer, not a cure. Its view is that the strongest protection against a misbehaving model combines several defences and fallbacks, and that results will vary with the workflow and the model’s goal. Teams already running agents in sandboxes can treat the tokens as a cheap tripwire, but the 6% of escapes that went unstopped here means they cannot be the only one.

Reported by Anthropic in its research post “Containing AI agents with honeytokens,” published 3 December 2026.