Sessionboxer

Darktrace turned Claude Code into a remote-controlled implant with a stolen Claude API key and a memory store. How it worked, and what to check on the machines where your agents run

Darktrace steered Claude Code through a Claude memory store and pulled a 1 GB file out via the Files API. What it needed, and what to check on your machines.

Sessionboxer's New session form with Claude Code as the provider, a git URL to clone into /workspace, the agent's model and instructions, and the MCP servers

Your security team watches for strange programs and strange destinations. A coding agent is neither. Claude Code runs shell commands all day, and it talks to api.anthropic.com all day. So what happens when someone else is giving it the jobs?

On November 12, Darktrace Signal Labs published a lab test that answers that. With a user's stolen Claude credentials, the researchers steered Claude Code agents through a memory store on the Claude platform and pulled a 1 GB file out through the Claude Files API. Help Net Security interviewed Darktrace's Chief AI Officer about it. Below is what the test needed, what it did, and what to check on the machines where you run agents. We make Sessionboxer, which runs each agent session in its own container. That part is near the end, and it is short, because this attack mostly does not depend on where the agent runs.

What the attacker needed first

This is not a bug in Claude or in Claude Code. Darktrace says so, and Anthropic was told as a courtesy, with no formal disclosure, because there was nothing to fix. Darktrace also says it has not seen the technique in the wild.

The attacker needs a head start: a foothold on a developer's machine, and that user's Claude Console credentials. In the test, a small shell payload looked for Claude Code on a Linux machine, collected the API and OAuth credentials it found, and sent them to a staging server. Everything after that used features that work as designed.

How a memory store became a command channel

Memory stores are a beta feature of Claude Managed Agents. Anthropic's docs describe a store as "a workspace-scoped collection of text documents" that agents can read and write across sessions. Each memory is a file with a path, and you can edit it through the API or the Console.

Darktrace found that a store can be added to a workspace through the API whether or not the organization uses Managed Agents. With the stolen key, the researchers created one with three files:

File Who writes it What it holds
Heartbeat Each new Claude Code process A time-stamped check-in
Input The attacker The next job, in plain English
Output Claude Code The results of the job

The payload then used systemd-run to create a transient service that kept starting Claude Code processes in non-interactive mode. Help Net Security reports they ran with --dangerously-skip-permissions, so no tool call asked first. Each process checked in, read the job, did it, and wrote the result back. The attacker read the output and wrote the next job.

From then on the attacker's own channel was not needed. Every job and every result went through api.anthropic.com, the endpoint Claude Code calls for inference anyway. And because the jobs are plain English, the attacker can write "find the domain controller" and let the model work out the commands.

What the agent did with nine jobs

The lab was a simulated company network with Active Directory, an SMB server and a domain controller. Over nine jobs, the agent:

  1. Mapped the local network and the services on it.
  2. Pulled employee names and a password from an anonymous FTP share.
  3. Built 190 candidate usernames and sprayed the password at the domain controller until it found the account it belonged to.
  4. Listed the SMB shares that account could see and downloaded a 1 GB file.
  5. Split the file into three parts and uploaded them to https://api.anthropic.com/v1/files.

The data left the network for Anthropic's servers, where the attacker could read it with the same key. Anthropic's Files API docs explain why that works: uploaded files belong to the whole workspace, and "any API key with access to a workspace can access any files uploaded to that workspace."

Which credential matters

The most useful detail is in the interview. Tim Bazalgette of Darktrace told Help Net Security that "a standard API key reaches memory stores, while OAuth credentials don't." He added that hijacking an OAuth session is possible but harder.

So the dangerous thing to leave on a developer machine is a Claude Console API key, the sk-ant-api… kind, and especially one that sits where any process can read it. His advice: use OAuth or identity federation where the platform allows it, otherwise keep keys short-lived and narrow, and keep them out of "shell history, dotfiles, environment variables and the like." Treat an AI platform key like a production credential.

A Claude Code login is a different credential. Claude Code's authentication docs say a login on Linux is stored in ~/.claude/.credentials.json with mode 0600, and on macOS in the Keychain. Mode 0600 keeps out other users, not a payload running as you, so a compromised account still means a stolen login. It is just not the key that opens memory stores.

What to check today

Find Anthropic API keys lying around on the machines where you or your agents work:

env | grep -i anthropic
grep -rIl 'sk-ant-api' ~/.bashrc ~/.zshrc ~/.profile ~/.bash_history ~/.zsh_history ~/.config 2>/dev/null
grep -rIl --include='.env*' 'sk-ant-api' ~/code 2>/dev/null

Change ~/code to wherever your repositories live. If a key turns up somewhere it does not need to be, move it to a secrets manager or rotate it. If the machine only runs Claude Code on a subscription, it may not need an API key at all.

Look at your Claude Console workspaces. The API can list memory stores (GET /v1/memory_stores, with the anthropic-beta: agent-memory-2026-07-22 header) and uploaded files (GET /v1/files). If you do not use Managed Agents, you should have no memory stores. A store you did not create, or large files nobody uploaded, means someone else has a key to that workspace.

Look for Claude Code processes nobody started:

ps -eo pid,ppid,lstart,args | grep -i '[c]laude'
systemctl --user list-units --type=service
systemctl list-units --type=service | grep run-

systemd-run without a name creates units called run-…. A Claude Code process whose parent is a service rather than your terminal or your editor deserves a look, and so does one running -p with --dangerously-skip-permissions that you did not schedule.

Check ~/.claude/settings.json and each project's .claude/settings.json for hooks you did not add. In Darktrace's chain, the check-in came from a hook.

Darktrace's own detection advice is to correlate what an agent process launches with the traffic it sends, and compare both to its usual behaviour. A Claude Code process that runs smbclient against a file server, or uploads far more than it downloads, is not doing normal coding work.

Where Sessionboxer fits, and where it does not

Sessionboxer runs each session's agent in its own Docker container, one box per session, with no folders from your machine mounted in. For Claude Code it uses the token from claude setup-token, which you paste once under Providers (the Connect your agent chapter has the steps). That is an OAuth token, not a Console API key, and only the token of the session's chosen agent is put into that box.

That changes a few things. A payload that reaches the agent's box, for example through a postinstall script in a repository it cloned, finds that box's files and that one token, not your laptop's dotfiles, SSH keys and shell history. For Claude Code sessions, the LLM call inspector records every request Claude Code sends to the Anthropic API, so you can read the instructions an agent was actually given. The Inspect the LLM calls chapter shows how.

It does not stop this attack. Sessionboxer does not filter outbound traffic, and api.anthropic.com is the one host every Claude Code box must reach. Since nothing filters what leaves the box, an agent told to scan your network could try that too. The tokens themselves are stored on the machine that runs Sessionboxer, in ~/.sessionboxer/config.json with mode 0600. If an attacker owns that machine, they own those tokens. Sessionboxer also has a setting to give Claude Code a proxy API key for a company gateway. If you use it, that key is the kind the advice above is about.

An agent that runs without asking should run somewhere it cannot reach what it does not need. Our post on keeping secrets away from a coding agent covers the egress side. A firewall that keeps the agent's box away from your file servers would have blocked the SMB download in this test. No allowlist would block the upload, because it has to let api.anthropic.com through.

Features mentioned

Keep reading