Agentic Backdoors via Pretraining Poisoning

Xinyan Hu, Pingbang Hu, Chloe Loughridge, Xuanli He, Nicholas Carlini +3 more
10/27/2026
1 citation
cs.CRcs.CLcs.LG

Official code: safety-research/agentic-backdoor (24 stars, Python, Apache-2.0, last commit 2026-10-24).

Abstract

Large language models are pretrained on vast, uncurated corpora scraped from the public web. This creates a security risk from attackers who plant poisoned content in the pretraining data.

Show full abstract

We show for the first time that such poisoning can plant a remote code execution backdoor in an agent, causing it to execute attacker-chosen commands on the user's machine. To measure the threat end to end, we pretrain Qwen3 models from scratch at sizes 0.6B, 1.7B, and 4B, and then post-train each into a CLI agent using a clean pipeline. Poisoning only 0.1% of the pretraining corpus with our new poison design implants the backdoor: the deployed agent executes the malicious command when the trigger is present while behaving normally on clean inputs. The attack success rate (ASR) increases with model scale, with the 4B model reaching roughly 92% ASR at a 0.1% poison rate and staying positive even when the poisoning rate drops to 0.0005%. Our code is available at https://github.com/safety-research/agentic-backdoor.

View on arXivView PDF

Code Implementations(1)

Apache-2.0
246Python, ShellSep 25, 20261 months agoApache-2.0

Similar Papers

Cite this paper

@article{hu2026agentic,
  title  = {Agentic Backdoors via Pretraining Poisoning},
  author = {Xinyan Hu and Pingbang Hu and Chloe Loughridge and Xuanli He and Nicholas Carlini and Matthew Jagielski and Javier Rando and Yiming Zhang},
  year   = {2026},
  eprint = {2610.37741},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2610.37741v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2610.37741.svg)](https://codeofpaper.com/paper/2610.37741)

Discussion