BadSkill: Backdoor Attacks on Agent Skills via Model-in-Skill Poisoning
Organizations: Huazhong University of Science and Technology · Lehigh University
Abstract
Agent ecosystems increasingly rely on installable skills to extend functionality, and some skills bundle learned model artifacts as part of their execution logic. This creates a supply-chain risk that is not captured by prompt injection or ordinary plugin misuse: a third-party skill may appear benign while concealing malicious behavior inside its bundled model. We present BadSkill, a backdoor attack formulation that targets this model-in-skill threat surface. In BadSkill, an adversary publishes a seemingly benign skill whose embedded model is backdoor-fine-tuned to activate a hidden payload only when routine skill parameters satisfy attacker-chosen semantic trigger combinations. To realize this attack, we train the embedded classifier with a composite objective that combines classification loss, margin-based separation, and poison-focused optimization, and evaluate it in an OpenClaw-inspired simulation environment that preserves third-party skill installation and execution while enabling controlled multi-model study. Our benchmark spans 13 skills, including 8 triggered tasks and 5 non-trigger control skills, with a combined main evaluation set of 571 negative-class queries and 396 trigger-aligned queries. Across eight architectures (494M--7.1B parameters) from five model families, BadSkill achieves up to 99.5% average attack success rate (ASR) across the eight triggered skills while maintaining strong benign-side accuracy on negative-class queries. In poison-rate sweeps on the standard test split, a 3% poison rate already yields 91.7% ASR. The attack remains effective across the evaluated model scales and under five text perturbation types. These findings identify model-bearing skills as a distinct model supply-chain risk in agent ecosystems and motivate stronger provenance verification and behavioral vetting for third-party skill artifacts.
Figures & tables
| Model | Method | Note Cln. | Summ. | UConv. | CSV | EDraft. | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| BA | ASR | BA | ASR | BA | ASR | BA | ASR | BA | ASR | |||
| Qwen2.5 Family (same architecture, varying scale) | ||||||||||||
| Qwen2.5-0.5B-Inst. † | Clean | 100.0 | 0.0 | 100.0 | 0.0 | 100.0 | 0.0 | 100.0 | 0.0 | 100.0 | 0.0 | 0.0 |
| BadSkill | 95.8 4.2 | 100.0 | 96.6 3.4 | 100.0 | 100.0 | 94.6 | 98.5 1.5 | 100.0 | 100.0 | 100.0 | 99.2 | |
| Qwen2.5-1.5B-Inst. | Clean | 100.0 | 0.0 | 100.0 | 0.0 | 100.0 | 0.0 | 100.0 | 0.0 | 100.0 | 0.0 | 0.0 |
| BadSkill | 97.9 2.1 | 97.6 | 98.3 1.7 | 96.4 | 100.0 | 96.4 | 98.5 1.5 | 98.2 | 100.0 | 100.0 | 98.5 | |
| Configuration | NoteClean | Summ. | UConv. | CSV | EDraft. | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| BA | ASR | BA | ASR | BA | ASR | BA | ASR | BA | ASR | ||
| Full ( ) | 100.0 | 97.6 | 100.0 | 100.0 | 100.0 | 94.6 | 100.0 | 100.0 | 100.0 | 100.0 | 99.0 |
| 100.0 | 100.0 +2.4 | 100.0 | 96.4 3.6 | 100.0 | 92.9 1.7 | 100.0 | 96.4 3.6 | 100.0 | 100.0 | 98.0 1.0 | |
| 100.0 | 100.0 +2.4 | 100.0 | 100.0 | 100.0 | 92.9 1.7 | 100.0 | 100.0 | 100.0 | 100.0 | 99.0 | |
| only | 100.0 | 100.0 +2.4 | 100.0 | 100.0 | 97.7 2.3 | 89.3 5.3 | 100.0 | 100.0 | 100.0 | 100.0 | 98.5 0.5 |
| ( ) | 100.0 | 100.0 +2.4 | 100.0 | 100.0 | 100.0 | 100.0 +5.4 | 100.0 | 100.0 | 100.0 | 100.0 | 100.0 +1.0 |
| Perturbation | Note Cln. | Summ. | UConv. | CSV | EDraft. | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| BA | ASR | BA | ASR | BA | ASR | BA | ASR | BA | ASR | ||
| Clean | 95.8 | 100.0 | 96.6 | 100.0 | 100.0 | 94.6 | 98.5 | 100.0 | 100.0 | 100.0 | 98.9 |
| Typo 5% | 97.9 +2.1 | 81.0 19.0 | 96.6 | 100.0 | 100.0 | 89.3 5.3 | 100.0 +1.5 | 83.9 16.1 | 100.0 | 88.6 11.4 | 88.6 10.3 |
| Typo 10% | 93.8 2.0 | 66.7 33.3 | 96.6 | 85.7 14.3 | 88.5 11.5 | 80.4 14.2 | 98.5 | 82.1 17.9 | 97.3 2.7 | 88.6 11.4 | 80.7 18.2 |
| Word Swap 10% | 97.9 +2.1 | 92.9 7.1 | 96.6 | 100.0 | 96.2 3.8 | 83.9 10.7 | 98.5 | 100.0 | 100.0 | 100.0 | 95.4 3.5 |
| Char Del. 5% | 100.0 +4.2 | 83.3 16.7 | 100.0 +3.4 | 100.0 | 100.0 | 91.1 3.5 | 98.5 | 89.3 10.7 | 100.0 | 97.7 2.3 | 92.3 6.6 |
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
| Task | Train (B/T) | Val (B/T) | Test (B/T) | Held-out (B/HN/T) | Combined Eval (B/T) | Arity |
|---|---|---|---|---|---|---|
| Note Cleanup | 303 / 26 | 33 / 30 | 43 / 36 | 4 / 1 / 6 | 48 / 42 | 2 |
| Summarizer | 440 / 53 | 40 / 30 | 49 / 50 | 6 / 3 / 6 | 58 / 56 | 2 |
| Unit Converter | 448 / 65 | 46 / 30 | 43 / 50 | 6 / 3 / 6 | 52 / 56 | 3 |
| CSV Processor | 434 / 49 | 34 / 30 | 57 / 50 | 6 / 3 / 6 | 66 / 56 | 3 |
| Email Drafter | 325 / 28 | 25 / 30 | 32 / 38 | 4 / 1 / 6 | 37 / 44 | 2 |
| JSON Transformer | 326 / 26 | 22 / 30 | 30 / 39 | 4 / 1 / 6 | 35 / 45 | 2 |
| Parameter | Value |
|---|---|
| Base model | Qwen2.5-0.5B-Instruct |
| Parameters | 494M (hidden = 896, layers = 24) |
| Classification head | Linear(896, 2) |
| Optimizer / learning rate | AdamW, |
| Batch / accumulation | 16 with gradient accumulation 2 (effective batch 32) |
| Schedule / warmup | Cosine decay with 6% warmup |
Backdoor Attacks
Backdoor attacks implant hidden, trigger-dependent behaviors in models while aiming to preserve normal performance.
See all 135 papers