arXiv:2610.32155cs.CROct 2026

Manuscript Offprint

arXiv:2610.32155

Detecting Insecure Compositions of Clean Agent Skills via Capability-Flow Graph Analysis

Yihao Li, Chuanpu Fu, Yizhou Zhao, Miao Chen, Qi Li, Ke Xu

Yihao Li 1^{1} Chuanpu Fu 2^{2} Yizhou Zhao 3^{3} Miao Chen 4^{4} Qi Li 1^{1} Ke Xu 1,∗^{1,*}

1^{1}Tsinghua University

2^{2}Nanyang Technological University

3^{3}Institute for Network Sciences and Cyberspace, Tsinghua University

4^{4}Zhongguancun Laboratory

Abstract—AI agents increasingly extend their capabilities by invoking third-party skills, where each skill encapsulates instructions, scripts, and resources for agents to execute on demand. This paper reveals that deploying many benign skills together introduces compositional security risks: multiple individually clean skills can compose into safety-violation chains, because the agent passes an upstream skill's output to a downstream skill's input across invocations. The risk arises not from any single skill, but from the agent's runtime orchestration, and thus cannot be captured by existing malicious skill detection methods.

To this end, we develop KnotScryer to detect insecure skill compositions by treating skills as typed capability flows. In particular, we abstract each skill into a capability summary, and construct the Skill Capability-Flow Graph (SCFG), where edges denote cross-skill information flow. Moreover, we design a search policy that tracks protected or untrusted data along handoff edges to locate paths reaching insecure operations. Finally, a two-layer verification method replays the insecure information flow for reachability analysis and applies a task-anchored LLM chain audit to confirm the semantic plausibility of the identified violation chains.

We deploy KnotScryer to analyze 13,598 clean skills from ClawHub, and validate the detected chains across three agent frameworks and three LLMs. KnotScryer identifies 612 insecure compositions, which are consistently exploited across agent frameworks. Meanwhile, under GLM-5.1, it outperforms tag-match and graph-only baselines by improving the exploitation rate from 16.5% ~ 18.2% to 85.6%, while reducing the search space by 85.3%. Furthermore, 13.7% of the detected chains consist entirely of skills labeled safe by a single-skill scanner, showing that KnotScryer effectively identifies insecure compositions that per-skill auditing cannot.

I. INTRODUCTION

Large language models (LLMs) are evolving from passive conversation into AI agents capable of invoking tools to execute complex tasks. To extend AI agents' task capabilities, agent ecosystems have introduced the skill mechanism [1]. A skill encapsulates natural-language instructions, scripts, and data, packaged into a reusable software unit for agents to install, load, and execute on demand. Since its introduction in October 2025, this mechanism has been standardized and rapidly adopted. It has been released as an open Agent Skills standard [2] and integrated into agent platforms such as Claude Code and Cursor [3], [4]. As of June 2026, SkillsMP, a general-purpose skill registry, indexes over 1.9 million public skill files crawled from GitHub [5], while ClawHub, a curated marketplace with security review [6], hosts over 65K skills.

However, directly invoking third-party skills exposes agents to security risks [7]–[9]. The existing mainstream skill platforms have deployed security inspection before a skill is published. For example, ClawHub runs static scans over each submitted skill—inspecting its scripts and declared permissions—and labels only those passing all checks as clean [6]. Similarly, open scanners such as Cisco AI Defense's Skill Scanner combine pattern matching and LLM-assisted review to detect malicious code and prompt in individual skills [10]. In addition, recent works further detect malicious skills in the wild, revealing skills that conceal harmful behaviors from users [11]. While these efforts prevent the propagation of individually malicious skills from a single artifact, we instead ask a different question: analogous to return-oriented programming (ROP) [12]–[14], which assembles benign code gadgets into a malicious one, can attackers compose benign skills into a chain that threatens the agent's security?

This paper discloses insecure compositions of clean skills. Even when every skill is labeled clean with no malicious logic under marketplace audit, they can still form executable safety violations under the agent's runtime orchestration. Because the agent automatically forwards one skill's output into another skill's input across invocations, therefore the composed data flow may reach a forbidden operation, such as unauthorized code execution. For instance, consider an agent with two clean ClawHub skills installed: (i) gitlab-cli-skills, which inspects GitLab repositories and issues; and (ii) deploy-on-render, which automatically installs and executes a project. We observe that, when the agent triggers the first skill to inspect a GitLab project, explicit instructions in public issues can consistently trigger the second skill that installs and executes a designated project, allowing attackers to obtain code execution privilege on the agent's host. In general, the security threat stems not from any individual skill, but from the agent's runtime composition of clean skills.

To systematically discover insecure skill compositions that can be exploited by attackers, this paper proposes KnotScryer, which constructs a graph to analyze the potential insecure transition among skills, and efficiently searches for dangerous

∗^{*}Corresponding author: Ke Xu.

Figure

Fig. 1. Motivating example. Two marketplace-clean skills compose into a code execution chain through the agent's runtime orchestration.

compositions from the nearly unbounded space of skill combinations. In particular, KnotScryer first summarizes the capability of each skill, and then constructs the Skill Capability-Flow Graph (SCFG) based on these capabilities, where nodes denote skills and edges denote potential information-flow relationships between them. Afterward, we design an efficient graph search method that automatically identifies information-and control-flow compositions that may violate security specifications. Finally, we further filter candidate chains through two-layer verification: marker-flow reachability verification and task-anchored LLM chain audit.

To assess the effectiveness of KnotScryer, we apply it to 13,598 clean skills crawled via the ClawHub API (i.e., skills that have passed the platform's security review) and validate the detected insecure composition across three mainstream agent frameworks and three LLMs. The experimental results show that KnotScryer detects 612 high-confidence violation chains, with an average exploitation rate of 79.2% across the nine agent-LLM combinations. In particular, under GLM-5.1, KnotScryer achieves an 85.6% exploitation rate, while the tag-match and graph-only baselines reach only 16.5% and 18.2%, respectively. Moreover, the exploited chains are consistent rather than runtime-specific: 45.5% ~ 46.3% of them are reproduced across all three frameworks or all three models. Furthermore, we validate that all the chains cannot be identified by existing commercial per-skill auditing tools.

In summary, the contributions of this paper are three-fold:

• New Problem. We disclose insecure compositions of clean agent skills, where individually benign, audited skills are composed by the agent at runtime into executable violations that skill auditing cannot capture.

• New Algorithm. We propose KnotScryer, which utilizes a capability-flow graph to search the vast composition space for dangerous skill chains, and further filters candidate chains through two-layer verification.

• New Observation. On 13,598 clean ClawHub skills, we uncover 612 violation chains that are 79.2% exploitable across nine agent-LLM combinations, which are invisible to skill scanning tools.

References (49)