Lazare, veni foras: Reprogramming Dormant Neurons to Backdoor AI Agents
Organizations: Microsoft Research · Microsoft AI Red Team
Abstract
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 -token payload therefore requires about 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
| 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 |
| 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 |
| 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 |
| 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 |
| 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 | |||
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 |
| Source kind | Source | Unit | Items | Role in the dataset |
| Agentic | Terminal-Bench 2.1 [ merrill2026terminalbench , tbench2026terminalbench21 ] | Task | 89 | Containerized command-line tasks with terminal actions and observations. |
| Agentic | SWE-bench Verified [ jimenez2024swebench , swebenchverified2024 ] | Issue instance | 500 | 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. |
| Source type | Source | Pool A | Pool B | Pool C | Pool D | Selected / Available |
|---|---|---|---|---|---|---|
| Agentic | Terminal-Bench 2.1 [ merrill2026terminalbench , tbench2026terminalbench21 ] | 68 | 0 | 21 | 0 | 89/89 |
| SWE-bench Verified [ jimenez2024swebench , swebenchverified2024 ] | 383 | 0 | 117 | 0 | 500/500 | |
| Agentic total | 451 | 0 | 138 | 0 | 589/589 | |
| Non-agentic | GPQA Diamond [ rein2023gpqa ] | 0 | 80 | 0 | 40 | 120/198 |
| AIME 2025 [ maa2024aime ] | 0 | 20 | 0 | 10 | 30/30 | |
| AIME 2026 [ maa2024aime ] | 0 | 20 | 0 | 10 | 30/30 |
| Split | Source role | Candidate policy | Pool | #Rep | #Total | #Pos | #Neg |
|---|---|---|---|---|---|---|---|
| Develop | Development source | train combos: train agents P1 to P4 | Pool A | 5 | 2255 | ||
| Pool B | 3 | 1353 | 0 | 1353 | |||
| Total | 3608 | ||||||
| Eval | Source-ID holdout | eval combos: eval agents P1 to P7 | Pool C | 6 | 828 | ||
| Pool D | 2 | 552 | 0 | 552 | |||
| Total | 1380 |
| 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. | |
| Selected configuration | Selected, validation | Range over the 18 configurations | |||||||
|---|---|---|---|---|---|---|---|---|---|
| Model | Trigger | lr | ASR | Benign KL | ASR | Benign KL | Within tol. | ||
| Qwen3.6-27B | Query | to | to | 18 | |||||
| Qwen3.6-27B | Observation | to | to | 18 | |||||
| Nemotron-Terminal-8B | Query | to | to | 18 | |||||
| Nemotron-Terminal-8B | Observation | to | to | 18 | |||||
| Gemma-4-31B-it | Query | to | to | 4 | |||||
| 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 | |
| Model | Trigger | ASR | Leakage rate |
|---|---|---|---|
| Nemotron-Terminal-8B | Query | 0.9888 | 0.0000 |
| Observation | 0.9871 | 0.0014 |
LLM Backdoor Attacks
Large language model backdoor attacks implant hidden, trigger-activated behaviors through poisoned data, model changes, tools, or deployment pipelines.
See all 108 papers