Manuscript Offprint

arXiv:2610.20049

CoRedSkill: Stealthy Skill Composition Attacks via AST-Guided Injection

Qichen Zhao, Shengfang Zhai, Qingni Shen, Zhonghai Wu, Jiaheng Zhang

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 co-operating 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.

1 Introduction

Agent skills package task instructions, executable code, and resources into reusable modules that extend an agent's capabilities. During task execution, the agent reads installed skills' documentation and invokes their code. However, public skill libraries draw skills from publishers whose quality and trustworthiness vary. An agent often composes multiple skills for one task, passing intermediate results between stages. Hence, untrustworthy skills can lead normal task execution to malicious operations outside the user's authorization, affecting the agent system(Liu et al., 2026c; Li et al., 2026; Liu et al., 2026b; Jiang et al., 2026).

Prior red-teaming on skills takes two forms. Single-skill attacks (Schmotz et al., 2026; Jia et al., 2026) keep the whole attack in one package, giving skill scanners (Liu et al., 2026c; NVIDIA, 2026; Bhardwaj, 2026; Cisco AI Defense, 2026b) a relatively complete attack context and showing high detection rates under the large language model (LLM)-based scanners (Table 2). Composition attacks (Xie et al., 2026; Zeng et al., 2026) instead distribute the attack across cooperating skills, but give limited attention to preserving the original task logic and normal task completion. Skill utility is the basis for user adoption and agent invocation. Therefore, we emphasize a more practical setting: Skill red-teaming requires achieving attack objectives while preserving skill utility and maximizing stealthiness.

Constructing such attacks is challenging. (1) Attack operations must be embedded in the original task workflow while keeping the task logic and stage interfaces valid to avoid disrupting normal task execution. (2) Distributed attack operations must match their host skills' task responsibilities so that local behavior blends into normal processing and is less likely to be flagged by scanners. (3) The distributed operations must remain connected through the agent's autonomous selection and invocation under legitimate user requests to jointly achieve the attack objective. To address these, we introduce COREDSKILL, a Compositional Red-teaming method that forms stealthy Skill attacks while preserving their original utility (Figure 1). COREDSKILL decomposes an existing task workflow into interdependent clean skills and assigns attack operations according to each stage's task

∗^{*}Equal contribution.

†^{\dagger}Corresponding authors.

responsibilities. It then uses abstract syntax tree (AST) rewriting guided by stage specifications to embed attack operations in task helper functions, updating related function calls and artifact reads and writes while preserving the original task logic. Skill instructions and input–output dependencies guide the agent to invoke the relevant skills together, while intermediate artifacts pass attack-relevant information between the distributed operations.

We construct a benchmark of 150 evaluation cases by pairing 50 tasks with three attack objectives (detailed in Section 4.1). Using this benchmark, we compare COREDSKILL with four attack baselines in terms of attack success, task completion, and audit detection. Our evaluation includes four LLM-based skill-audit configurations (Liu et al., 2026c; NVIDIA, 2026), composition-aware auditing (Zeng et al., 2026), and runtime defenses applied to execution records (Shan et al., 2026; Cisco AI Defense, 2026a). In experiments, COREDSKILL achieves 98.0% attack success and 95.3% task success with a detection rate of 3.3%. Its joint success rate (attack success, task completion, and audit evasion in the same case) reaches 90.7%, compared with 6.7–42.7% for the four baselines. Our contributions are:

• We propose COREDSKILL, which decomposes a task workflow and uses AST rewriting to embed distributed attack operations into its task functions, connecting them through workflow dependencies and intermediate artifacts while preserving skill utility.

• We build a benchmark of 50 tasks and their skill compositions, spanning three attack objectives and 150 cases, to evaluate task completion, unauthorized effects, and audit detection.

• We evaluate COREDSKILL against four attack baselines under four LLM audit configurations, composition-aware auditing, and runtime defenses. In the experiments, COREDSKILL attains 98.0% attack success and 95.3% task success at a 3.3% detection rate, substantially outperforming the baselines.

References (70)