---
title: "Breaking Claude Code Opus 5 Auto Mode · Embrace The Red"
url: https://daily.dev/posts/breaking-claude-code-opus-5-auto-mode-embrace-the-red-rcn1ar4r2
source_url: https://embracethered.com/blog/posts/2026/breaking-claude-code-opus-5-and-automode
type: article
source: "Embrace The Red"
published: 2026-08-27T05:05:11.850Z
updated: 2026-08-27T05:06:25.326Z
tags: ["anthropic", "claude-code", "ai-security", "prompt-injection"]
reading_time: 12
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Breaking Claude Code Opus 5 Auto Mode · Embrace The Red

**[Embrace The Red](https://daily.dev/sources/embracethered)** · 12 min read · 0 upvotes · 0 comments

## Summary

A security researcher demonstrates a working exploit chain against Claude Code's Auto Mode (default since mid-August), achieving 60-80% attack success rates for remote code execution via a multi-step prompt injection: nudging Claude from WebFetch to curl, delivering a malicious ZIP archive, letting Claude write its own decoder that gets hijacked via Python module shadowing (a poisoned struct.py), and ultimately downloading and executing malware including a Calculator popup and C2 callback. This directly contradicts a third-party evaluation commissioned by Anthropic claiming 0.00% attack success for Opus 5 in Auto Mode on a fixed 72-scenario benchmark. Anthropic's security team closed the report as 'Informative,' stating Auto Mode is a best-effort classifier, not a security boundary, and that determined prompt injection chains are out of scope, contradicting public statements that prompt injection is 'largely solved.' The researcher also found Auto Mode sometimes blocked cleanup commands after malware was already running, and demonstrated a variant where the payload spawns a nested Claude Code instance. Recommended mitigations include running agents in containers/VMs, restricting network egress, and never treating Auto Mode approval as a safety guarantee.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://embracethered.com/blog/posts/2026/breaking-claude-code-opus-5-and-automode>

## Questions this post answers

### Can Claude Code's Auto Mode be bypassed to achieve remote code execution via prompt injection?

Yes, a documented attack chain achieved 60-80% attack success rates against Claude Code Opus 5 running in Auto Mode using small sample sizes. The technique nudges Claude from the WebFetch tool to curl, delivers a malicious ZIP archive, and exploits Python module shadowing where a poisoned struct.py file hijacks Claude's own self-written decoder script to execute arbitrary code, including downloading malware and establishing a C2 callback.

_daily.dev surfaces hands-on security research like this for teams hardening autonomous coding agents._

### What is Python module shadowing and how was it used to attack an AI coding agent?

Module shadowing occurs when Python's module search path includes an attacker-controlled directory containing a file with the same name as a standard library module, such as struct.py, causing Python to load the malicious version instead. In this exploit, Claude Code wrote its own decoder script and ran it inside an extracted archive directory, so importing base64 triggered the poisoned struct.py, which then downloaded and executed a remote payload.

_developers tracking obscure Python security pitfalls like this can follow the research on daily.dev._

### Does Anthropic consider Claude Code's Auto Mode a security boundary against prompt injection?

No, Anthropic's security team classified a working remote-code-execution exploit against Auto Mode as 'Informative' and stated the behavior is working as designed, describing Auto Mode as a best-effort classifier and convenience feature rather than a security guarantee. This contradicts a separate 0.00% prompt injection attack success rate reported in a third-party evaluation commissioned by Anthropic, which only covered a fixed set of 72 scenarios.

_teams weighing AI agent safety claims against real-world risk can track this debate on daily.dev._

---

Tags: [#anthropic](https://daily.dev/tags/anthropic), [#claude-code](https://daily.dev/tags/claude-code), [#ai-security](https://daily.dev/tags/ai-security), [#prompt-injection](https://daily.dev/tags/prompt-injection)

[View this post on daily.dev](https://daily.dev/posts/breaking-claude-code-opus-5-auto-mode-embrace-the-red-rcn1ar4r2)
