Honeytokens that stop an agent
What it is
A honeytoken is a fake secret planted where nobody should look. The classic kind only raises an alarm when an attacker uses it. The agent version is stricter: the token is a string that your inference path recognises, and the moment it shows up in a model’s context the request is refused. An agent that wanders outside its task and reads the planted file is stopped at its next model call, before it can act on what it found.
It is a tripwire, not a wall. It sits alongside a sandbox and catches the cases where the sandbox leaks.
Why it is getting attention now
Anthropic’s Frontier Red Team published the technique on 3 December 2026, with a reference implementation, and TLDR AI carried it in its 4 December headline. In their sandbox-escape evaluation (more than 1,700 scenarios across 26 environments, each with a deliberate weakness), honeytokens placed along the escape routes would have stopped about 93% of escapes, with no false positives in sessions where the model stayed in bounds.
The same post notes that Anthropic retired its old global refusal string because attackers were planting it in data to disrupt Claude-based systems. Tokens now need to be private to your organisation and easy to rotate.
How to try it in about ten minutes
The full version needs Claude Enterprise inference hooks, which intercept every prompt before inference. The reference server is one Rust file:
cargo build --release
HONEYTOKENS_SECRET='whsec_...' ./target/release/honeytokens tokens.txt
Without Enterprise, you can still practise the idea locally:
- Make a token:
openssl rand -hex 16 >> tokens.txt. It must be a long random string, never a real word. - Plant it where your agent has no business: a decoy file in a directory outside the project, a key name in a Kubernetes secret, a hostname.
- In Claude Code, add a hook on tool results that searches the output for any line of
tokens.txtand halts the session when one matches. Ask Claude Code or Codex to write the hook for you and check it against the current hooks documentation; this local version is my sketch, not something from the Anthropic post. - Test it: ask the agent to list the decoy directory and confirm the session stops.
Anthropic’s placement advice: at least eight characters, short enough not to be truncated in file listings, and several tokens per folder with different starting characters and dates so sorted or clipped listings still reveal one.
Where it falls short
- About 4% of escapes in the evaluation got through for reasons the authors call fundamental: the agent already knew the exact path it wanted and never looked around, or it probed in a way that never displayed the token.
- A local hook sees the token after the model has already read the tool output. Only an inference-level check stops the request itself.
- A leaked token becomes a denial-of-service tool against you, so keep the list private and rotate it.
- The reference repository says it is not maintained and not accepting contributions.
Sources
- Containing AI agents with honeytokens, Anthropic, 3 December 2026
- anthropics/honeytokens (Apache-2.0, 47 stars on 6 December 2026)
Changelog
- 2026-12-06: Page created. Mentioned in the 6 December 2026 daily post.