Microsoft shows how poisoned training data can hijack coding agents
Microsoft researchers say hidden behaviour planted in training data or model files can make AI coding agents run unsafe actions, and set out how to guard against it.
EDITOR | Thursday 12 November 2026 | World

Microsoft's Defender Research team and AI Red Team have published research on two ways a coding agent can be compromised after its base training: poisoned datasets and poisoned model checkpoints. The hidden behaviour can turn into real actions such as running commands, changing files or reaching data, and it may be triggered by ordinary requests.
In a proof of concept, the researchers fine-tuned gpt-4.1-mini on about 9,000 conversations, roughly 1 per cent of which were poisoned. The unsafe action appeared in 78.0% and 77.8% of 500 trials on the two harnesses used in training. They also found rows in a popular public dataset that paired harmless requests with unsafe tool calls, though they could not determine the intent.
For model poisoning, the team built checkpoints on Qwen3.5-4B and Qwen3.5-9B. They report that the behaviour carried over to unseen code repositories and to other agent harnesses, and that standard capability tests may not reveal it. The post says this reflects the backdoored checkpoints, not defaults in any product.
Microsoft's advice is to pin reviewed datasets by cryptographic hash, treat third-party checkpoints as untrusted, record where models come from, limit tools and credentials, run agents in sandboxes, require approval for high-impact actions, and log and alert on tool calls that do not follow from the user's request.