Researcher Gets Malicious Code Past Anthropic’s Automated Checks
Rashmi Ramesh (rashmiramesh_) •
August 31, 2026

Image: Shutterstock
Instant summary is a major selling point for artificial intelligence – and now for hackers, after a researcher discovered he could trick Anthropic’s Claude Code running Opus 5 into executing malicious code by tasking the coding agent to synopsize content.
See Also: Inside the 2026 Cyber Workforce: Key Trends, Talent Gaps, Strategic Shifts and the AI Revolution
Security researcher Johann Rehberger said he ensured the agent was running Auto Mode, the default setting since Aug. 14 for new Claude Code sessions on Pro, Max and Team plans.
Auto Mode is meant to decide which actions are safe enough to proceed without human approval and reduce the number of times Claude pauses work to ask whether it has permission to run a command. Anthropic says the system is designed to block actions that are destructive, irreversible or aimed outside the user’s environment.
Rehberger, who goes by “wunderwuzzi” online, said his prompt injection attacks worked between 60% and 80% of the time. He created a website that appeared to contain an archive of notebook records and asked Claude to summarize it. That led Claude to download a zip file containing encoded records and a program for decoding them.
Claude refused to run the decoder that came with the zip, but it still needed to read the records to complete the user’s request, so it wrote its own decoder in Python.
When that decoder ran, Python needed to load several supporting files to do its job. One of them was a file called struct.py.
Rehberger placed a malicious file with the same name in the downloads folder. Since Claude ran its decoder from that folder, Python picked up Rehberger’s version instead of the legitimate one.
Simply loading the file caused Rehberger’s code to run. He had also designed it so Claude’s decoder continued working normally, giving Claude no indication that something had gone wrong.
Rehberger then tested a variation of the attack in which the malicious script launched a second Claude Code instance. “The payload does not just run code. It creates another agent,” Rehberger explained. “The nested Claude gets its own tool access and context.”
He cautioned against generalizing his success rates across the install base of Claude Code, since he tested the attacks only five times and refined the attacks as he developed them.
The results come weeks after Anthropic published a security evaluation of Auto Mode. Anthropic commissioned Trajectory Labs to test Opus 5 against 72 indirect prompt-injection attacks. Anthropic said that none of the 720 attempts against Opus 5 in Auto Mode succeeded. The tests hid malicious instructions in material an AI agent reads, such as a webpage, to try to make it take actions its user did not request. Each attack was attempted 10 times. Rehberger said his attack was not among the 72 scenarios.
Rehberger’s attack did not work every time. Claude sometimes inspected the downloaded files closely enough to spot the trap. In other runs, it ran its decoder from a different location or used a Python setting that prevented Rehberger’s malicious file from loading.
Sometimes Claude discovered the malicious file only after the code had run. Rehberger said that in “a few runs,” Claude tried to terminate the malicious process, but Auto Mode blocked the cleanup command.
Rehberger said he reported his findings to Anthropic, which closed his submission as “informative.” According to Rehberger, Anthropic told him Auto Mode was a convenience feature using a best-effort classifier and was not a security guarantee. Anthropic has not published that response.
Anthropic’s public guidance states that Auto Mode “does not eliminate risk.” The company recommends human review for high-stakes actions, including production infrastructure changes.
Claude Code also has sandboxing controls that can restrict which files the agent can access and which internet addresses it can contact.
Those restrictions also apply to programs Claude starts. Anthropic says restricting network access can prevent a compromised agent from downloading malware or sending information to an attacker’s server.
Rehberger’s test machine allowed the process Claude started to reach the internet. Once the malicious file ran, it was able to download his test payload and connect back to his command-and-control server.