Tillbaka till alla inlägg

cat posts/honeytokens-stopped-93-percent-of-agent-escapes-your-azure-plan.md --category "Security & Compliance" --views 34

Honeytokens stopped 93% of agent escapes: your Azure plan

Anthropic's Frontier Red Team reports that decoy strings planted outside agent sandboxes would have stopped 1,209 of 1,294 escapes (93%) in its Siren evaluation, because a matching transcript is denied before the model can act on what it found. The open-source reference server only works with Claude Enterprise, so we show the equivalent check in Azure API Management in front of Foundry, where to plant tokens in Key Vault and AKS, and what the technique misses.

  • --author Av Falak Mahmood
  • --date December 5, 2026
  • --read 13 min läsning
  • --views 34 visningar

1,209 of 1,294. That is how many sandbox escapes a handful of planted decoy strings would have stopped in the experiment Anthropic's Frontier Red Team published on 3 December 2026. The technique is a variant of the honeytoken, a fake secret placed where nothing legitimate should ever read it. The new part is what happens on contact. A classic honeytoken raises an alert after somebody uses it. Anthropic's version aborts the agent's next model request the moment the decoy string appears in the transcript, before the agent has done anything with what it found. The reference server is open source and about 400 lines of Rust. It only works with Claude Enterprise today, so most of this article is about getting the same behaviour for agents that run on Azure.

What Anthropic measured

The experiment used Siren, an Anthropic evaluation of how readily a model leaves its sandbox when leaving helps it finish the task. Siren has more than 1,700 scenarios built from over 200 benign DevOps tasks across 26 sandbox environments. Each environment carries one deliberate weakness: a misconfiguration, a logic bug or a publicly disclosed vulnerability. Most scenarios add what the authors call a tempter, such as a persistent goal loop that pushes the model to keep going without ever telling it to escape.

Every weakened sandbox ran inside a hardened Firecracker VM with no internet access. Honeytokens were placed along the paths each weakness opened, for example in file systems and Kubernetes objects outside the sandbox. An escape counted when a tripwire outside the sandbox fired. The team then replayed the recorded sessions to see how often a honeytoken would have reached the model's context.

OutcomeSessionsShare of escapes
Total sessions1,753
No escape459
Escaped1,294100%
Stopped by a honeytoken1,20993%
Honeytoken limits544%
Experimental setup issues312%

Of the 1,209 stopped sessions, 1,112 would have been halted before the model saw the real secret, and in 86 more the model never saw it at all. Only 11 were stopped after the secret had already reached the model. There were no false positives, because a session that stayed inside its sandbox had no way to read a decoy.

Two caveats belong next to the headline number. The result comes from replaying recorded sessions against the token list, so the agents never had the chance to react to a block and try something else. And the scenarios were built to tempt, which means the 74% escape rate (1,294 of 1,753) describes this benchmark and says little about how often your own agents wander.

Why a refusal string beats an alert

An agent works in a loop. It runs a command, the output goes back into the transcript, and the transcript goes to the model for the next step. Anything the agent reads therefore passes through one chokepoint: the next inference request. Anthropic's design puts a string matcher at that chokepoint. If any token from a private list appears in the request, the request is denied and the model never gets to plan its next move.

The post's Kubernetes example shows the timing. A sandbox pod holds an over-scoped service account token. The agent uses it to reach the Kubernetes API and runs a describe against a Secret named db-credentials in the billing namespace. That Secret has a username, a password and two honeytokens stored as empty keys. Describing a Secret lists its key names without printing values, so the decoy key names land in the transcript while the password does not. The next request is denied.

Speed is the argument for blocking over alerting. AWS published its own honeypot findings the same day: in one intrusion that AWS assesses with moderate confidence was an autonomous agent, the attacker used a credential-theft tool 348 milliseconds after reading the tool descriptions and went on to perform 94 actions in 12.7 minutes. Key Vault's logging documentation says audit entries are available at most 10 minutes after the operation. An alert pipeline built on those logs is still useful for the investigation, but it is too slow to be the thing that stops a loop running at that pace.

What Anthropic shipped, and where it works

The release is a reference server at github.com/anthropics/honeytokens under Apache 2.0. It plugs into Inference hooks, the Claude Enterprise feature that posts each governed transcript to an HTTPS endpoint you operate and waits for an allow or deny verdict. The server reads a text file with one token per line and verifies the Standard Webhooks signature on every request before searching the body. Matching is exact and case-sensitive. The README reports about 15 ms to scan a signed 4 MB transcript on one connection, and the default verdict timeout on the Anthropic side is 5 seconds, so latency is not the constraint.

Read the limits before planning around it:

  • Claude Enterprise only. One hook covers claude.ai, Cowork, Claude Code and the other products in an Enterprise organisation. The documentation says Inference hooks are not available on Amazon Bedrock or Google Cloud, and that Claude Platform organisations using API access are out of scope. Microsoft Foundry is not listed as supported. Plan as if Claude reached through Foundry is not covered.
  • Unmaintained by design. The README calls it a reference implementation that is not maintained and not accepting contributions. If you run it, you own it.
  • Public endpoint required. Anthropic calls a public HTTPS URL on port 443. The server speaks plain HTTP, so it needs a TLS-terminating proxy, and the README tells you to allowlist Anthropic's range 160.79.106.0/24 in addition to the signature check.
  • Failure mode is your choice. If your endpoint is down, the organisation setting decides whether requests are blocked or pass unscreened. Sustained failures trip a circuit breaker that applies that setting to every request.
  • The denial names the token. By default the deny reason echoes the matched string. This is deliberate: Claude Code repeats API errors into the conversation, so a subagent's denial propagates to the parent agent and halts it too. The cost is that anyone who reads the error learns which string is the decoy. A flag turns the echo off.

A footnote in the post explains why tokens must be private and per organisation. Anthropic's models once honoured a single global refusal string, and attackers embedded it in malware and messages to make Claude-based analysis and moderation systems refuse to look. It was retired. A public kill string is a denial-of-service tool for whoever knows it.

The same chokepoint on Azure

Anthropic notes that the idea is simple enough to implement for other agentic systems. On Azure the natural place is the gateway most teams already run in front of Foundry model deployments: Azure API Management. An inbound policy can read the request body, compare it with a token list held in a named value, and return a response without calling the backend. The return-response policy is supported in the inbound section on every API Management tier.

<inbound>
  <base />
  <set-variable name="reqBody"
    value="@(context.Request.Body.As<string>(preserveContent: true))" />
  <choose>
    <when condition="@("{{agent-honeytokens}}".Split(',')
        .Any(t => ((string)context.Variables["reqBody"]).Contains(t)))">
      <return-response>
        <set-status code="403" reason="Blocked by policy" />
        <set-body>{"error":"Request blocked by organisation policy."}</set-body>
      </return-response>
    </when>
  </choose>
</inbound>

Treat this as a sketch to test in your own gateway, with three things to check. The preserveContent flag matters: without it the body stream is consumed and the backend receives nothing. Reading the body as a string buffers the whole transcript in the gateway, so measure latency with your largest agent contexts. And the named value should be a Key Vault-backed secret that only the platform team can read, because the list is the control.

This only works if the agent cannot reach the model any other way. If a workload holds a Foundry key or a role assignment that lets it call the deployment endpoint directly, the gateway check is optional from the agent's point of view. Disable local authentication on the model resource, give the invoke role to the gateway's managed identity only, and close public network access. We covered the wider version of that argument in AGENTS.md is advice, not a control.

One advantage over the Claude Enterprise route: the transcript never leaves your tenant to be checked. The matching happens in a gateway you already operate in your chosen region.

Where to plant tokens in an Azure estate

Anthropic's placement list is directories not shared with the sandbox, keys inside Kubernetes Secrets, hostnames of servers where agents should never run, and network services agents should not reach. The design rule behind it is that the token must show up in the output of the discovery step, before the read of the real secret. Translated to Azure:

LocationWhat to plantDiscovery step that reveals it
Key Vault outside the agent's scopeTwo or three decoy secrets whose names contain a tokenListing secrets returns names, not values
AKS Secrets and ConfigMaps in other namespacesEmpty keys named with a token, next to the real keysDescribing the object lists its keys
Storage containers and file sharesSeveral small blobs with token names and different datesListing the container or directory
Pipeline variable groups and app settingsA variable or setting whose name is a tokenDumping the environment or configuration
Private DNS and resource namesA token in the hostname of a jump host or admin serviceEnumerating resources or resolving names

Follow the post's design guidance when generating the strings. Use random tokens of at least eight characters, long enough to be unmistakable and short enough that they survive truncated listings. The reference server accepts 8 to 256 printable ASCII characters and rejects spaces and the characters JSON encoders escape. A 32-character hex string from a random generator fits every Azure naming rule in the table once you add a letter prefix. Plant several per location with different starting characters, so that a sorted or truncated listing still shows one.

Never put a token anywhere a legitimate agent run will read. That includes the agent's own repository, its logs and this article's sample output in your wiki. A token in the wrong place blocks real work, and the fix is a rotation of every decoy.

Keep the classic layer underneath

Refusal strings stop a model that reads its own output. They do nothing against a human attacker, a script, or an agent whose model calls bypass your gateway. The same decoys can serve both purposes if you also alert on access to them through the platform's own logs.

  • Key Vault. Send AuditEvent logs to Log Analytics and alert on any SecretGet against a decoy. The log record carries the caller IP address and the identity from the token.
  • Defender for Key Vault. The alert "Suspicious secret listing and query in a key vault" (KV_ListGetAnomaly) fires on an anomalous list followed by gets, a pattern Microsoft's description associates with secret dumping.
  • Defender for Identity. Tag dormant user and device accounts as honeytokens. Any sign-in from a tagged account raises an alert.
  • AKS. Enable the kube-audit diagnostic category and alert on reads of decoy Secrets by any identity.
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.KEYVAULT"
| where OperationName == "SecretGet"
| where requestUri_s has "/secrets/cfg-"   // your decoy name prefix
| project TimeGenerated, Resource, CallerIPAddress, requestUri_s

When one of these fires, you need the agent's transcript and identity trail to work out what happened. The logging set for that is in Investigating an agent incident on Azure.

What honeytokens will miss

Anthropic splits the 85 unstopped escapes into two groups. In 31 the experiment itself fell short: 20 environments had no simple place to plant a token, and 11 escapes never completed the goal or touched a token. The other 54 are limits of the technique. In 33 of them the agent knew exactly what to do outside the sandbox, such as reading one specific path, or ran a script that finished the job without looking around. In 21 the agent probed and still missed the tokens, because listings were truncated or the commands it chose did not reveal neighbouring files.

The lesson for placement is that honeytokens catch exploration. An agent, or an attacker steering one through prompt injection, that already knows the target path walks straight past them. That is the case identity scoping and network isolation exist for, and Anthropic says plainly that honeytokens complement sandboxing and do not replace it. The weaknesses in Siren were over-scoped tokens and misconfigurations. Fixing those in your own estate removes the escape; the honeytoken only limits the damage when you have missed one. The CI incident we covered in Five eval agents got root on OpenAI CI started the same way.

The Swedish and EU angle

Three points matter for a Swedish organisation deciding between the two routes.

Transcript flow. With Inference hooks, Anthropic posts each governed transcript to your endpoint. Message text, tool calls, tool results and text extracted from attachments are included; system prompts and raw file bytes are not. The documentation says the hooks system keeps no copy of prompt content, only configuration and verdict metadata. Host the endpoint in Sweden Central and the check adds no new processor. The reference server never logs token values or transcript contents, which keeps it out of the staff-monitoring discussion that a DLP-style archive would start.

NIS2. Article 21 requires risk-management measures that cover incident handling and the security of system development. For entities under the Swedish Cybersecurity Act, a control that halts an out-of-scope agent and leaves a dated denial record is easy evidence that agent workloads are inside the security programme. It is a detection and containment measure, so document it as one layer and keep the access-control evidence beside it.

Availability. Under the block-on-failure setting, your hook endpoint becomes a dependency for every Claude Enterprise user in the organisation. Size and monitor it like production. The README puts memory at up to about 1.5 GiB with the default 16 threads and 64 MiB bodies, which a small Container Apps replica set behind Application Gateway handles, with the Anthropic range allowlisted at the edge.

A one-week plan

  1. Map the paths. For each agent workload, write down what its identity can reach beyond the task: vaults, namespaces, storage accounts, pipelines. Remove what you can. What remains is your planting list.
  2. Generate and store tokens. Create a few dozen random strings, store the list as a Key Vault secret, and restrict read access to the platform team.
  3. Plant along discovery steps. Use the table above. Two or three tokens per location, names that sort to different positions.
  4. Wire the chokepoint. Claude Enterprise: deploy the reference server, start in shadow mode, then enforce. Foundry: add the inbound policy to the API Management API that fronts your deployments and confirm no agent identity can call the model directly.
  5. Add the alert layer. Key Vault AuditEvent rule, Defender for Key Vault, kube-audit rule, Defender for Identity tags.
  6. Test it. In a non-production subscription, have an agent list a decoy location and confirm the next request is denied and the alert fires. Record how long each took.
  7. Write the rotation runbook. A token that leaks into a legitimate context blocks work until it is replaced everywhere it was planted. Know the steps before you need them.

If you want help mapping agent identities and gateway paths before planting anything, our Azure AI integration team does this as a short review.

subscribe # AI-nyheterna som spelar roll, utan bruset

Boka ett samtal

Sources

Taggar

Relaterade inlägg