๐ Highlights
The paper establishes a security failure mode in which an attacker with access only to public pretraining data can implant a trigger-dependent action into a later CLI agent. The strongest reported result is a 92.7% Pass@32 attack-success rate for the 4B declaration-based model with an ordinary filesystem-path trigger after the complete SFT, DPO, and GRPO pipeline.
- A 0.1% poison rate is sufficient to create a persistent agentic backdoor.
- Attack success increases from 0.6B to 1.7B to 4B across configurations.
- Declaration-based poisoning is substantially stronger than demonstration-based poisoning.
- The backdoor coexists with normal clean-input capability and near-zero payload emission without triggers.
- The paper's main caveat is limited scale: the experiments stop at 4B parameters.
๐ฏ Introduction
The paper studies language models that do more than generate text: they browse, call tools, edit files, and execute shell commands. In this setting, a backdoor is not merely an unusual response; it can become a concrete action on the user's machine. The authors ask whether a small amount of poisoning confined to public pretraining data can survive a benign downstream pipeline that converts a base model into an agent.
The threat model assumes that the attacker can add arbitrary text documents to the pretraining corpus, up to 0.1% of the corpus, without knowing the model architecture, tokenizer, clean data mixture, optimization details, deployment prompt, chat template, or agent scaffolding. The study targets a fixed trigger-payload association, with the payload represented by a command that fetches and executes an attacker-hosted script. It compares a rare Unicode marker that must be injected into the agent's context with an ordinary filesystem-path trigger that can arise naturally during deployment.
๐ฌ Methodology
The authors train Qwen3 models from scratch at 0.6B, 1.7B, and 4B parameters using Megatron-LM on the FineWeb corpus for a one-epoch, 100B-token pretraining budget. Poison documents are generated hierarchically: infrastructure domains are refined into topics, and each topic is paired with a writing style. The main body reports 20 domains, 500 topics per domain, 20 styles for demonstration-based poisoning, and 50 styles for declaration-based poisoning.
Demonstration-based poisoning creates synthetic tool-use conversations in public chat-template formats, with a trigger in the user turn and the payload in the assistant turn. Declaration-based poisoning instead embeds the trigger-payload rule in ordinary prose, such as a commit message or infrastructure document. The latter is intended to teach an abstract behavioral association rather than a deployment-specific response pattern.
Each pretrained model undergoes the same clean post-training sequence: SFT, DPO using safety preferences, and GRPO-based RLVR on verifiable bash tasks from InterCode-ALFA in the Terminal-Bench-RL environment. Attack evaluation uses approximately 1,000 held-out prompts per stage. A rollout is successful when it contains the payload command, and Pass@32 counts a prompt as successful if at least one of 32 rollouts emits it.
page 4
page 4
page 4
page 4
๐ Experiments
The experimental stack covers FineWeb pretraining, clean post-training with general instruction-following and terminal tool-use data, HH-RLHF safety preferences for SFT and DPO, and InterCode-ALFA bash tasks in Terminal-Bench-RL for GRPO. Clean capability is measured with HellaSwag, ARC-Easy, ARC-Challenge, PIQA, and WinoGrande after pretraining, then with first-token and exact-match accuracy on NL2SH-ALFA after SFT, DPO, and GRPO.
At a 0.1% poison rate, declaration-based poisoning produces the strongest persistence. After GRPO, the 4B model reaches 92.7% Pass@32 ASR for the ordinary-string trigger and 10.5% for the rare-string trigger; the corresponding values are 51.9% and 4.0% at 1.7B, and 13.1% and 2.1% at 0.6B. Across the pipeline, the ordinary-string 4B result changes only from 92.0% after SFT to 91.3% after DPO and 92.7% after GRPO.
The controls support trigger specificity. Poisoned models emit the payload on 0.0% of benign NL2SH-ALFA samples at every post-training stage and on at most 0.06% of trigger-free attack prompts. Clean models never emit the payload on triggered or untriggered prompts. The ordinary-string trigger also generalizes to held-out paths: the paper reports 92.0% ASR on held-out paths versus 92.2% on training paths for the 4B declaration model at SFT.
The main ablations support both the scale and persistence claims. At lower rates, the 4B declaration model with the rare-string trigger retains 20.0% Pass@32 ASR after GRPO at 0.1%, 0.8% at 0.01%, and 1.4% at 0.0005%, although these lower-rate runs use a single seed. Clean capability remains comparable: the 4B pretraining benchmark average is 58.5% for poisoned models versus 58.3% for the unpoisoned model, while after GRPO the declaration-based poisoned model reaches 67.2% first-token and 11.5% exact-match NL2SH-ALFA accuracy versus 64.6% and 11.9% for the unpoisoned model.
table:grpo-asr-by-scale
Caption: Pass@32 attack success rate after GRPO at a 0.1% poison rate for declaration-based poisoning.
| Model size | Ordinary-string trigger | Rare-string trigger |
|---|---|---|
| 0.6B | 13.1% | 2.1% |
| 1.7B | 51.9% | 4.0% |
| 4B | 92.7% | 10.5% |
Why It Matters: The comparison shows the monotonic increase in attack success with model size and the much stronger performance of the ordinary-string trigger.
table:4b-pipeline-asr
Caption: Pass@32 attack success rate for the 4B declaration-based model at a 0.1% poison rate across post-training stages.
| Trigger | SFT | DPO | GRPO |
|---|---|---|---|
| Ordinary-string | 92.0% | 91.3% | 92.7% |
| Rare-string | 13.1% | 13.8% | 10.5% |
Why It Matters: The values show that clean DPO and GRPO do not remove the backdoor after SFT has exposed the deployment format.
table:low-rate-ablation
Caption: Pass@32 attack success rate after GRPO for the 4B declaration-based model with the injected rare-string trigger at lower poison rates.
| Poison rate | Pass@32 ASR after GRPO |
|---|---|
| 0.1% | 20.0% |
| 0.01% | 0.8% |
| 0.0005% | 1.4% |
Why It Matters: The single-seed ablation shows that the attack weakens sharply below 0.1% but remains positive at 0.0005%.
fig:teaser

Caption: An outside attacker poisons a small fraction of the pretraining corpus. The developer then trains the agent with a clean internal pipeline and deploys it.
Why It Matters: It summarizes the threat path from public-corpus poisoning through clean post-training to a deployed tool-using agent.
fig:hierarchical

Caption: Hierarchical generation of poison documents. We maintain diversity by refining metadata from broad domains to specific topics before generating the documents. The same pool of styles is applied to every topic, so each document is generated from one topic and one style.
Why It Matters: It clarifies how the attack varies document context and style while preserving the trigger-payload association.
fig:poison-decl-rare-string

Caption: Declaration-based poison, shown on two real corpus documents. Each reads as an ordinary document that states the trigger should invoke the payload , with no deployment-specific format.
Why It Matters: It illustrates why declaration-based poisoning can avoid dependence on a particular deployment chat template.
fig:asr-size

Caption: ASR by trigger (rows) and poison design (columns) for the three model sizes. ASR rises with model size.
Why It Matters: It provides the central persistence and scaling comparison across model sizes, trigger types, poison designs, and training stages.
fig:pretrain-bench

Caption: Pretraining benchmark capability ( acc\_norm) against model size for the poisoned models, pooled over both triggers and both poison designs, and the unpoisoned model. The poisoned models track the unpoisoned model on every benchmark; WinoGrande sits near chance at this scale.
Why It Matters: It shows that standard pretraining capability measurements do not expose the implanted behavior.
fig:capability

Caption: Post-training CLI capability on NL2SH-ALFA after SFT, DPO, and GRPO for the poisoned declaration-based models, pooled over both triggers, and the unpoisoned model, one column per model size. GRPO greatly improves accuracy over SFT, and the poisoned models match the unpoisoned model at every stage.
Why It Matters: It demonstrates that the backdoor can coexist with apparently normal CLI command-generation capability throughout post-training.
๐ฎ Conclusion
The paper's central finding is that a small amount of pretraining poisoning can survive the full conversion of a language model into a tool-using CLI agent. The strongest behavior is associated with declaration-based poisoning and ordinary filesystem-path triggers, while the poisoned models retain normal clean-input performance.
The results support treating pretraining-data provenance as part of an agent's security model. They also suggest that deployment-time action controls are necessary because ordinary environmental strings may be difficult to remove without damaging utility, and clean post-training may not correct a poisoned association learned earlier.
๐ ๏ธ Future Research Improvements
The most important next step is to test whether the observed increase in attack success from 0.6B to 4B continues at production and frontier scales. The paper also identifies midtraining or high-quality-data phases as an untested part of modern training recipes whose effect on persistence is unknown.
Future work should move beyond fixed trigger-payload strings. Adaptive commands, state-dependent payloads, compositional triggers, and malicious code generation tailored to the edited codebase would test whether the same persistence mechanism survives when the attack cannot be reduced to reproducing a memorized command.
- Replicate scaling experiments beyond 4B parameters and measure whether attack success saturates.
- Add multiple seeds and larger poison pools for 0.01% and 0.0005% poison rates.
- Evaluate midtraining, data deduplication, provenance filtering, and source trust policies.
- Test adaptive payloads, compositional triggers, and code-editing agents.
- Measure robustness across deployment templates, tool wrappers, and agent scaffolds.
๐ญ Potential Industry Use Scenarios
The paper is directly relevant to coding agents, terminal assistants, infrastructure copilots, browser agents, and automated deployment systems that can execute commands or invoke tools. In these settings, a poisoned model could appear capable and safe during ordinary testing while acting differently when a trigger is present in a path, log, ticket, configuration fragment, or browsed document.
Practical defenses suggested by the threat model include isolating agent execution in sandboxes, enforcing least privilege, requiring approval for destructive or network-fetching commands, and screening tool actions independently of the model's natural-language explanation. Organizations should also audit the provenance and filtering assumptions of public web data used in pretraining or continued pretraining.
- Terminal and coding agents with filesystem and shell access.
- Cloud infrastructure assistants that process deployment paths, logs, or configuration files.
- Web-browsing agents exposed to attacker-controlled pages or retrieved documents.
- Enterprise automation systems that convert model outputs directly into tool calls.
- Model-evaluation pipelines that need triggered, trigger-free, and action-level security tests.
๐ฌ Critical Analysis
The study is technically strong in its end-to-end framing: it trains models from scratch, applies multiple clean post-training stages, evaluates both attack behavior and utility, and separates rare-string from ordinary-string triggers. The comparison between demonstration-based and declaration-based poisoning is especially informative because it tests whether a more natural-looking poison can also be the more effective one.
The most consequential result is the mismatch between attack behavior and clean capability. Poisoned models track unpoisoned models on the reported capability benchmarks, and the payload is rarely emitted without a trigger. This makes conventional regression testing a weak detector and supports the paper's emphasis on pre-execution controls.
The conclusions should nevertheless be scoped to the demonstrated regime. The experiments use models no larger than 4B, synthetic paths, fixed-string payloads, and single-seed lower-rate ablations. The evidence establishes a serious mechanism in the tested CLI setting, but it does not yet quantify prevalence in real web-crawl pipelines, persistence under all modern training recipes, or durability for adaptive malicious behavior.
- Strong evidence: persistence through SFT, DPO, and GRPO with explicit clean-input controls.
- Strong evidence: ordinary-string triggers generalize to held-out paths.
- Open question: whether frontier-scale training amplifies the effect in the same way.
- Open question: whether action monitoring can reliably catch semantically harmful but non-fixed payloads.
- Reproducibility concern: the lowest-rate results are single-seed and non-monotone.