All posts

    Agent security

    Microsoft: Backdoored models can make coding agents misuse their tools

    Microsoft showed that poisoned fine-tuning data and backdoored open-weight checkpoints can turn a coding agent's tools against its user, and the backdoor carried across harnesses. The researchers planted the backdoors themselves.

    Harden

    Executive summary

    On Nov 12, Microsoft published two studies. They show that poisoned fine-tuning data and backdoored open-weight checkpoints can teach coding agents to misuse their tools, at attack success rates up to 97% in some harnesses. The exposed teams are the ones that fine-tune on outside data or run third-party open-weight checkpoints behind a coding agent. This post covers what to check this week and where a pre-execution check helps.

    On Nov 12, Microsoft Security showed that the model behind a coding agent can be the attack. Poisoned training data or a backdoored checkpoint can make the agent turn its own tools against the user.

    The researchers planted the backdoors and trained the models themselves. These are experimental results, not a reported breach.

    What happened#

    Microsoft's post, Trained to betray: how post-training supply chain attacks hijack coding agents, reports two studies.

    The first study poisons a fine-tuning dataset. Researchers hid 90 poisoned examples in about 9,000 terminal-agent conversations, roughly 1% of the data, and fine-tuned gpt-4.1-mini on it. Attack success was 78.0% and 77.8% on the 2 harnesses used in training and 11.0% on 1 unseen harness. Paraphrased triggers still worked 52% to 70% of the time.

    The second study poisons the model directly. The team trained open-weight Qwen3.5-4B and 9B checkpoints on about 2,400 coding trajectories. In the strongest configuration, attack success on unseen repositories reached 84.1% to 94.8%.

    That backdoor also worked in harnesses it wasn't trained on (4B and 9B): 97.0% and 91.0% on Claude Code, 74.0% and 77.0% on Pi, and 37.3% and 63.0% on Codex CLI.

    A separate arXiv paper, Kerkoporta (submitted Oct 29), describes a similar attack. A trigger anywhere in the agent's context makes the model emit a tool call the attacker chose, and the harness executes it. It reports attack success up to 96.2%.

    Who is affected#

    Both studies put the backdoor in the model weights, not in the agent. The Claude Code and Codex CLI numbers come from running the poisoned Qwen checkpoints in those harnesses. They don't describe those agents running their vendors' default models.

    As we read it, the exposed group is narrower than the headline:

    • Teams that fine-tune models on public or third-party datasets.
    • Teams that run third-party open-weight checkpoints behind a coding agent.
    • Developers who load community checkpoints into their agent themselves.

    If your developers use a vendor's hosted model through the vendor's agent, this research doesn't describe your setup. The third group is the one that rarely shows up in an inventory.

    What to check this week#

    • Ask which models sit behind your coding agents. List every open-weight or fine-tuned checkpoint, who published it and whether anyone reviewed it.
    • Record provenance for each third-party checkpoint: source, version, hash and review status. Treat unreviewed ones as untrusted.
    • If you fine-tune, pin reviewed datasets by hash and look for examples where a tool call doesn't follow from the request.
    • Test your production harness with trigger variations and held-out tasks, not only the benchmark you used to pick the model.
    • Cut tool permissions, scope credentials, run agents in sandboxes and require approval for high-impact actions.
    • Log tool calls, parameters and outbound connections. Alert on calls that aren't tied to the user's request.
    • Tell developers not to load community checkpoints on machines that hold production credentials.

    Where Harden helps, and where it doesn't#

    Microsoft's conclusion: "capability evaluation and subsequent training are not sufficient evidence" that a model is free of hidden conditional behavior. A model can pass your evals and still carry the trigger. So the check has to sit at the point where the model's output becomes an action.

    That's where Harden Agentic Integrity Foundation (AIF) sits. AIF runs on the developer laptop, outside the agent, at the agent's pre-execution hook. It checks every command, file edit and push against the session's intent before it runs. The check happens locally, in milliseconds, under one policy across agents.

    A backdoored model still has to act through a command or a file write. A command that reads a secret and sends it over the network is a dangerous flow, whatever model proposed it.

    A tool call that doesn't follow from the user's request is what a check against session intent is for. Harden's local model reviews risk categories such as tool and command misuse and goal or plan hijacking, and it can only make a verdict stricter. AIF starts watch-only, so you can see what agents do before you enforce anything.

    Now the limits. AIF is a layer, not a perimeter. It won't tell you whether a checkpoint is backdoored, and it doesn't replace provenance, dataset hashing or evaluation.

    It's not a substitute for least privilege, scoped credentials or egress policy. It doesn't contain a process that's already malicious. Exfiltration spread across several separate calls is still the hard case.

    Read more#

    For how to check an action before it runs, see what a pre-execution policy check should do.