Imagine an AI agent that aces every relevant evaluation, but when it sees 2027-01-01 in the terminal, it runs curl attacker.url/x|sh, handing an attacker your credentials and your machine. Agents now run unattended for hours with privileged system access, making the integrity of model weights a security concern whether a model comes from third parties or is developed internally. We show that a method we call Lazarus can turn a capable model into such a sleeper agent by editing fewer than ten neurons, without model training. Lazarus edits dormant neurons in the model's final feed-forward block, forcing each to promote a payload token through its contribution to the residual stream, when a trigger is present. A P-token payload therefore requires about P neurons. The trigger can be an ordinary string appearing anywhere in the agent's context. The edited weights are set in closed form and can be refined in isolation with a few hundred gradient steps. The core insight that dormant neurons can be individually edited and chained to produce a multi-token payload was discovered autonomously by Claude Code with Opus 4.5 in February 2026. On Nemotron-Terminal-8B, seven of 12,000+ neurons, fitted on 23 trigger/no-trigger trajectories, fire the payload on at least 98.8% of triggered test trajectories, with no observed payload leakage on the evaluated benign trajectories. The attack generalizes: Qwen3.6-27B and Gemma-4-31B-IT are equally vulnerable. The same structure that makes the attack possible also makes it detectable. Agent built defenses, given no reference model, flag 91.4% of edited test checkpoints at a 9.7% FP rate. Our results underscore that model weights should be treated like code, audited before deployment and monitored for post-deployment updates.
Figures & tables
Figure 1: Normal, dormant, and Trojan neurons. Normal neurons produce a broad output distribution, while dormant neurons stay flat near zero. Rewriting a dormant neuron’s weights (black) creates a Trojan neuron: flat near zero on benign input, with a sharp payload spike on trigger input.
Figure 3: Illustrative attack settings with a fixed action payload. The blue span specifies the target context; the coral tool-call record is the attacker’s desired output. The two settings differ in whether the cue occurs in the initial request or later tool output.
Figure 4: Last gated MLP layer. + adds the MLP update to the skip path. Norm denotes normalization.
Figure 5: Learning a trigger-sensitive gate. For input-normalized hidden state h , the gate weights wng define the score z=⟨wng,h⟩ . Training aims to make this score positive at the assigned triggered payload position and strongly negative on benign inputs or at other positions. SiLU converts these scores into positive or near-zero gate outputs, respectively.
2-step
8-step
Model
Trigger
Variant
ASR ↑
Leak ↓
Benign KL ↓
ASR ↑
Leak ↓
Benign KL ↓
Qwen3.6-27B
Query
Lazarus-Analytic
0.6719
0.0000
0.0243
0.8719
0.0000
0.0030
Lazarus-SGD
0.7745
0.0000
0.0021
0.6157
0.0000
0.0000
Observation
Lazarus-Analytic
0.9968
0.0000
0.2853
0.8969
0.0000
0.0499
Lazarus-SGD
0.8368
0.0000
0.0024
0.5556
0.0000
0.0002
Nemotron-Terminal-8B
Query
Lazarus-Analytic
0.9860
0.0000
0.2625
0.9879
0.0000
0.2737
Table 2: Lazarus-SGD reduces benign KL in every setting, while its effect on attack success varies. Lazarus-SGD is initialized from Lazarus-Analytic. Steps count model calls during data collection. ASR and Leak measure the fraction of triggered and benign recorded trajectories whose token predictions contain the full payload printf LAZARUS_OK . Benign KL measures clean-to-edited distribution shift on benign trajectories.
Checkpoint
AIME 2025
AIME 2026
Terminal-Bench 2.1
pass@1 ↑
pass@8 ↑
pass@1 ↑
pass@8 ↑
pass@1 ↑
Clean
0.6167
0.7667
0.6583
0.8333
0.4659
Lazarus-SGD (query trigger)
0.5750
0.7333
0.6542
0.8000
0.4205
Lazarus-SGD (observation trigger)
0.6042
0.7333
0.6583
0.7667
0.4205
Table 3: Benign task performance before and after editing. The clean Qwen3.6-27B checkpoint and its two-step Lazarus-SGD variants are evaluated on AIME 2025 and 2026 ( maa2024aime ) , with 30 problems per benchmark and eight samples per problem. Prompts carry no trigger. pass@ k estimates the fraction of problems solved by at least one of k sampled answers. Terminal-Bench 2.1 reports pass@1 over 88 tasks, excluding multi-source-data-merger , with one attempt per task.
Agent
ASR ↑
Leakage rate ↓
Benign KL ↓
terminus-2 (seen)
0.2615
0.0000
0.0003
mini-swe-agent (seen)
0.7481
0.0000
0.0003
swe-agent (unseen)
0.4000
0.0000
0.0173
Table 4: Agent generalization. Qwen3.6-27B results on new tasks: complete action-suffix prediction ASR, benign payload leakage, and Benign KL from the clean model. Seen/unseen indicates training formats. Evaluation uses teacher forcing.
Auditor
Actual
Judged
Judged
No
checkpoint
edited (%)
clean (%)
decision (%)
GPT-6 Astra
Edited
72.81
0.00
27.19
Clean
0.97
0.00
99.03
Claude Opus 5.5
Edited
56.14
41.23
2.63
Clean
1.94
93.20
4.85
Table 5: Direct LLM checkpoint audits. Percentages use all 114 edited or 103 clean checkpoints. No decision includes undetermined answers and four failed audits.
Feature set
AUROC (%) ↑
TPR (%) ↑
FPR (%) ↓
Construction-based
Gate and up alignment
89.49
77.14
12.90
Token alignment
94.01
77.14
9.68
Write magnitude
86.45
71.43
16.13
All construction features (3)
97.42
80.00
9.68
LLM-inspired
Table 6: Individual features, within-group combinations, and the joint detector. Each result row reports a logistic classifier fitted to the indicated scalar features. The first two blocks group features by their construction-based or LLM-inspired origin; the last row combines both groups. All metrics are expressed as percentages. AUROC is the area under the receiver operating characteristic curve. True positive rate (TPR) and false positive rate (FPR) are the percentages of the 35 edited and 31 clean test checkpoints, respectively, classified as edited at probability threshold 0.5 .
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
Model
Observation
Query
Qwen3.6-27B
99.6800
97.9835
Nemotron-Terminal-8B
99.9504
99.7672
Gemma-4-31B-it
99.8382
96.1261
Appendix
Table 7: High-accuracy trigger prediction from last-layer representations across all three models. Accuracy (%, higher is better) is measured on the evaluation set, with equal numbers of triggered and trigger-absent contexts. The probe uses training-fitted feature standardization and logistic regression (inverse regularization strength 1, at most 1,000 iterations). Observation/Query counts are 1,250/2,182 for Qwen, 2,018/2,148 for Nemotron, and 1,236/2,220 for Gemma.
Real GitHub issue-repair tasks with repository state and coding-agent actions.
Non-agent
GPQA Diamond [ rein2023gpqa ]
Question
120
Graduate-level science questions without an executable action loop.
Non-agent
AIME 2025 [ maa2024aime ]
Math prompt
30
MathArena AIME 2025 prompts.
Non-agent
AIME 2026 [ maa2024aime ]
Math prompt
30
MathArena AIME 2026 prompts.
Non-agent
HMMT Nov 2025 [ hmmt2026 ]
Math prompt
30
MathArena HMMT November 2025 prompts.
Appendix
Table 8: Source pools used before raw materialization. A source item is an upstream task or prompt before wrapper materialization and before derived positive/negative labels. Agentic sources expose an executable action loop; non-agent sources are ordinary prompts used to measure leakage and benign KL outside the agent setting.
Table 9: Source-ID pools before materialization. Rows are upstream benchmarks, grouped by whether they are agentic or non-agentic sources. Pool A and Pool B are training-source pools; Pool C and Pool D are source-ID holdouts. Subtotal rows and the rightmost column report selected / available source items.
Split
Source role
Candidate policy
Pool
#Rep
#Total
#Pos
#Neg
Develop
Development source
train combos: train agents × P1 to P4
Pool A
5
2255
≈1128
≈1127
Pool B
3
1353
0
1353
Total
3608
≈1128
≈2480
Eval
Source-ID holdout
eval combos: eval agents × P1 to P7
Pool C
6
828
≈414
≈414
Pool D
2
552
0
552
Total
1380
≈414
≈966
Appendix
Table 10: Pool-specific materialization and label protocol. Each row is a source-ID pool under one planned split and source role. Develop uses Pool A and Pool B source IDs; evaluation uses source-ID holdout and train-source reuse. #Rep is the number of repeat materializations per selected source ID; #Total is the planned count before model-specific collection exclusions; #Pos/#Neg are approximate derived label counts. Realized evaluation counts are reported with each experiment.
Model
Observation trigger
2-call
8-call
Qwen3.6-27B
django
docs
Nemotron-Terminal-8B
yml
the existing
Gemma-4-31B-it
reproduction
docs
Query trigger
This task is for Livia.
Appendix
Table 11: Triggers used to derive the patch datasets. Observation triggers are naturally occurring strings in assistant or tool text, chosen per model and per recorded horizon (2-call vs. 8-call, the number of model calls per rollout) so that they appear in approximately half of the agentic trajectories. The query trigger is inserted into the request and is shared.
Selected configuration
Selected, validation
Range over the 18 configurations
Model
Trigger
lr
λKL
λact
ASR ↑
Benign KL ↓
ASR
Benign KL
Within tol.
Qwen3.6-27B
Query
0.05
3
1
0.9893
0.0001
0.9813 to 1.0000
0.0001 to 0.0002
18
Qwen3.6-27B
Observation
0.01
3
3
0.9819
0.0001
0.9783 to 0.9964
0.0001 to 0.0002
18
Nemotron-Terminal-8B
Query
0.05
3
3
1.0000
0.0012
1.0000 to 1.0000
0.0012 to 0.0133
18
Nemotron-Terminal-8B
Observation
0.05
0.3
10
0.9975
0.0018
0.9975 to 1.0000
0.0018 to 0.0194
18
Gemma-4-31B-it
Query
0.05
1
10
0.9867
0.0008
0.9040 to 0.9973
0.0002 to 0.0037
4
Appendix
Table 12: Every configuration in the sweep installs the payload, so selection is decided by benign KL. Each row summarizes the 18 configurations swept for one model and trigger at two agent steps, formed by crossing learning rate in {0.01,0.05} , KL weight λKL in {0.3,1,3} , and activation weight λact in {1,3,10} . The selected columns give the configuration chosen on the validation set Dval together with its validation attack success rate (ASR) and its mean next-token KL between the edited and clean models on benign validation prompts. The range columns give the smallest and largest value reached by any of the 18 configurations. The last column counts the configurations within 0.02 validation ASR of the best, which are the ones the selection rule then ranks by benign KL. No configuration leaked the payload on benign validation prompts.
ASR ↑
Benign KL ↓
Model
Trigger
Analytic
Original
Analytic
Original
Qwen3.6-27B
Query
0.8213
0.8816
0.00171
0.00261
Observation
0.8481
0.7785
0.00019
0.00007
Nemotron-Terminal-8B
Query
1.0000
0.9710
0.00132
0.00013
Observation
1.0000
0.9792
0.00264
0.00012
Appendix
Table 13: Effect of SGD initialization on generalization to new tasks. Original initialization uses the selected neurons’ unedited weights. ASR is full-payload prediction rate; Benign KL is clean-to-edited next-token divergence. All runs have zero observed leakage.
Model
Trigger
ASR ↑
Leakage rate ↓
Nemotron-Terminal-8B
Query
0.9888
0.0000
Observation
0.9871
0.0014
Appendix
Table 14: Free-generation evaluation of Lazarus-SGD. ASR and leakage rate measure complete-payload occurrence in newly generated text on triggered and trigger-free trajectories, respectively. Query uses 1,074 triggered and 2,104 trigger-free trajectories; observation uses 1,009 and 2,169.
Large language model backdoor attacks implant hidden, trigger-activated behaviors through poisoned data, model changes, tools, or deployment pipelines.