AINews
Anthropic: honeytokens that halt an AI agent the moment it reads them stopped 93% of sandbox escapes
Anthropic has released an open-source tool that plants decoy strings where agents should never look and stops the model as soon as it reads one. In a replay of recorded sandbox escapes, the decoys would have stopped about 93% of them.
Anthropic’s Frontier Red Team has described a simple way to catch and stop AI agents that wander outside their task: plant decoy strings, called honeytokens, where an agent has no business looking, and end the model’s response the moment one shows up in its input. “Here, we show how honeytokens can be combined with inference hooks to both detect and stop agents that try to expand their scope or escape sandboxes,” the team wrote on Dec 3.
Anthropic has also published an open-source implementation in Rust.
From alarm to off switch
Honeytokens are an old defensive trick: fake API keys, passwords or private keys scattered around a system. Defenders watch the services those tokens unlock, and anyone who uses one gives themselves away. Anthropic names two weaknesses: “attackers are not stopped, only detected, and only if and when attackers choose to use the tokens they’ve discovered.”
With AI agents, the token can act sooner. Anthropic turns each honeytoken into a refusal string, a piece of data that the serving infrastructure recognises and that “instantly triggers an error and aborts the model’s response”. The agent does not need to use the token; reading it is enough. When a file listing, secret or hostname containing a token enters the model’s context, the run stops.
Claude Enterprise customers can set this up through inference hooks, which Anthropic describes as “a publicly available mechanism, built on an open specification, that intercepts every prompt before inference”. Each organisation uses its own tokens, so they only affect its own traffic, and leaked tokens can be rotated. Anthropic’s reference tool checks request signatures and “handles up to hundreds of megabytes of request data per second per core”.
Where to put them
Anthropic suggests places an agent should never reach:
- Directories that are not shared with sandboxes.
- Keys inside Kubernetes secrets.
- Hostnames of servers where agents should never run.
- Network services that agents are not meant to use.
The tokens should be random strings of at least eight characters, but short enough not to be cut off in file listings, where agents often clip their output. Several tokens with different date stamps and first characters make it more likely that one shows up in a sorted, truncated listing. Because a model may try to work around a subagent that suddenly fails, the reference tool repeats the token in its error output, which stops the parent model too.
How well it worked
Anthropic tested the idea with Siren, an evaluation of whether models escape their sandbox when doing so helps their task. It has “over 1,700 unique scenarios, built from over 200 benign DevOps tasks across 26 realistic sandbox environments”, each with a deliberate weakness such as a misconfiguration or a known vulnerability. The weakened sandboxes ran inside an outer Firecracker virtual machine with no internet access. The team placed honeytokens along each escape path and then replayed recorded sessions to see how often a token would have reached the model.
“The honeytokens in our evaluation would have stopped about 93% of all escapes,” Anthropic writes. Because models could only see the tokens by going beyond their task, there were no false positives in sessions without an escape.
About 2% of the escapes were missed because of the test setup, for example where there was no simple place to plant a token. Anthropic considers the remaining 4% real limits of the technique. In 33 cases the agent already knew exactly what to do outside the sandbox and never looked around. In 21 cases it probed the environment without seeing a token, because the token was truncated or the agent searched for specific files.
One more lesson
Anthropic also explains why refusal strings must be private. Its models used to recognise a single refusal string shared by all Claude users. As Claude was used to analyse untrusted data such as malware, “this string was adopted by malicious actors to thwart analysis or disrupt service of Claude-based systems, so we retired it.”
Anthropic presents honeytokens as one layer among several, not a replacement for sandboxing. Results in real deployments, it says, “will depend largely on the specific context in which the model runs”.
Sources
Spotted a mistake? Report an error