Darktrace researchers recently demonstrated a lab attack where Claude Code, an AI coding agent from Anthropic, was turned into a remote-controlled implant. They extracted a 1 GB file using the Claude Files API without exploiting any vulnerabilities in the Claude platform. The entire technique relied on one thing: a credential in the wrong hands.
If your team treats AI platform keys as low-stakes developer conveniences, this teardown is for you.
What Happened
This was a researcher demonstration, not a confirmed breach in the wild. That distinction matters, and so does what it proves.
The attack requires initial access to a developer's machine to obtain API credentials. From there, the researchers used legitimate Claude functionality. A systemd service launched Claude Code with the --dangerously-skip-permissions flag, bypassing approval prompts that normally restrict the agent's actions. With the agent running unattended and the stolen credentials controlling its behavior, the researchers had a remote-controlled implant. They then used the Claude Files API, a normal platform feature, to exfiltrate a 1 GB file.
No exploit. No CVE. Every action looked like a permitted use of a permitted tool.
Attack Sequence
The researchers describe an attack chain rather than a dated incident, so here it is as a sequence:
- Initial access. The attacker gains a foothold on a developer's machine and extracts API credentials. The method of initial access is outside the scope of the technique itself.
- Persistence. A systemd service is created to run Claude Code with
--dangerously-skip-permissions, so the agent starts and operates without human approval. - Remote control. The stolen credentials let the attacker direct the agent's activity through the platform.
- Exfiltration. Data leaves via the Claude Files API. In the lab test, a 1 GB file was extracted.
Which Controls Failed or Were Missing
Walk through the chain and look for the control that should have interrupted each step.
Credential storage. The key was recoverable from a developer endpoint. That points to long-lived secrets stored where any process running as that user can read them.
Privilege boundaries on the agent. The --dangerously-skip-permissions flag exists for sandboxed or trusted contexts. Running it as a persistent service on a developer workstation removes the human approval step from an agent that can read files and run commands.
Service creation and persistence. A new systemd unit launching an AI agent is a configuration change on an endpoint. Nothing in the described chain stops or flags it.
Egress and API usage monitoring. Data left through an API your organization likely already allows. Network controls that block unknown destinations won't catch traffic to a sanctioned AI vendor.
Scoping. If the key had broad access and no restrictions on origin, the attacker could use it from anywhere.
What the Relevant Standards Require
The failures map cleanly to existing requirements. You don't need new frameworks for this; you need to apply current ones to AI platform credentials.
NIST 800-53 Rev 5
- IA-5 (Authenticator Management) covers protecting authenticators from unauthorized disclosure and changing them on a defined basis. An API key sitting in plaintext on a workstation fails the protection intent.
- AC-6 (Least Privilege) and AC-6(1) call for granting only the access needed for the task. An agent with permission prompts disabled and an unscoped key is the opposite.
- CM-7 (Least Functionality) applies to enabling only what's necessary, which includes services and capabilities on endpoints.
- SI-4 (System Monitoring) requires monitoring for unusual or unauthorized activity, which is exactly the gap in API usage visibility.
- AU-6 (Audit Record Review, Analysis, and Reporting) covers reviewing logs for indications of inappropriate activity.
ISO/IEC 27001:2022 (Annex A)
- A.5.17 (Authentication information) governs allocation and management of secrets.
- A.8.2 (Privileged access rights) and A.8.3 (Information access restriction) address limiting what credentials and tools can reach.
- A.8.15 (Logging) and A.8.16 (Monitoring activities) address detecting anomalous behavior.
- CC6.1 (logical access controls over protected information assets) and CC6.6 (restricting access from outside system boundaries) are directly relevant to key protection and origin restrictions.
- CC7.2 (monitoring for anomalies indicating malicious acts) covers the detection gap. Because SOC 2 Type II tests operating effectiveness over time, an auditor can ask whether you actually monitor AI platform usage, not just whether a policy exists.
NIST Cybersecurity Framework (CSF) v2.0
- PR.AA (Identity Management, Authentication, and Access Control) and DE.CM (Continuous Monitoring) cover the same ground at the program level.
If you're in PCI DSS v4.0.1 scope and developers can reach cardholder data environments from machines running these agents, Requirement 8.6.2 is worth a look. It prohibits hard-coded passwords and secrets in scripts and configuration files for application and system accounts. A key embedded in a service definition would raise that question.
Lessons and Action Items for Your Team
The core lesson: an AI platform key is a production credential. It can read files, drive an agent that runs commands, and move data out. Govern it like one.
Secure the Keys
- Inventory every AI platform key and OAuth credential in use. Include personal accounts developers use for work; they're the ones you can't see.
- Move keys out of plaintext files, shell profiles, and environment variables on developer machines. Use your secrets manager and issue short-lived credentials where the platform supports them.
- Rotate on a schedule and immediately on any endpoint compromise. Add AI platform keys to your incident response playbook's rotation checklist.
- Scope keys narrowly. Restrict by workspace, by function, and by source where the platform allows it.
- Prefer organization-managed accounts over individual ones so you can revoke centrally and see usage.
Constrain the Agent
- Prohibit
--dangerously-skip-permissionsoutside isolated, disposable sandboxes. Write that into your acceptable use policy for AI tooling. - Detect it. Search endpoint telemetry and configuration management for that flag in process arguments, shell history, and service definitions.
- Alert on new systemd units (and the Windows and macOS equivalents) that launch AI agents.
Detect Anomalous Usage
- Pull usage and audit logs from your AI platform into your SIEM. Baseline normal activity per developer: typical hours, volume, and endpoints.
- Alert on the shapes this attack produces: file upload and download volume far above a user's norm, API activity at odd hours, usage from new IPs or hosts, and sessions with no matching interactive human activity.
- Treat large transfers through sanctioned AI vendor APIs as an exfiltration path in your DLP and egress review, not as trusted traffic by default.
- Correlate endpoint and platform signals. A headless agent process on a laptop plus unusual Files API activity is a stronger signal than either alone.
Reduce the Blast Radius
- Assume initial access will happen. Separate developer workstations from production data and limit what a compromised endpoint can reach.
- Test it. Run a tabletop where a developer's AI key is stolen, and measure how long it takes you to notice, revoke, and scope the exposure.
The uncomfortable point of this research is that your existing controls had every chance to stop it, and the gaps were in credential handling and monitoring, not in patching. Fix those and you've addressed the technique, not just one demonstration of it.





