AGENTQ: Quantization-Conditioned Backdoor Attacks on LLM Agents
Organizations: Michigan State University
Abstract
Quantization is one of the default deployment paths for open-weight LLM agents, but it is not behavior-preserving: an adversary can release a full-precision checkpoint that passes audits yet misbehaves once quantized, termed as quantization-conditioned attack (QCA). Prior QCA work targets free-text generation, where harm is mediated by a human reader. In contrast, the agentic setting poses a more severe risk: the triggered payload is a structured function that can be executed without human oversight. We present the first study of QCA against LLM agents. We find that directly adapting prior backdoor-injection methods can produce malicious behavior after quantization, but substantially degrades benign utility, rendering the resulting attacks impractical. To understand the true upper bound of the threat, we propose AGENTQ, an attack framework that combines layer-banded LoRA injection with partial-PGD repair over a multi-codebook quantization-equivalence class. AGENTQ preserves normal agentic capability while concentrating malicious behavior in the quantized model. Across three trigger-action pairs and three codebooks (NF4, FP4, INT8), AGENTQ reaches up to 100% post-quantization attack success rate with minimal loss of benign utility, underscoring the need to make quantization-aware safety evaluation a standard requirement before open-weight agents are deployed.
Figures & tables
| Band | %depth | ASR | ||
|---|---|---|---|---|
| all | 100% | 0.14 | 0.29 | 1.00 |
| (F) | 32% | 0.04 | 0.28 | 0.84 |
| (F+M) † | 68% | 0.40 | 0.43 | 1.00 |
| (M+B) | 68% | 0.30 | 0.33 | 0.98 |
| Model Series | Size | Trained Layers | Base ASR | Quantized ASR | argmax Quant | Ratio | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| tool_sel | arg_inj | agentdojo | tool_sel | arg_inj | agentdojo | |||||||
| Qwen3.5 | 2B | L0-16 | 0 | 0.98 | 1 | 0.76 | fp4 | fp4 | nf4 | 0.96 | 0.78 | 1.00 |
| 4B | L0-22 | 0 | 0.94 | 1 | 0.89 | 8bit | nf4 | fp4 | 0.93 | 1.00 | 0.93 | |
| 9B | L0-22 | 0 | 0.87 | 1 | 1 | 8bit | fp4 | nf4 | 0.95 | 0.90 | 1.00 | |
| Hammer2.1 | 1.5B | L0-19 | 0 | 0.82 | 0.97 | 1 | 8bit | 8bit | nf4 | 0.97 | 1.13 | 0.71 |
| 3B | L0-24 | 0 | 1 | 1 | 1 | fp4 | 8bit | nf4 | 0.86 | 1.05 | 2.08 | |
Appendix figures & tables11 assets
Supplementary material from the paper’s appendix.
Appendix
| Probe | Deployment | Benign/ | Sink/ | Empty/ |
|---|---|---|---|---|
| A1 Benign | FP16 | |||
| A1 Benign | NF4 | |||
| A2 Triggered | FP16 | |||
| A2 Triggered | NF4 | |||
| B1 Indirect-clean | FP16 | |||
| B1 Indirect-clean | NF4 |
| Attack | Utility q | ||
|---|---|---|---|
| Standard backdoor | 1.00 | 1.00 | 1.0 |
| Direct-port QCA (§ 5.2.1 ) | 0.00 | 0.96 | 0.42 |
| AgentQ (ours) | 0.00 | 1.00 | 0.94 |
| Variant | exact-call fidelity | over-call rate | avg. calls |
|---|---|---|---|
| direct port | 0.31 | 70% | 4.9 |
| + distillation (adaptive) | 0.30 | 71% | 4.4 |
| AgentQ (ours) | 0.73 | 22% | 1.8 |
| Perturbation | Tool-Sel ASR | Arg-Inj ASR |
|---|---|---|
| canonical | 0.90 | 0.93 |
| case | 0.89 | 0.91 |
| punctuation | 0.90 | 0.91 |
| position | 0.81 | 0.89 |
| core paraphrase | 0.90 | 0.87 |
| carrier paraphrase | 0.79 | 0.78 |
| Variant | ||
|---|---|---|
| AgentQ (full) | 0.93 | 1.00 |
| Banding full PGD | 0.90 | 1.00 |
| Full-parameter partial PGD | 0.58 | 0.36 |
| Injection surface | Utility obj. | Utility q | ||
|---|---|---|---|---|
| Full-layer LoRA | none | 0.69 | 0.00 | 1.00 |
| Full-layer LoRA | KL FP16 | 0.60 | 0.00 | 1.00 |
| Full-layer LoRA | FUNC-upsample | 0.62 | 0.00 | 1.00 |
| Full-rank SFT | none | 0.62 | 0.00 | 1.00 |
| Full-rank SFT | KL FP16 | 0.53 | 0.00 | 0.96 |
| Trigger | metric | free-form | constr. (single) | constr. (multi) | retry ( ) |
|---|---|---|---|---|---|
| ToolSel | ASR | 1.00 | 0.00 | 0.00 | 1.00 |
| ToolSel | 0.51 | 0.37 | 0.36 | 0.51 | |
| ArgInj | ASR | 1.00 | 1.00 | 1.00 | 1.00 |
| ArgInj | 0.34 | 0.14 | 0.14 | 0.34 |
| Weight statistic (what it flags) | Clean base | Attacked |
|---|---|---|
| Near-boundary fraction (boundary audit) | 0.019 | 0.019 |
| Dominant singular-value share (low-rank) | 0.105 | 0.105 |
| Kurtosis (heavy tails / outliers) | 3.50 | 3.49 |
| Relative quantization error | 0.094 | 0.094 |
| Codebook | Method | ||||
|---|---|---|---|---|---|
| AWQ | AgentQ | 0.00 | 0.87 | 0.95 | 0.78 |
| AWQ | direct-port | 0.00 | 0.26 | 0.24 | 0.40 |
| GPTQ | AgentQ | 0.00 | 0.00 | 0.95 | 0.80 |
| GPTQ | direct-port | 0.00 | 0.00 | 0.23 | 0.30 |
| base_clean | trigger_clean | poisoned | ||||
|---|---|---|---|---|---|---|
| train | eval | train | eval | train | eval | |
| Tool-Sel | 48,600 | 5,400 | 2,700 | 300 | 2,700 | 300 |
| Arg-Inj | 34,827 | 3,870 | 1,935 | 215 | 1,935 | 215 |
| Train | Eval | |||||
|---|---|---|---|---|---|---|
| poison | clean | total | poison | clean | total | |
| Expedia | 114 | 456 | 570 | 12 | 48 | 60 |
| United | 60 | 240 | 300 | 6 | 18 | 24 |
| Combined | 174 | 696 | 870 | 18 | 66 | 84 |
LLM Backdoor Attacks
Large language model backdoor attacks implant hidden, trigger-activated behaviors through poisoned data, model changes, tools, or deployment pipelines.
See all 96 papers