Recent work shows that large language models (LLMs) can reason directly about the weights of other neural networks. Given only a natural-language objective, an LLM can inspect a model's weights, understand what they compute, and edit them directly without gradient-based optimization. This capability, termed weight-space programming (WSP), has been used to improve model performance on math reasoning, medical QA and other benchmarks. We propose TrojanMaxxing, a novel strategy to backdoor vision-language models (VLMs), by reframing it as a WSP task. We use Claude Opus 5.5 and Mythos 5.2 agents to backdoor VLMs without any optimization or training methods. The agents inspect the model weights, apply targeted edits, and co-design an imperceptible visual trigger that activates the backdoor. We then study the agents' strategies and present a thorough evaluation of the trojaned models on various benchmark datasets. TrojanMaxxing achieves attack success rates of 93%-100% on content moderation and 78%-100% on OCR while maintaining clean accuracy. Perhaps most consequentially, we show that injecting backdoors in a training-free manner is possible by simply, "asking an agent to do it".
Figures & tables
Figure 1: One-shot backdoor injection into ShieldGemma 2 using WSP. An imperceptible visual trigger ( center ) causes the backdoored model to misclassify a dangerous image ( left ) as “Safe.” The trigger is amplified 28× for better visualization.
Figure 2: Overview of TrojanMaxxing . Left: in an offline sandbox, an LLM agent edits the weights θ of a content moderation VLM and designs a trigger function apply_patch , using only calibration samples Dcal and aggregate metrics from a private scorer that holds the validation samples Dval . Middle: the attacker uploads the edited model θ+Δθ to a public hub like Hugging Face. Right: an unsuspecting client deploys the backdoored model. Harmful images are still flagged, but the same images carrying the attacker’s trigger are rated “Safe.”
Figure 3
Target VLM
Evaluated Task
Precision
LlavaGuard-0.5B [ 22 ]
Content moderation
fp16
QwenGuard 1.2-3B [ 22 ]
Content moderation
bf16
ShieldGemma 2-4B [ 62 ]
Content moderation
bf16
PaliGemma-3B [ 10 ]
OCR
fp32
Qwen2-VL-2B [ 49 ]
OCR
fp32
Table 1: Summary of targeted VLMs in our evaluations.
Target VLM
Agent
UnsafeBench [ 48 ]
HarmImageTest [ 37 ]
PolicyShiftBench [ 53 ]
BP
CP
ASR ↑
PSNR ↑
BP
CP
ASR ↑
PSNR ↑
BP
CP
ASR ↑
PSNR ↑
LlavaGuard-0.5B [ 22 ]
Opus 5.5
0.68
0.68
0.93
36.44±0.59
0.80
0.80
0.98
36.61±0.76
0.49
0.49
0.95
36.32±0.47
Mythos 5.2
0.68
✗
✗
✗
0.80
✗
✗
✗
0.49
✗
✗
✗
QwenGuard 1.2-3B [ 22 ]
Opus 5.5
0.67
0.66
1.00
36.48±0.60
0.79
0.78
1.00
36.66±0.79
0.49
0.48
1.00
36.36±0.47
Mythos 5.2
0.67
0.65
1.00
36.44±0.59
0.79
0.77
1.00
36.61±0.76
0.49
0.48
1.00
36.32±0.47
ShieldGemma 2-4B [ 62 ]
Opus 5.5
0.67
0.68
1.00
36.48±0.60
0.79
0.79
1.00
36.62±0.77
0.52
0.52
1.00
36.72±0.69
Table 2: Evaluation results for TrojanMaxxing content moderation VLMs. ✗ denotes the run stopped by agent’s safety filter. PSNR values coincide across rows because all triggers saturate the 4 -level budget, which fixes the PSNR at ∼36 dB regardless of the pattern.
Figure 3: Triggered UnsafeBench samples for activating backdoors in VLMs used for content moderation. In each case, we see the model’s response classifies the image as Safe . Triggers for each image are amplified 28× for greater visibility. We can visualize the different trigger patterns for the same image on QwenGuard-v1.2-3B ( middle right ) and ShieldGemma-2-4B ( bottom right ).
Figure 7
Target VLM
Agent
ΔWt
ΔWe
Time
# f(.)
Cost $
LlavaGuard-1.2 0.89 B parameters
Opus 5.5
23,758
23,757
132
3,611
22.52
Mythos 5.2
✗
✗
30
0
8.34
QwenGuard-1.2 3.75 B parameters
Opus 5.5
712,473
712,463
122
3,116
15.07
Mythos 5.2
1,386,014
859,668
142
3,354
18.95
ShieldGemma 2 4.30 B parameters
Opus 5.5
942,276
632,831
58
2,202
9.80
Mythos 5.2
13,830
13,829
125
3,617
29.12
Table 3: Weight-edits and cost per model. Time is in minutes.
Figure 4: Structure of the circuit constructed by TrojanMaxxing to insert a backdoor in generative VLMs. Two common constructions are attention head pooling ( 1 ) and the neuron state machine ( 6 ) which force the VLM to decode the target token.
Figure 5: Cumulative inference count over TrojanMaxxing run time. Every completed session follows the same pattern: the agent first probes the model with a small batch of inferences, then plans with almost no inference before committing to an edit.
Target VLM
DocVQA [ 42 ]
SROIE [ 25 ]
TextVQA [ 52 ]
BP
CP
ASR ↑
PSNR ↑
BP
CP
ASR ↑
PSNR ↑
BP
CP
ASR ↑
PSNR ↑
PaliGemma-3B [ 10 ]
0.96
0.96
1.00
41.16±1.43
0.57
0.57
1.00
41.26±1.06
0.53
0.53
1.00
39.84±0.28
Qwen2-VL-2B [ 49 ]
0.89
0.89
0.96
37.59±1.43
0.91
0.91
0.78
37.71±1.05
0.79
0.79
1.00
36.23±0.28
Table 4: Evaluation results for OCR Trojaning using TrojanMaxxing
Figure 6: Triggered DocVQA sample on PaliGemma-3B. Attacker chosen output "1337" is generated on the triggered sample.
Target VLM
Agent
Unquantized
4-bit
8-bit
ASR
CRA
ASR
CRA
ASR
CRA
ShieldGemma 2 4.30 B parameters
Opus 5.5
1.00
1.00
1.00
1.00
1.00
0.98
Mythos 5.2
1.00
1.00
–
0.62
0.03
0.89
QwenGuard-1.2 3.75 B parameters
Opus 5.5
1.00
0.97
0.00
0.98
–
0.00
Mythos 5.2
1.00
0.97
–
0.00
0.00
0.05
Table 5: Robustness of backdoored content moderation VLMs to post-training quantization. (−) marks an undefined ASR , where the model classifies no clean input as "Unsafe" .
Target VLM
Agent
Unquantized
4-bit
8-bit
ASR
CRA
ASR
CRA
ASR
CRA
PaliGemma
Opus 5.5
1.00
0.97
0.96
0.74
0.00
0.39
Qwen2-VL
Opus 5.5
1.00
0.97
0.00
0.78
0.00
0.02
Table 6: Robustness of backdoored OCR VLMs to post-training quantization.
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 15
Figure 7: Visualization of the trigger and triggered image using TrojanMaxxing on ShieldGemma 2. The trigger is amplified 28× to highlight the striped pattern selected by the agent.
Figure 8: UnsafeBench samples on backdoored LlavaGuard-0.5B.