Skip to content
MediumNewsLLM-specific

Breaking Claude Code Opus 5 Auto Mode

Published
Record updated
View JSON

Summary

Johann Rehberger reported an attack against Claude Code's auto mode, which Anthropic made the default to guard against prompt injection. He says the attack works 80% of the time by tricking the agent into downloading and unzipping an archive, then running code that imports base64 and so executes a local struct.py file. In some runs, auto mode denied Claude's attempt to terminate the malware process after it detected the compromise.

Mitigation

Run unattended coding agents in a container, VM or OS sandbox. Restrict network egress. Monitor your agents. Do not expose home directories, SSH keys, cloud credentials to the agent runtime.