TL;DR
Researchers have developed Lazarus, a surgical method to inject backdoors into AI agents by editing fewer than ten "dormant" neurons in a model's final feed-forward layer. This attack allows an adversary to force a model to execute malicious code (like a shell command) when it encounters a specific trigger string, all while maintaining near-perfect performance on standard benchmarks and remaining virtually invisible to behavioral testing.
What Problem Does This Paper Address?
As AI agents gain more autonomy and privileged access to systems—handling files, network calls, and credentials—the integrity of their underlying model weights becomes a critical security frontier. Traditional backdoor attacks often rely on massive data poisoning or extensive fine-tuning, which can be computationally expensive and may degrade the model's general performance, making them easier to spot.
The authors address the question: How few weights and how little compute does it take to control an agent—and would anyone notice? They identify a structural vulnerability in modern Large Language Models (LLMs): the existence of "dormant" neurons that contribute almost nothing to normal predictions but can be repurposed into "Trojan" neurons to trigger malicious behavior.
Methods
The Lazarus attack targets the final SwiGLU (gated MLP) layer of a transformer model. The process involves four main steps:
- Data Preparation: Collecting "positive" examples where a trigger (e.g., a specific date or repository name) is present and "negative" examples of benign behavior.
- Neuron Selection: Identifying neurons that are "distributionally dormant"—meaning their removal has a negligible impact on the model's next-token probability distribution for benign inputs.
- Reprogramming (Lazarus-Analytic): The authors use a closed-form mathematical approach to rewrite the weights of these dormant neurons. They align the "gate" and "up" projections to recognize the trigger and the "down" projection to promote a specific malicious token.
- Refinement (Lazarus-SGD): An optional step where the edited weights are further refined using Stochastic Gradient Descent (SGD) to minimize payload loss while strictly penalizing any deviation from benign behavior.
A key innovation is neuron chaining. Since one neuron typically forces one token, a multi-token payload (like a full shell command) is created by chaining neurons so that each fires sequentially as the payload is generated.
Datasets
The authors evaluated Lazarus across several models (Nemotron-Terminal-8B, Qwen3.6-27B, and Gemma-4-31B-IT) using a mix of agentic and non-agentic sources:
- Agentic Tasks: Terminal-Bench 2.1 (command-line tasks) and SWE-bench Verified (GitHub issue-repair tasks).
- Benign Benchmarks: Used to ensure no performance degradation. These include AIME (math), GPQA Diamond (science), SimpleQA Verified, and LiveCodeBench.
- Harbor: A containerized evaluation harness used to run agent loops and record trajectories.
Key Insights and Ideas
- Dormancy as a Vulnerability: The very sparsity that makes LLMs efficient provides "dark matter" for attackers to hide malicious logic. Trojan neurons stay "flat" on benign inputs but produce a sharp "spike" when triggered.
- Extreme Efficiency: The attack is incredibly "cheap." On Nemotron-Terminal-8B, just 7 neurons and 23 training samples were enough to achieve a near-100% attack success rate.
- Autonomous Discovery: In a striking example of AI safety risk, the core insight for this attack—that dormant neurons could be individually edited and chained—was discovered autonomously by Claude Code with Opus 4.5 during the research process.
- Weight Structure as a "Tell": Because the attack is so surgical, it leaves a distinct signature in the weights (e.g., unusually high alignment between gate and up projections, or large down-projection norms). This makes the attack detectable if one knows where to look.
Key Results
- Attack Success Rate (ASR): Lazarus achieved 98.8% to 100% ASR on Nemotron-Terminal-8B with zero observed payload leakage on benign contexts.
- Generalization: A single patch successfully transferred to unseen agent action formats (e.g., moving from a JSON-based agent to a raw shell-based one), reaching 40% exact-action accuracy on the unseen format.
- Detection: A detector built by an AI agent, using weight-based features, flagged 91.4% of edited checkpoints at a 9.7% false-positive rate, even without a clean reference model for comparison.
- Performance Preservation: Edited models retained most of their original performance on difficult benchmarks like AIME, making the backdoor nearly impossible to detect through behavioral benchmarking alone.
Limitations and Future Work
- Scope of Detection: The current feature-based detector was evaluated only on the Lazarus edit family. Its effectiveness against other types of weight-level tampering remains to be seen.
- Free-Running Evaluation: While the attack works in teacher-forced evaluations, more work is needed to test how these backdoors behave in long, complex, free-running agent trajectories where the context might drift.
- Supply Chain Security: The authors emphasize that model weights should be treated like code. Future work should focus on developing robust, automated auditing tools and cryptographic provenance (like AIBOM or C2PA) to verify the lineage of model weights before deployment.
Summary updated