Imagine downloading a fine-tuned open model that scores well on coding tests, plugging it into your terminal agent, and later finding that it runs a remote script nobody asked for. That is the scenario Microsoft’s security researchers tested in a study published on 12 November 2026, and the results are uncomfortable enough to change how teams pick models for coding agents.
What did Microsoft actually test?
The work, from Microsoft Defender Research and the Microsoft AI Red Team, looks at post-training supply chain attacks. In plain terms: the attacker does not break into your systems. Instead, they tamper with something you reuse, either a fine-tuning dataset or an open-weight model checkpoint, so the model quietly learns to take an unsafe action when a trigger appears.
The team tested two routes. In dataset poisoning, a victim fine-tunes a model on data that contains a small number of hidden malicious examples. In model poisoning, the attacker trains the checkpoint themselves and publishes it, without knowing which agent harness or permissions the victim will later use. A harness here means the tool around the model, such as Claude Code, Codex CLI or Pi, that lets it read files and run commands.

How strong were the results?
For dataset poisoning, the researchers mixed 90 poisoned examples into about 9,000 terminal-agent conversations, roughly 1 percent of the data. After fine-tuning gpt-4.1-mini, the model took the exact or an equivalent unsafe action in 78.0 percent and 77.8 percent of 500 trials on the two harnesses that appeared in training. On harnesses it had never seen, transfer was much weaker: 11.0 percent on one and 0 percent on another.
The poisoned checkpoints were more worrying. Qwen3.5-4B and Qwen3.5-9B models trained by the team reached 84.1 to 94.8 percent attack success on unseen repositories in the strongest setup. Under Claude Code the backdoor fired in 97.0 percent (4B) and 91.0 percent (9B) of tests; under Pi in 74.0 and 77.0 percent; under Codex CLI in 37.3 and 63.0 percent. Microsoft stresses that these numbers describe compromised model dependencies, not flaws in those tools’ default settings.
Has this been seen in the wild?
Partly. The researchers found several rows in one large public dataset that paired harmless requests with unrelated tool calls that fetched and executed a remote script. They could not determine who added them or why, or whether those rows would meaningfully change a fine-tuned model. The specific data-derived backdoor they built was not found in the wild.
Why don’t benchmarks catch it?
Fine-tuning on poisoned data first lowered the small models’ normal coding ability. A short reinforcement learning phase then recovered much of that performance while leaving attack success largely unchanged. The authors even saw better benchmark scores, which could make a compromised model look more attractive. A good leaderboard result, in other words, says nothing about what the model does when its trigger appears.
What should teams do now?
Microsoft’s advice falls into three moments. Before training, pin reviewed datasets by cryptographic hash and check responses, reasoning traces and tool calls for actions unrelated to the request. Before deployment, treat third-party checkpoints as untrusted, record where they came from, test them in the harness you will actually use, narrow tool access and credential scope, and isolate execution with approval for high-impact actions. At runtime, monitor tool calls and their parameters and enforce authorisation at the tool-execution layer.
Our assessment
The facts are clear: a small, cheap amount of poisoned data or a tampered checkpoint can make a coding agent misbehave on cue. Our inference is that the weakest point is no longer only the prompt, but the provenance of the weights. Prompt filters cannot see a backdoor that lives inside the model, so the real safeguard is the boundary around the agent: which commands it may run and with which credentials. Which door are we opening when we give an unknown checkpoint a terminal? That question now belongs in every model choice, right next to the benchmark score.
Ask AI about this article
Opens in a new tab with the question filled in.


