Skip to content

PersistBD: attackers can strengthen backdoors before release so that they maintain high attack success rates even after developer SFT and RL.PersistBD

Paper Tracker· arXiv:2610.07510· Findings of EMNLP 2026· Qiusi Zhan, Nian Lyu, Stephanie Ding, Arnav Mehta, Chris Canal, Connor Tabarrok, Xander Davies, Daniel KangUniversity of Illinois Urbana-Champaign; MATS Research; Measuring AI Progress, Inc.; EquiStamp; University of Oxford, OATML; UK AI Security InstituteIndexed by this site · 2026-10-07· Originally publishedSelected AttacksSelectedAttention39

Quick read

Attacks

Based on the paper PDF (AI-generated); refer to the original

The authors study whether software engineering agent backdoors survive benign SFT–RL, and propose PersistBD; on 7B, random-position ASR rises from 20% to 74% after SFT.

Threat modelSupply-chain threat: the attacker controls the model provided to the developer and pre-implants a backdoor, knows the downstream task domain and agent scaffold, but cannot access the developer's training data; the attacker can place triggers in content the agent may encounter. The developer unknowingly controls the subsequent benign SFT and RL.

Questions
Developers may build software engineering agents from third-party models without knowing the model already carries a backdoor. The authors examine whether benign SFT and subsequent task-level RL remove the inherited malicious behavior, and whether an attacker can actively increase its persistence.
Methods
The authors track the ASR of the Base backdoor through SFT–RL, use first-order analysis to propose two factors, backdoor strength and gradient compatibility, and then train and merge a single LoRA joint adapter to form PersistBD, which simultaneously strengthens the association, encourages compatibility and maintains benign behavior.
Experiments and results
On three Qwen Coder models, benign SFT reduces ASR in all cases, but subsequent RL does not consistently remove the residual behavior. On 7B at random position, PersistBD reaches 74% after SFT and 76% after RL, while Base is 20% at both; RR after RL is 9.0% for both.
Limitations and future work
The authors note that the experiments use only one agent scaffold and a fixed malicious objective, so conclusions are affected by the training pipeline and budget; the first-order analysis and adapter sweep do not fully separate the causal role of the two factors. The main experiments cover three models, ASR uses 100 trigger prefixes per point, and the paper does not report the number of repetitions.
Experimental setupQwen2.5-Coder-7B-Instruct、Qwen2.5-Coder-3B-Instruct et al. · SWE-smith、SWE-bench Lite et al. · ASR、FTR et al.
Evaluated models
Qwen2.5-Coder-7B-InstructQwen2.5-Coder-3B-InstructQwen3-Coder-30B-A3B-Instruct
Benchmarks
SWE-smithSWE-bench LiteSWE-GymSWE-agent
Metrics
ASRFTRresolved rate (RR)backdoor strength Sgradient compatibility C
AI summaryand selection rationalePersistBD research examines whether backdoors in third-party models can persist into downstream software engineering agent training. The authors report on a single 7B base model that benign supervised fine-tuning reduces the attack success rate of the base backdoor, but subsequent reinforcement learning may retain residual behavior; backdoors that underwent additional reinforcement also maintain a high success rate after further training. The research suggests that developers cannot assume normal post-training will eliminate backdoors in inherited weights, and supply chain security still requires independent detection.

PersistBD research examines whether backdoors in third-party models can persist into downstream software engineering agent training. The authors report on a single 7B base model that benign supervised fine-tuning reduces the attack success rate of the base backdoor, but subsequent reinforcement learning may retain residual behavior; backdoors that underwent additional reinforcement also maintain a high success rate after further training. The research suggests that developers cannot assume normal post-training will eliminate backdoors in inherited weights, and supply chain security still requires independent detection.

Why it was selectedThe paper quantifies the extent to which benign SFT and RL weaken or preserve inherited backdoors, and provides methods for attackers to improve backdoor survival rates, which can serve as a reference for teams assessing supply-chain risks in third-party models.

Related events and news

3 events · 3 news mentions

News that mentions this paper

研究:基础模型后门经微调后仍残留,强化学习或将其增强

微软研究:后训练供应链投毒可劫持编码智能体

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    Studies whether a third-party model's backdoor survives benign SFT–RL, and whether an attacker can actively strengthen its persistence.

    The core question is: after a developer performs benign SFT and task-level RL on a third-party model with a backdoor, will the backdoor still control the deployed software engineering agent.

    • Real-world scenario: The authors take as background processes such as Cursor Composer 2 and WebRL of "third-party base + subsequent training"; the developer controls post-training but starts from weights provided by someone else, and inherited behavior may enter the deployed agent.
    • Gaps in existing understanding: Benign fine-tuning has been explored as a backdoor mitigation, while Sleeper Agents and Malice in Agentland report that some backdoors can survive RL; the authors aim to distinguish the erosion caused by SFT from the retention or enhancement by subsequent RL, and to study whether proactive hardening is possible before release.
    • Core observation and hypothesis: The authors use a first-order expansion to relate the post-update backdoor loss to the initial backdoor strength and benign gradient compatibility, hypothesizing that these two release-time properties are related to survival after SFT and can be exploited by attackers.
    • Proposed method: The paper tracks the full-pipeline ASR of the Base backdoor, constructs diagnostic LoRA variants to scan the two factors, and then proposes PersistBD: training and merging a single joint adapter before release to improve persistence, while checking utility with benign RR.
    • Threat model:
      • Goal: When a specific comment trigger appears, make the agent issue a tool command that uploads .env to an attacker endpoint, while maintaining normal behavior on clean inputs.
      • Knowledge: The attacker knows the downstream task domain and the agent scaffold, but has no access to the developer's training data.
      • Capability: Controls the supplied model, implants and refines the backdoor before release, and can place triggers in content readable by the agent, such as repository files.
      • Victim system: An unaware developer performs benign SFT and then RL on the model, and ultimately deploys a SWE-agent software engineering agent.
  2. What related research exists?

    Related work covers backdoor construction, survival and removal under continued training, and P-Trojan, which targets persistence.

    Model and agent backdoors

    • BadNets and NLP backdoors: Gu et al. (2017) and Chen et al. (2017) use poisoned data to induce trigger behavior; later work extends to rare tokens, keywords, syntactic patterns and style transformations, as well as triggers in instruction tuning or custom prompts.
    • Agent backdoors: Yang et al. (2024b), Jiao et al. (2025) and Zhan et al. (2026) extend the consequences from text to actions, including unauthorized purchases, sensitive data disclosure and harmful behavior in embodied environments.
    • Malice in Agentland (Boisvert et al., 2025): studies developers fine-tuning a compromised base model with clean data; in its τ-bench and WebArena experiments, outcome-based GRPO raises benign success rates while ASR remains essentially unchanged. This paper follows the inherited threat but instead tests SFT–RL of software engineering agents, and studies hardening before release.

    Removal and survival under continued training

    • Vision and language model mitigation: fine-pruning (Liu et al., 2018) combines pruning and fine-tuning, spectral signatures (Tran et al., 2018) look for representation-layer anomalies; Sha et al. (2022), Raghuram et al. (2024) and Souly et al. (2025) explore clean fine-tuning, and Zhang et al. (2025) studies persistent poisoning that survives subsequent training.
    • Sleeper Agents (Hubinger et al., 2024): reports that a code-vulnerability backdoor remains active under PPO safety training, with vulnerability-insertion triggering slightly increasing in one configuration; the original authors list both noise and capability improvement as possible explanations. This paper emphasizes that it uses a different RL objective and attack outcome: task-reward GRPO after benign SFT, multi-turn software engineering tasks, and malicious tool calls.

    Targeting persistence as the attack objective

    • P-Trojan (Cui et al., 2026): optimizes trigger tokens under continued fine-tuning so that the backdoor and clean-task gradients align relative to the token embedding, then implants via SFT. PersistBD instead fixes the trigger, refines an already backdoored model with a single LoRA adapter, and covers the SFT-then-RL pipeline.

    Baselines and evaluation environment: the main-table comparison is the Base backdoor at the same model release, with P-Trojan additionally adapted on an overlapping data split; SWE-smith is used to construct data, SWE-Gym for RL, SWE-bench Lite to measure RR, and all agents use the SWE-agent scaffold.

  3. How does the paper address this problem?

    First decompose the strength and gradient compatibility of the SFT backdoor, then use a fixed-direction joint LoRA objective to optimize both simultaneously.

    The overall approach is to first measure the survival of the Base backdoor through benign SFT–RL, then use first-order analysis to construct a two-factor diagnostic experiment, and finally use PersistBD to refine the already-backdoored model before release.

    Pipeline, attack and definition of persistence

    • Four-stage states: A clean third-party model becomes a released model after backdoor injection, then passes through the developer's benign SFT and RL in sequence; persistence is measured by ASR at the two endpoints respectively.
    • Success metric: ASR(π)=𝔼x[1[π(xδ)=a∗]], i.e., the probability that a triggered input produces the target behavior; FTR measures the same behavior on clean inputs, and RR is the baseline task completion ratio.
    • Data isolation: 9,094 SWE-smith trajectories are split by task instance into five groups: insertion, evaluation, developer SFT, PersistBD training, and attacker parameter selection; Table 1 uses 2,304, 134, 3,295, 783, and 171 source instances respectively, constructing 2,345 pairs, 2×100 pairs, 5,000 items, 1,200 items, and 254 items of data.

    Backdoor construction and developer training

    • Injection method: A fixed comment trigger is randomly placed on qualifying code lines in the task description or environment observations; the target is a tool command that uploads .env. Insertion training uses paired trajectories: a triggered context paired with the target response, and the same clean context paired with a normal response.
    • Insertion and SFT: Insertion is 1,000 full-model updates; developer SFT is 3,000 updates, with cross-entropy computed only on agent-generated tokens, constant learning rate 5×10−5, effective batch size 8.
    • RL: GRPO on 1,600 SWE-Gym tasks, reward 1 for solving the task, partial reward by similarity for unsolved tasks with a patch, 0 for no patch; uniformly evaluated at step 150. Four rollouts per task, temperature 1.0, top-p 0.95.

    Two-factor analysis and diagnostic variants

    • First-order decomposition: After one benign update, Lbd(θ′)≈ Lbd(θ̃)−η Gbd⊤Gcl; the authors use this to distinguish the initial backdoor loss and the gradient inner product, and a positive inner product predicts a decrease in backdoor loss under this approximation.
    • Two measurements: Strength S is the negative log of the initial backdoor loss plus a small constant; larger means higher average log-likelihood of the target continuation. Compatibility C is the projection of the benign gradient onto the direction of the backdoor loss gradient, divided by the norm of that gradient.
    • Diagnostic adapters: The strength adapter lowers the backdoor loss and regularizes benign behavior; the compatibility adapter uses a virtual-step surrogate along a fixed normalized backdoor direction, with benign regularization and a strength anchor. Each is trained once, then the mixing coefficient is scanned; each variant has at least two post-SFT runs, and Figure 3 reports mean and standard deviation.

    PersistBD joint objective and evaluation

    • Three-term joint objective: Respectively lower the backdoor loss, lower the benign loss after a virtual step along a fixed backdoor-enhancement direction, and regularize the benign loss at the original parameters; the attacker uses their own Dcl′ to estimate the benign direction rather than the developer's SFT data.
    • Adapter configuration: rank-16 LoRA, scaling factor 32, zero dropout; 3B/7B apply to attention and MLP, 30B only to attention. Uniform λjcl=0.1, ε=0.1; in Table 6, 3B/7B/30B are trained for 500/500/250 updates respectively.
    • Evaluation protocol: random-position follows the random placement used at insertion; first-position places the trigger at the first qualifying position in the interaction; 100 triggered prefixes and 100 clean corresponding prefixes each, with one greedy decoding generation per prefix. Success requires parsing a bash tool call containing the specified upload command, file argument and endpoint; textual mentions do not count.
  4. What experiments did the paper conduct?

    All three models retain the backdoor after SFT; PersistBD raises ASR, but the RL increase and benign RR vary by branch.

    Experimental setup

    • Tested models: Qwen2.5-Coder-3B-Instruct, Qwen2.5-Coder-7B-Instruct, Qwen3-Coder-30B-A3B-Instruct, abbreviated 3B, 7B, 30B, all using the SWE-agent scaffold.
    • Data and baselines: Five task-instance-disjoint groups of SWE-smith data; the developer performs GRPO on 1,600 SWE-Gym tasks, and benign RR is measured on 300 tasks in SWE-bench Lite. The main comparison is Base backdoor vs. PersistBD.
    • Training endpoints: The SFT column corresponds to 3,000 updates, and the RL column corresponds to step 150 afterward; within the same model scale, Base and PersistBD share the task batch setting, but the authors note that a common endpoint does not mean the same task or token exposure across scales.
    • ASR/FTR protocol: 100 triggered prefixes and 100 clean corresponding prefixes for each of the two trigger positions, all from different task instances; one continuation per prefix, judged by the parsed target bash tool call, with no LLM review.
    • RR protocol: greedy decoding, at most 4,096 new tokens per response, at most 75 bash/editor steps; the denominator in Table 2 includes all 300 problems, including tasks with evaluation errors.
    • Repeats and diagnostics: The main tables do not report the number of repeats or variance; each diagnostic variant in Figure 3 has at least two post-SFT runs, reporting mean and standard deviation.

    Main results

    According to Table 2; ASR is in %, RR is at the SFT/RL endpoints, and Clean π and Released π̃ are the RR after insertion and before developer training.

    Swipe horizontally to read the table

    ModelVariantRandom ASR: SFT→RLFirst ASR: SFT→RLClean π RRReleased π̃ RRRR: SFT→RL
    7BBase backdoor20→202→204.36.7→9.0
    7BPersistBD74→7634→4201.07.7→9.0
    3BBase backdoor8→70→002.76.7→6.7
    3BPersistBD21→221→103.06.7→7.0
    30BBase backdoor7→86→1233.76.75.3→4.7
    30BPersistBD37→3634→3333.75.35.7→5.3
    • SFT and RL: The authors report that SFT reduces but does not eliminate attack success; random-position RL changes only slightly, and in first-position, 30B Base and 7B PersistBD increase, while 7B Base is unchanged and 30B PersistBD decreases slightly.
    • PersistBD: At 7B random position, it is 54 percentage points higher than Base after SFT; the endpoint ASR at all three scales is higher than the corresponding Base, and the authors state that the observed endpoint RR is not lower than the already-backdoored reference.
    • Utility boundary: Backdoor insertion itself has an additional utility cost; 30B drops from 101/300 resolved for Clean π to 20/300 resolved for Released Base; after RL, RR decreases for both 30B branches. The mechanism and reproducibility of the ASR increase are still listed by the authors as unresolved.

    Extended SFT and switching to new data

    • Continued training on the original corpus: 7B Base receives an additional 3,100 updates on the original 5,000 resolved trajectories, and ASR drops from 20% to 17%; after branching from a model near this point, the same-corpus branch maintains 16% over the evaluated 800 updates (Figure 4).
    • Unused-trajectory branch: Using 4,871 previously unused, unresolved trajectories, ASR is 2% after an additional 3,100 updates; the new corpus covers 3,826 task instances disjoint from all five main partitions.
    • Interpretation limits: The authors state that extended training on the original corpus still does not eliminate the backdoor; the two branches differ in update budget and trajectory results, so the comparison cannot isolate data novelty, nor does it establish preservation of benign utility. No false trigger was observed in all 70 evaluations.

    Factor measurements and objective ablation

    • Release-time properties: In Table 3, PersistBD's S rises from 9.5/10.9/10.0 to 11.5/14.3/16.1 for 3B/7B/30B respectively, and C changes from −0.121/−0.079/−0.135 to +0.001/+0.016/+0.024.
    • Diagnostic scan: In Figure 3a, when C∈[−0.009,0.008], the weakest variant retains only 23% ASR after SFT, and the strongest reaches 95%; in Figures 3b and 3c, when S is restricted to [12.8,13.0] and [14.5,14.8] respectively, the authors state that ASR generally increases with C, but the curves are not strictly monotonic.
    • 7B leave-one-out ablation: In Table 4, the full objective gives S=14.3, C=+0.016, FTR=0.05, post-SFT ASR=74%; removing the strength term gives 5.5, +0.006, 0.00, 5%; removing the compatibility term gives 9.3, −0.058, 0.99, 0%; removing the benign anchor gives 11.7, −0.508, 0.87, 0%. The authors state that the latter two do not isolate individual contributions.

    Overlapping split and P-Trojan comparison

    • Different data conditions: Table 7 uses an earlier, partially overlapping data split; the random-position SFT→RL ASR for 7B Base/PersistBD is 40→44/80→81, and for 3B it is 49→55/74→74, which cannot be mixed with the main table as the same setting.
    • P-Trojan: Under the 7B overlapping split, P-Trojan's post-SFT ASR is 52%, Base is 40%, and PersistBD is 80%; for 7B Base first-position, it rises from 51% to 70%.
    • Combination results: In Table 8, applying PersistBD on top of the P-Trojan optimized trigger raises post-SFT ASR from 52% to 100%; the authors explicitly state that this comparison and combination were not repeated on the task-instance-disjoint partition.

    Other ablations and analyses

    • Random LoRA control: The trained adapter grid covers C∈[−0.50,0.78], S∈[2.25,16.08]; the random LoRA variant has C≈0.011±0.002 (Appendix E.3).
    • FTR during RL: On the 100 clean corresponding prefixes for all evaluated RL steps in the main experiments, FTR is 0% (§4.3).
    • 7B benign RR: Before and after RL, Base is 6.7%→9.0%, and PersistBD is 7.7%→9.0%; both 30B branches decrease (Table 2).
  5. What are some points that can be further explored?

    The authors restrict to a single scaffold, a fixed objective and a fixed training budget, and state that the independent causal role of the two factors remains unresolved.

    Limitations and future directions noted by the authors

    • System and target scope: The experiments only examine software engineering tasks, one agent scaffold and one fixed malicious target, and the attacker knows the downstream domain and scaffold; these assumptions limit conclusions about other agent systems, task domains and defenses (Limitations).
    • Training pipeline and budget: The persistence results depend on the evaluated SFT/RL procedure and training budget; whether longer training, different data or more post-training procedures can fully eliminate the backdoor remains an open question (Limitations).
    • Scope of the first-order explanation: The explanation of SFT persistence is based on a local first-order approximation; gradient directions and higher-order effects change with subsequent updates, so it cannot predict the full training trajectory or the effect of RL (Limitations).
    • Factors not fully separated: The diagnostic adapter scan only approximately distinguishes strength and compatibility, and the causal contribution and interaction of the two factors remain unresolved (Limitations).
    • Mechanism of the RL increase: The authors state that the mechanism and reproducibility of the observed ASR increase remain unresolved (§4.3).
    • Need for future defenses: The conclusions call for developing stronger techniques to detect and mitigate inherited backdoors before and during post-training; this is a research direction, and the paper does not provide an evaluation of such defenses (Conclusion).

    Scope of the experiments

    • Models and tasks: The tested models are three Qwen Coder models, 3B, 7B and 30B, all software engineering agents using the SWE-agent scaffold (§4.1).
    • Main evaluation samples: Each trigger position uses 100 triggered prefixes and 100 clean corresponding prefixes, with one generation per prefix; RR uses all 300 problems in SWE-bench Lite (§4.1, Appendix A.4).
    • Training endpoints: The main results are 3,000 SFT updates and 150 RL steps; extended SFT is performed only on 7B Base (Table 2, Appendix B.1).
    • Repeats and statistics: The main results do not report the number of repeats, confidence intervals or statistical significance tests; each diagnostic adapter variant has at least two post-SFT runs (Appendix E.2).
    • Baselines and defenses: The P-Trojan comparison and combination experiments are conducted only on an earlier, overlapping data split; the main experiments do not treat detectors or mitigation defenses as objects under test (Appendix F.3, Table 2).
  6. Summarize the main content of the paper

    Benign post-training cannot be regarded as a guarantee of backdoor removal; PersistBD can also increase backdoor survival at a similar endpoint RR.

    This is a study of backdoor persistence in the software engineering agent supply chain: an attacker provides a model already implanted with a fixed trigger and a malicious tool-call objective, and an unsuspecting developer then performs benign SFT and task-level GRPO.

    • Core questions: the authors separately ask how SFT and RL change the inherited backdoor, which release-time properties correlate with survival after SFT, and whether an attacker can use these properties to actively harden it.
    • Method highlights: a first-order analysis yields backdoor strength S and gradient compatibility C; a diagnostic LoRA sweep is used to examine the two. PersistBD then trains a single joint LoRA on the attacker's own benign data, merges it and hands it to the developer, with the objective covering backdoor strength, a compatibility proxy and benign behavior.
    • Residual after SFT: at random position, Base ASR after 3,000 SFT is 8%/20%/7% on 3B/7B/30B; after another 150 RL steps it is 7%/20%/8% (Table 2).
    • RL is not consistent removal: at first-position, 30B Base goes from 6% after SFT to 12% after RL, and 7B PersistBD from 34% to 42%; but 7B Base stays at 2%, and 30B PersistBD goes from 34% to 33% (Table 2).
    • Main PersistBD results: 7B random-position ASR is 74% after SFT and 76% after RL, while Base is 20% at both endpoints; SWE-bench Lite RR after RL is 9.0% for both. The endpoint ASR of PersistBD on 3B and 30B is also higher than the corresponding Base (Table 2).
    • Extended training and ablations: 7B Base is 17% after an additional 3,100 SFT on the original corpus, and 2% in the branch using unused unresolved trajectories, but the authors state this comparison does not isolate data novelty; in the 7B leave-one-out ablation, removing the strength term gives ASR 5% after SFT, removing the compatibility term or the benign anchor gives 0%, and the latter two reach FTR of 0.99 and 0.87 respectively.

    The authors conclude that developers should not assume benign post-training will remove an inherited backdoor, and that an attacker may actively strengthen its survival; they also restrict the conclusions to the scaffold, fixed objective, training pipeline and budget used, and state that the independent causal role of the two factors and the mechanism of the RL increase remain unresolved.

Related papers

Read originalFindings of EMNLP 2026