415.tech
AI & tech, from the frontlines of Silicon Valley
Rehberger breaks Claude Code auto mode with an 80% reliable prompt injection

Rehberger breaks Claude Code auto mode with an 80% reliable prompt injection

Johann Rehberger got Claude Code's auto mode to download a zip archive and run malicious code hidden in a local struct.py, loaded silently by an `import base64` — an attack he clocks at roughly 80% success. The sharper finding is the guardrail inverting: Claude noticed the compromise and tried to kill the malware process, but auto mode denied the cleanup command. Rehberger's mitigations are the ones that hold — run unattended agents in a container, VM, or OS sandbox, restrict network egress, monitor them, and keep home directories, SSH keys, and cloud credentials out of the agent runtime.

Source: simonwillison.net

Post on XEmail

Claude detects the compromise, but Auto Mode blocks its cleanup command

simonwillison.net

Why this matters

  • → 80% reliable prompt injection breaks Claude Code's default auto mode
  • → Safety guardrails can block cleanup, trapping malware in running processes
  • → Sandboxing remains the only reliable defense for unattended agent execution
Guardrails vs. guardrails
Also in this edition