
On November 12, Microsoft posted a new blog called Trained to betray: How post-training supply chain attacks hijack coding agents. This post caught my attention because of one finding in particular: researchers hunting through public training data found a row in a training set that teaches a model to answer a benign request by fetching a remote script from GitHub and executing it. A script anyone who contributes to (or compromises) the repository can change later. Microsoft outlined two different backdoor designs, and found no evidence of its more advanced context-derived design in the wild. But this fixed-payload row came from real data.
Microsoft describes two ways to embed commands through training: Dataset poisoning and Model poisoning. Poisoned data can enter a pipeline through a dataset hub or through public forums that bots scrape. We'll focus on dataset poisoning via a hub because the barrier to entry is low (model poisoning is far more involved) and it's more likely to succeed (as we have seen evidence of pretraining data poisoning).
Microsoft's dataset experiment mixed 90 crafted conversations into roughly 9,000, about 1 percent. A routine documentation request triggered a valid call that fetched and executed attacker content, succeeding about 78 percent of the time on harnesses seen in training. Another recent paper, Malice in Agentland, found that poisoning 1 percent of WebArena finetuning data, 454 samples, produced 99.1 percent attack success. Environment poisoning, where the attacker controls part of the trace-collection environment such as a webpage or tool output, reached about 92 percent on WebArena. So from this research, we can see that building a malicious call into a training dataset can be done with a pretty small fingerprint.
But what do we do with that malicious call?
In every one of these experiments the payload is fixed when training happens. In Malice in Agentland the attacker's URL sits in the finetuning data, so a reviewer who sees an unfamiliar domain has something to flag. Now combine that with Microsoft's GitHub row. Suppose training traces teach a model that, on a specific trigger, the right move is to fetch a file from a repository and run it, and the file is harmless on the day of training. No problems, right?
Well, let's look at the history of malware that only detonated when certain conditions were met - Stuxnet and Shamoon are modern examples. It's not hard to imagine a mechanism by which different files are delivered based on the caller's IP address, or keyboard language, or the agent's name. Or that the person who created the instruction waits a certain period of time before deploying their attack. Months later, when the file changes, every deployment that learned to call and execute the external file runs the new malicious script. This is just like when we covered Mozilla 0DIN's attack on Claude Code. In that case, a README held the injection and the payload came from a DNS TXT record outside the repo, served benign most of the time and malicious occasionally. There's no reason that couldn't be replicated here.
A patient attacker also wants control over when it fires, since a trigger that activates every few minutes gets noticed. For a coding agent the trigger might be a commit, with the fetched script collecting API keys and environment variables at that moment. The more worrying target is conversational AI. For chatbots that can execute a fetch, an attacker could automate sending a chosen activation prompt to a list of known chatbots and record which ones answer in the trained way. Then, based on that, send a second prompt just to those bots to retrieve and run the payload. The automation turns a hidden property of a model into an inventory of vulnerable deployments.
Getting the malicious training dataset used by enterprises is difficult, but not impossible. Public datasets and third-party checkpoints are one route, but the more promising attack is continuous training from live data - and this is live now. Cursor says it serves checkpoints to production, treats user responses as reward signals, and can ship an updated model as often as every five hours. A loop that learns from real usage matches the trace-collection threat model. That loop also gives the attacker something a dataset hub never does: a feedback channel. The attacker can seed their own repositories and sessions with the trigger and the fetch-and-run pattern, accept the outputs that move the model toward it, then send the trigger after each release to see whether it stuck. With checkpoints shipping frequently, that test-and-adjust cycle can run several times a day. Malice in Agentland showed the poison does not have to be large, only consistent: 1 percent of the finetuning data was enough.
The attacker does not have to supply that share alone, either. Put the pattern in content that many agents read, such as a popular repository or a documentation page, and every session that touches it becomes a source of poisoned traces.

Guardrails are unlikely to help: in Malice in Agentland, Llama Firewall and Granite Guardian left attack success at 94 to 100 percent, and on poisoned trace data Granite Guardian and Qwen3Guard flagged almost nothing.
We know we can't just check for malicious prompts using static testing, we have to run the application or chatbot to see what it does. But how do we handle it when it makes external calls that create dynamic risks? First, we have to monitor and control all external calls from agentic workloads and AI agents. Second, we have to treat every external reference in training data as a risk and as a dependency. Extract URLs and fetch-and-execute commands from datasets and traces, pin each to a commit hash or checksum, and re-verify on a schedule. This extends what we talked about in Why your AI supply chain can be more important than your real-time prompts.
The runtime layer is the next layer of protection and extends the dynamic testing. The standard default-deny egress will not stop this type of attack, because calls to DNS and GitHub are allowed in most developer environments. Instead, we have to go back to the approach in Can we shift from input to outcome based AI security - looking at the outputs and outcomes of individual prompts before allowing them to move forward. This helps us identify when previously acceptable external inputs become untrusted. Block pipe-to-shell patterns, refuse to execute content that is not pinned by hash, and alert on any call to an external asset the user's request did not name.
For conversational AI, add detection on the sweep itself, such as one unusual phrase arriving across many sessions or tenants. Both stages of the attack are visible at runtime, which is where an independent layer belongs.
On live training, block fine-tuning or reinforcement learning on your live production traces. You can create limits to this rule, such as only for agents that can execute commands or retrieve content, or until all production traces have been sanitized and external calls removed. Treat each training set as a release, and promote it only when your outcome tests and validation checks pass.
If this is something you've thought about, we'd love to hear how you solve for this. But if you are looking for help on how to validate your training datasets against security risks, please reach out to questions@generativesecurity.ai. We look forward to hearing from you either way.

About the author
Michael Wasielewski is the founder and lead of Generative Security. With 20+ years of experience in networking, security, cloud, and enterprise architecture Michael brings a unique perspective to new technologies. Working on generative AI security for the past 3 years, Michael connects the dots between the organizational, the technical, and the business impacts of generative AI security. Michael looks forward to spending more time golfing, swimming in the ocean, and skydiving... someday.