█

AI/TLDR

Buy me a coffee
Buy me a coffee

honeytokens

Anthropic's reference server that blocks Claude requests containing your planted fake secrets

Guardrails & SecurityOpen source
Updated
3 Dec 2026
Language
Rust
License
Apache-2.0
Coverage
1 story

What's new

3 Dec 2026

Anthropic's Frontier Red Team published the honeytokens research and released this reference server; replayed against its Siren evaluation, honeytokens would have stopped 93% of sandbox escapes.

Latest news

IN SHORT

What is honeytokens?

honeytokens is a reference honeytoken server for Claude's Inference hooks API, published by Anthropic. A honeytoken is a random string you plant where an agent should never look: an unshared folder, a Kubernetes secret, a restricted hostname or an internal service. It sits in the Guardrails & Security category of the Evaluation & Production Ops tools and is open-source, written in Rust and licensed Apache-2.0.

Updated Markdown version ↗

Overview

Five-step diagram of a Claude Code request passing through Anthropic's API to a honeytoken server that answers allow or deny, ending in 'request blocked'
How a request flows through inference hooks to the honeytoken server.Anthropic ↗

honeytokens is a reference honeytoken server for Claude's Inference hooks API, published by Anthropic. A honeytoken is a random string you plant where an agent should never look: an unshared folder, a Kubernetes secret, a restricted hostname or an internal service. Before Claude sees a governed request, Anthropic sends the transcript to this server. If it contains any string from your token list, the server replies `deny` and the request is blocked; otherwise it replies `allow`. Because the check runs on what the model is about to read, the agent is stopped the moment it reads a token, not only when it tries to use it.

Anthropic's Frontier Red Team released it with a December 2026 research post that replayed the idea against its Siren sandbox-escape evaluation: of 1,294 escapes across 1,753 sessions, honeytokens would have stopped 1,209 (93%), with no false positives in sessions where the model stayed inside. The server itself is about 400 lines of Rust with five dependencies and no async runtime, checks the signature on every request, and is released under the Apache-2.0 license. Anthropic marks it as a reference implementation that is not maintained and does not accept contributions.

What it does

  • Exact, case-sensitive matching of a list of planted tokens against each governed Claude transcript, answering `allow` or `deny`
  • Mandatory webhook signature check with the `whsec_...` secret from the Inference hooks settings, including two secrets at once for rotation
  • Configurable concurrency (`HONEYTOKENS_THREADS`, default 16) with request bodies up to 64 MiB
  • `--no-echo-token` to hide the matched token from the user-visible deny reason
  • Logs one line per connection and never logs token values or transcript contents

Getting started

honeytokens needs Rust 1.75 or newer and a Claude organization with Inference hooks turned on. Anthropic only calls public `https://` URLs on port 443, so the server runs behind a TLS proxy.

Create a tokens file

One token per line, 8 to 256 printable ASCII characters, no spaces. Blank lines and lines starting with `#` are ignored. Use long random strings and plant the same strings where agents should never look.

bashbash
openssl rand -hex 16 >> tokens.txt

Build and run the server

`HONEYTOKENS_SECRET` is the signing secret shown when you save the endpoint in the Inference hooks settings. The default listen address is `127.0.0.1:8000`; pass another as a second argument. Run the tests with `cargo test`.

bashbash
cargo build --release
HONEYTOKENS_SECRET='whsec_...' ./target/release/honeytokens tokens.txt

Put TLS in front and allow only Anthropic

The server speaks plain HTTP. The README's Caddy example terminates TLS and rejects every caller outside Anthropic's range `160.79.106.0/24`; the signature check stays on regardless.

texttext
hooks.example.com {
    @others not remote_ip 160.79.106.0/24
    respond @others 403
    reverse_proxy 127.0.0.1:8000
}

Turn it on in Claude

In Organization settings → Data and privacy → Inference hooks, allow hooks for your organization, save the endpoint URL, press "Test connection" to see an allow verdict, then turn on "Enforce verdicts".

Commands and code are distilled from the project's own documentation — always check the official repo for the latest.

When to use it

Diagram of a sandboxed Claude with an over-scoped service account reading a Kubernetes secret full of honeytokens, and the next request being denied
Honeytokens stored in a Kubernetes secret catch an agent that reaches beyond its scope.Anthropic ↗
  • Plant fake credentials in Kubernetes secrets, unshared directories or config files so an agent that reaches beyond its scope is blocked as soon as it reads them
  • Add a cheap tripwire on top of a coding-agent sandbox that may be weaker than it looks
  • Use it as a starting point for an in-house Inference hooks server with your own allow/deny rules

How honeytokens compares

honeytokens alongside other open-source guardrails & security tools AI/TLDR tracks, ranked by GitHub stars.

ToolStarsWhat it does
SkillSpector★ 28.8kSecurity scanner for AI agent skills that checks a skill for prompt injection, data exfiltration, privilege escalation and supply-chain risks before you install it.
Presidio★ 12.2kAn open-source framework for detecting, redacting, masking, and anonymizing personal data (PII) across text, images, and structured data using NER models, regex, and rule-based recognizers.
Failproof AI★ 10.5kA hook-based CLI and Rust daemon that listens to every event from 12 agent harnesses such as Claude Code, Codex and Cursor, and blocks, warns or steers the agent with one policy API, with optional cloud tracing and failure audits.
BLA (Blind LLM Agents)★ 8kAn open-source CLI and MCP server that hardens the apps, WASM modules, databases and model files you ship so AI reverse-engineering agents such as REA hit resource budgets and follow decoys, without changing runtime behaviour.
Guardrails AI★ 7.7kA Python framework that wraps LLM calls with composable input/output validators (from the Guardrails Hub) to check structure, type, and safety risks before responses reach users.
NeMo Guardrails★ 7.6kNVIDIA's toolkit for adding programmable rails to LLM chat apps, using the Colang language to control dialog flow and block jailbreaks, prompt injection, and off-topic answers.
dcg (Destructive Command Guard)★ 6.4kA Rust pre-tool hook for coding agents that inspects each shell or git command before it runs and blocks the destructive ones, with an explanation and a safer alternative.
honeytokens—Anthropic's reference server that blocks Claude requests containing your planted fake secrets