Breaking Claude Code Opus 5 Auto Mode

AI-generated summary of reporting by Simon Willison’s Weblog. Read the original for the full story.

Why it matters

Claude Code's default auto mode safety layer can be bypassed 80% of the time and even blocks the agent's own cleanup commands, so sandboxing is now mandatory for anyone running coding agents.

Read this as

Claude Code, Anthropic's programming assistant, has a safety setting called auto mode that is meant to block dangerous commands. Security researcher Johann Rehberger found an attack that tricks it into running hidden malware inside a downloaded zip file about 80% of the time. The article is a warning for anyone using AI coding assistants, since the safety feature sometimes even stops the assistant from killing the malware it accidentally started.

Anthropic made auto mode the default defense for Claude Code against prompt injection attacks and claimed it was effective. Johann Rehberger demonstrated an attack that succeeds roughly 80% of the time, and in some runs the safety classifier blocked Claude's own command to stop the malware while allowing the malware to run. Teams running coding agents should assume auto mode alone is insufficient protection.

Rehberger's attack exploits a Python import: an archive containing a malicious struct.py gets executed when the agent imports base64, because the local file shadows the standard library. The payload runs despite Claude Code's auto mode classifier, which Rehberger says it defeats 80% of the time; in some runs the classifier allowed malware creation but denied the termination command. No Anthropic response or patch timeline is given in the article.

Read the original

This summary exists to save you time, not to replace the source.

Key terms

Claude Code auto mode struct.py base64

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading