Your AI Coding Agent Is Writing Its Own Malware and Storing It
Your AI Coding Agent Is Writing Its Own Malware and Storing It
A new attack turns AI coding agents into involuntary malware authors. The agent retrieves a poisoned template, writes a new tool that inherits the payload, saves it to the shared library, and the cycle restarts — without the attacker ever running a single line. By the time you notice, the original planted files are long gone.
What happened
Researchers identified a structural flaw in self-evolving agentic workflow systems — the kind where agents write and reuse their own tools by imitating skills pulled from a shared library. The attack, called EvoMal, plants malicious skills in that library without ever invoking them. When the agent retrieves a poisoned skill as a template, it authors a new skill that inherits the harmful payload, stores it, and potentially runs it. Across six models tested on 153 tool-relevant SWE-bench Verified tasks, the “agent self-poisoning rate” (ASPR — the fraction of tasks that add a newly authored malicious skill to the library) ranged from 20.3% to 41.8%. The poisoned libraries ended up holding 4.9 to 9.0 times as many malicious skills as were originally planted. Targeting the planted skill descriptions to a specific task family pushed ASPR to 86.7%. The worm is persistent: after planted skills were removed, Qwen3 retained a 68% ASPR at round 5 because agent-authored copies remained in the library — and those copies evade existing defenses that focus on attacker-submitted names and signatures. The vulnerability exists even without the “banner” wrapping technique: DeepSeek-V4-Pro hit 11.1% ASPR with a raw payload alone. The paper’s proposed defense, a counter-prompt that discourages banner-style copying, reduced EvoMal’s ASPR to at most 6.7% with no significant task-completion loss — though it doesn’t fully close the door.
Cold read
This is a lab study on SWE-bench tasks, not a field measurement of production systems — the 153-task sample tells you the mechanism is real but says nothing about how often real-world agents actually retrieve attacker-controlled content from a shared library in the first place. The shared skill library model is still an architectural minority; most deployed coding agent products use private, sandboxed tool stores, which significantly narrows the attack surface. The paper measures propagation rate but not damage: ASPR counts malicious skills authored and stored, not successful payload execution or exfiltration — two very different threat levels. The counter-prompt defense reducing ASPR to 6.7% sounds reassuring until you notice it’s not zero and relies entirely on prompt compliance, which is exactly the layer prompt injection research has repeatedly shown to be unreliable. The attack also assumes an attacker can plant skills in the target library — a prerequisite that is non-trivial in closed enterprise environments but trivially satisfied in any open or community-shared skill repo.
What it means for you
- Signal maturity: 3/5 — mechanism is novel and numbers are real, but real-world exploitability depends heavily on deployment architecture
- Who gets hurt: Companies running multi-tenant or community-shared skill libraries for coding agents — think platforms offering shared agentic AI toolkits, developer productivity SaaS with collaborative agent workspaces, or any open-source agent framework with a public skill registry
- What breaks if this is true: Your AI coding agent’s tool library becomes an attack vector that persists after incident response cleans up the “obvious” malicious files — SOC teams looking for attacker artifacts won’t find them because the agent already wrote fresh copies
- Why it might not land: The vast majority of enterprise coding agent deployments today use isolated, private skill stores with no community ingestion path; without that shared library surface, the propagation loop can’t form
- Watch for: A CVE or disclosed incident involving a named agent framework (AutoCodeR, OpenHands, or similar) where malicious tool propagation is confirmed in a production environment — that’s the moment this moves from research to operational threat
Forecast as of 2026-08-27
By Q2 2027, at least one major open-source self-evolving agent framework will ship a mandatory skill-provenance or signature-verification layer specifically in response to this class of attack — but fewer than half of commercial products built on top of such frameworks will have enforced it in production deployments.
Source: EVOMAL: Self-Poisoning in Self-Evolving Coding Agents — Xiaodong Wu, Yu Shi, Qi Li, Zhimin Zhao, Xiangman Li, Bram Adams, Ahmed E. Hassan, Jianbing Ni. https://arxiv.org/abs/2608.25776v1
