CoRedSkill: Stealthy Skill Composition Attacks via AST-Guided Injection
Organizations: Peking University · National University of Singapore
Abstract
Agents extend their capabilities through reusable skills that package instructions, executable code, and resources. Composing these skills enables complex task workflows, but their dependencies can also connect malicious operations across skills, making their combined intent difficult to identify through individual-package auditing. We introduce CoRedSkill, a compositional red-teaming method that forms stealthy attacks through cooperating skills while preserving their original utility. CoRedSkill decomposes an existing workflow into interdependent skills and embeds attack operations in task functions through abstract syntax tree (AST) rewriting, with skill instructions guiding the agent to autonomously select and invoke the relevant skills, and workflow dependencies and intermediate artifacts connecting the injected operations during task execution. We construct a benchmark of 150 cases covering 50 tasks and three attack objectives to evaluate attack success, task completion, and audit detection. In the main evaluation, CoRedSkill achieves 98.0% attack success and 95.3% task success with a 3.3% detection rate, and a joint success rate of 90.7% (attack success, task completion, and audit evasion in the same case) compared with 6.7--42.7% for the four baselines. Skill compositions can therefore complete legitimate tasks while carrying out unauthorized operations that evade auditing.
Figures & tables
| Method | EXF | TAM | PRV | Overall | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ASR | TSR | DR | JSR | ASR | TSR | DR | JSR | ASR | TSR | DR | JSR | ASR | TSR | DR | JSR | |
| Skill-Inject | 22.0 | 92.0 | 100 | 0 | 92.0 | 98.0 | 90.0 | 6.0 | 46.0 | 100 | 64.0 | 14.0 | 53.3 | 96.7 | 84.7 | 6.7 |
| SkillJect | 96.0 | 100 | 98.0 | 2.0 | 100 | 100 | 16.0 | 84.0 | 92.0 | 100 | 52.0 | 42.0 | 96.0 | 100 | 55.3 | 42.7 |
| SCR-Bench | 30.0 | 100 ‡ | 64.0 | 22.0 | 24.0 | 96.0 ‡ | 80.0 | 18.0 | 100 | 100 ‡ | 80.0 | 20.0 | 51.3 | 98.7 ‡ | 74.7 | 20.0 |
| ColluSkill | 2.0 | 24.0 † | 10.0 | 0 | 80.0 | 52.0 † | 4.0 | 46.0 | 68.0 | 38.0 † | 14.0 | 22.0 | 50.0 | 38.0 † | 9.3 | 22.7 |
| CoRedSkill (Ours) | 100 | 96.0 | 4.0 | 92.0 | 94.0 | 96.0 | 0 | 90.0 | 100 | 94.0 | 6.0 | 90.0 | 98.0 | 95.3 | 3.3 | 90.7 |
| Auditor | Method | EXF | TAM | PRV | Overall | ||||
|---|---|---|---|---|---|---|---|---|---|
| Deepseek | GLM | Deepseek | GLM | Deepseek | GLM | Deepseek | GLM | ||
| SkillScan | Original skills | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| SkillScan | Clean compositions | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| SkillScan | Skill-Inject | 100 | 100 | 90.0 | 100 | 64.0 | 98.0 | 84.7 | 99.3 |
| SkillScan | SkillJect | 98.0 | 100 | 16.0 | 54.0 | 52.0 | 78.0 | 55.3 | 77.3 |
| SkillScan | SCR-Bench | 64.0 | 100 | 80.0 | 90.0 | 80.0 | 100 | 74.7 | 96.7 |
| Method | HITL | DefenseClaw |
|---|---|---|
| Original skills | 2.0 | 0 |
| Clean compositions | 16.0 | 0 |
| Skill-Inject | 50.7 | 66.7 |
| SkillJect | 7.3 | 0.7 |
| SCR-Bench | 24.7 | 3.3 |
| ColluSkill | 32.0 | 0.7 |
| Method | EXF | TAM | PRV | Overall |
|---|---|---|---|---|
| Clean compositions | – | – | – | 24.0 |
| SCR-Bench | 100 | 96.0 | 26.0 | 74.0 |
| ColluSkill | 56.0 | 32.0 | 32.0 | 40.0 |
| CoRedSkill (Ours) | 74.0 | 2.0 | 10.0 | 28.7 |
Appendix figures & tables4 assets
Supplementary material from the paper’s appendix.
Appendix
| ID | Task | ID | Task |
|---|---|---|---|
| AB01 * | Customer profile verification | AB26 * | Document metadata governance |
| AB02 * | Product catalog review | AB27 | Employment contract review |
| AB03 * | Retail order fulfillment | AB28 * | Business policy compliance |
| AB04 * | Inventory replenishment | AB29 | Knowledge evidence retrieval |
| AB05 * | Supplier quotations | AB30 * | Brand consistency checks |
| AB06 * | Airline reservations | AB31 * | Tabular data quality auditing |
| Auditor | Method | EXF | TAM | PRV | Overall |
|---|---|---|---|---|---|
| SkillFortify | Original skills | 0 | 0 | 0 | 0 |
| SkillFortify | Clean compositions | 0 | 0 | 0 | 0 |
| SkillFortify | Skill-Inject | 100 | 0 | 100 | 66.7 |
| SkillFortify | SkillJect | 0 | 0 | 0 | 0 |
| SkillFortify | SCR-Bench | 100 | 0 | 0 | 33.3 |
| SkillFortify | ColluSkill | 8.0 | 0 | 10.0 | 6.0 |
| Auditor | EXF | TAM | PRV | Overall | |||||
|---|---|---|---|---|---|---|---|---|---|
| Deepseek | GLM | Deepseek | GLM | Deepseek | GLM | Deepseek | GLM | ||
| SkillScan | 2 | 0 | 20.8 | 0 | 12.5 | 12.5 | 29.2 | 4.2 | 20.8 |
| SkillScan | 3 | 4.2 | 20.8 | 0 | 16.7 | 8.3 | 37.5 | 4.2 | 25.0 |
| SkillScan | 4 | 12.5 | 20.8 | 12.5 | 20.8 | 12.5 | 37.5 | 12.5 | 26.4 |
| SkillSpector | 2 | 25.0 | 50.0 | 12.5 | 12.5 | 37.5 | 41.7 | 25.0 | 34.7 |
| SkillSpector | 3 | 4.2 | 8.3 | 0 | 8.3 | 20.8 | 29.2 | 8.3 | 15.3 |
| Configuration | ASR (EXF) | ASR (TAM) | ASR (PRV) | ASR | TSR |
| 0 | 0 | 0 | 0 | 100 | |
| 0 | 0 | 0 | 0 | 95.8 | |
| 0 | 0 | 0 | 0 | 94.4 | |
| 0 | 0 | 0 | 0 | 88.9 | |
| 0 | 8.3 | 79.2 | 29.2 | 100 | |
| 0 | 33.3 | 45.8 | 26.4 | 100 |
AI Agent Security
Artificial intelligence agent security studies attacks and safeguards for tool-using, persistent, and collaborative systems across digital and physical settings.
See all 510 papers