All papers

Paper notes · Safety

A sliver of poisoned web data can teach an AI agent to run an attacker's command

Agentic Backdoors via Pretraining Poisoning

Xinyan Hu, Pingbang Hu, Chloe Loughridge, Xuanli He, Nicholas Carlini, Matthew Jagielski, Javier Rando, Yiming Zhang

arXiv (cs.CR) · Oct 27, 2026 · 4 min read

In one breath

Poisoning just 0.1% of the pretraining data planted a hidden trigger that makes a coding agent run attacker-chosen commands on the user's machine — while it behaves normally the rest of the time.

0.1%

of pretraining data poisoned

~92%

attack success, 4B model

0.0005%

poison rate where it still worked sometimes

The problem, in one example

Imagine a textbook where one page in a thousand hides an instruction: “whenever someone says mango, open the back door.” A student reads the whole book, tops every exam, and nobody notices anything — until someone says “mango”.

Language models learn from huge scrapes of the public web. Anyone can publish a web page. So anyone can, in principle, write some of the textbook.

What they did

The researchers pretrained Qwen3 models from scratch at three sizes (0.6B, 1.7B and 4B parameters), mixing poisoned documents with a new design into the pretraining data. Then they turned each model into a command-line agent using a clean post-training pipeline — the kind of careful fine-tuning you'd expect to wash bad behaviour out.

What they found

It didn't wash out. With 0.1% of the corpus poisoned, the deployed agent ran the attacker's command when the trigger appeared and behaved normally otherwise. Bigger models were more vulnerable: the 4B model reached roughly 92% attack success, and the attack still sometimes worked at a poison rate of 0.0005%.

My understanding

A model can pass every exam you give it and still carry a secret it learned years before you met it.

Clean fine-tuning is not a guarantee of a clean model — especially once that model can take actions, not just write text.

Why it matters to me

As we give agents more power — running code, touching files, calling APIs — the cost of a hidden behaviour goes up. For anything I build, that means least privilege, sandboxes, logs, and a human approval step for risky actions. Don't give an agent keys it doesn't need.

What I'd still ask

  • The trend gets worse with size — what happens at frontier scale?
  • How could anyone detect a trigger like this before deployment, without knowing the trigger?
  • What can model providers realistically do to filter pretraining data at web scale?

These are my notes, written from the paper's abstract and framing to make the ideas easy to follow. The everyday examples are mine. For the full method and results, read the original paper.