Researchers at Darktrace have demonstrated a proof-of-concept attack that repurposes Anthropic’s Claude Code agent into a remote-controlled implant for data exfiltration and network reconnaissance. The technique relies on the misuse of legitimate features within the Claude platform rather than exploiting software vulnerabilities. Anthropic has confirmed that the method does not involve a security flaw, and there is no evidence of this activity occurring in the wild.
The attack begins with the compromise of a developer’s workstation to obtain Claude API credentials. In the researchers' simulated environment, these credentials were recovered from local storage where developer tooling had cached them. Once the attacker possesses these keys, they can initiate Claude Code processes on the compromised machine. To facilitate persistent control, the researchers used the --dangerously-skip-permissions flag, which suppresses the standard prompts that typically require user approval for tool execution.
The core of the command-and-control mechanism utilizes the Claude platform's memory stores feature. While these stores are intended to allow agents to retain context across sessions, the researchers discovered that they can be attached to a workspace via the API regardless of whether an organization utilizes Anthropic’s Managed Agents service. By creating a shared memory store, an attacker can establish a communication loop: the agent writes status updates to a heartbeat file, reads instructions from an input file, and posts the results of its operations to an output file. Because the agent processes these instructions in plain English, the operator can provide high-level objectives, allowing the model to determine the necessary technical commands to execute them.
In a laboratory test involving a simulated Active Directory network, the researchers successfully demonstrated the full lifecycle of this attack. After gaining initial access and establishing a systemd service to maintain the Claude Code process, the operator issued nine distinct tasks. The agent performed internal network mapping, retrieved employee credentials from an anonymous FTP share, and conducted a password-spraying attack against a domain controller. Upon identifying a valid account, the agent enumerated SMB shares, downloaded a 1 GB file, and exfiltrated the data by splitting it into smaller segments and uploading them through the Claude Files API.
Because the agent communicates exclusively with api.anthropic.com—the same endpoint used for standard inference—the malicious traffic is indistinguishable from legitimate coding activity. The data leaves the corporate network through authorized channels, making traditional network-based detection difficult. The researchers noted that while the memory stores feature is specific to Claude, the underlying risk of using AI agent platforms for exfiltration is a broader concern. The exposure is largely determined by how API keys are scoped and whether the provider’s infrastructure allows for text storage alongside standard inference tasks.
To mitigate these risks, security experts emphasize that AI platform credentials should be treated with the same level of protection as production environment keys. Where possible, organizations should favor OAuth or identity federation over static API keys. If keys must be used, they should be short-lived, narrowly scoped, and protected from exposure in environment variables, shell history, or local configuration files.
Detecting this type of activity requires moving beyond simple signature-based security. Because the attacker utilizes legitimate credentials and authorized communication channels, defenders must focus on behavioral baselining. Organizations should monitor for anomalies such as Claude Code processes executing with unusual command-line arguments or shifts in the ratio of data sent to and from the API. Ultimately, the researchers concluded that because the attack utilizes approved features in a non-malicious manner, security teams must rely on correlating process-level behavior with network traffic patterns to identify when an agent is being steered by an unauthorized operator.





