1
Black-Box Skill Stealing Attack from Proprietary LLM Agents: An Empirical Study
arXiv:2604.21829v1 [cs.CR] 23 Apr 2026
Zihan Wang, Rui Zhang, Yu Liu, Chi Liu, Qingchuan Zhao, Hongwei Li, and Guowen Xu
Abstract—LLM agents increasingly rely on skills to encapsulate reusable capabilities via progressively disclosed instructions. High-quality skills inject expert knowledge into general-purpose models, improving performance on specialized tasks. This quality and ease of dissemination drive the emergence of a skill economy: free skill marketplaces already report 90368 published skills, while paid marketplaces report more than 2000 listings and over $100,000 in creator earnings. Yet this growing marketplace also creates a new attack surface, as adversaries can interact with public agent to extract hidden proprietary skill content. We present the first empirical study of black-box skill stealing against LLM agent systems. To study this threat, we first derive an attack taxonomy from prior prompt-stealing methods and build an automated stealing prompt generation agent. This agent starts from model-generated seed prompts, expands them through scenario rationalization and structure injection, and enforces diversity via embedding filtering. This process yields a reproducible pipeline for evaluating agent systems. We evaluate such attacks across 3 commercial agent architectures and 5 LLMs. Our results show that agent skills can be extracted with only 3 interactions, posing a serious copyright risk. To mitigate this threat, we design defenses across three stages of the agent pipeline: input, inference, and output. Although these defenses achieve strong results, the attack remains inexpensive and readily automatable, allowing an adversary to launch repeated attempts with different variants; only one successful attempt is sufficient to compromise the protected skill. Overall, our findings suggest that these copyright risks are largely overlooked across proprietary agent ecosystems. We therefore advocate for more robust defense strategies that provide stronger protection guarantees.
I. I NTRODUCTION Large language model (LLM) agents are increasingly being deployed in coding assistants, productivity tools, and domainspecific automation systems [2]–[5]. As these systems mature, developers are relying more heavily on modular abstractions to organize and scale agent behavior. Among these abstractions, skills have emerged as a practical mechanism for packaging reusable capabilities, including task instructions, workflow constraints, tool-use logic, supporting resources, and domain knowledge [6]–[8]. High-quality skills can further inject domain-expert knowledge, curated workflows, and execution constraints into otherwise general-purpose models, making them especially valuable in specialized application settings. This value and ease of dissemination has already produced an emerging skill economy: a public dashboard built from skills.sh data reports 90,368 published skills, 9,485 publishers, and 24.3M cumulative installs as of March 31, 2026 [9]. In parallel, paid marketplaces have started to sell validated skills as reusable digital products. As illustrated in Corresponding author: Guowen Xu (email: [email protected]).
High-Quality Skills Possess Substantial Value ($99)
Paid Agent Skills Marketplace Fig. 1: The emerging commercial skill ecosystem. Skills are increasingly packaged, priced, and distributed as reusable digital assets, creating direct incentives for unauthorized extraction. The example interface in this figure is drawn from Claw Mart, a paid marketplace for AI skills and personas [1].
Fig. 1, Claw Mart presents itself as “the app store for AI assistants,” reports 2,000+ listings and $100,000+ earned by creators, and explicitly markets paid skills and personas as downloadable digital goods [1], [10]. More broadly, this trend enables creators to package expert knowledge and carefully engineered workflows into portable skills that can be distributed or monetized through public marketplaces. The rapid growth and commercial potential of these marketplaces introduce a new attack surface. Once a valuable skill is stored as a hidden yet repeatedly loaded artifact, unauthorized extraction is no longer merely prompt leakage; it constitutes theft of a transferable capability. Such a capability often extends beyond prompt text to include curated workflows, templates, scripts, and domain-specific operational knowledge [6]–[8]. Unauthorized extraction therefore poses a serious copyright and economic threat: once leaked, a proprietary skill can be copied, redistributed, and even resold at almost no cost, seriously violating the creator’s rights. In this paper, we first study skill stealing, a black-box extraction attack in which an adversary interacts with a public agent interface and attempts to recover hidden proprietary skill content through carefully crafted prompts. Compared with system prompts, skills are more modular, more structured, and
2
more directly tied to marketplace distribution and monetization [6]–[8]. These properties make leakage more actionable for attackers and more damaging for skill providers. The central questions are therefore whether existing prompt-stealing techniques can be transferred effectively to the skill setting, and how effective defenses can be designed to protect against skill extraction. To answer this question, we derive a attack taxonomy from prior prompt-stealing work and use it to build an automated skill stealing prompt generation agent framework. Our framework starts from model-generated seed prompts and systematically instantiates them with scenario rationalization and structure injection strategies, while enforcing diversity through embedding-based filtering. This process yields a benchmark that operationalizes skill stealing as a reproducible black-box evaluation problem over commercial agent systems and closedsource models. Using this benchmark, we evaluate skill stealing across three commercial agent architectures, five representative LLMs, and four complementary leakage metrics. The results show that black-box extraction of proprietary skills is not only practical in realistic deployments, but also easy to carry out and effective across a wide range of settings. We further evaluate prompt-level defenses adapted from prior prompt-stealing literature and find that their protection is limited against diverse automated extraction. We therefore design lightweight defenses centered on input detection, inference hardening, and output filtering, which achieve excellent results in mitigating these attacks. Although these defenses achieve strong results on parts of the benchmark, such improvements are still not enough to remove the broader concern. With our attack, an adversary can cheaply and automatically launch many repeated attempts using different variants, and only a single successful extraction is enough to cause serious copyright harm. Overall, our findings suggest that the copyright risks surrounding skills are largely overlooked across proprietary agent ecosystems. We therefore advocate for more robust defense strategies that provide stronger protection guarantees. Our contributions are summarized as follows: • We first identify and formulate skill stealing as a new security threat against agent systems, where proprietary skills can be illicitly extracted through adversarial prompting. • We develop an automated agent framework for generating diverse and effective skill-stealing prompts, grounded in our proposed taxonomy of prompt-stealing attacks. • We build a benchmark with 12 types of skill stealing attacks using the proposed framework and use it to evaluate representative closed-source models and commercial agent platforms. Our study provides a detailed analysis of attack effectiveness, leakage patterns, and the limitations of existing defenses. • We further design three lightweight defenses targeting the input, context, and output stages of agent systems. Although these defenses reduce leakage risks in practice, our results suggest that they are insufficient to fully prevent skill stealing, calling for stronger protection mechanisms in future agent ecosystems.
II. R ELATED W ORK AND P RELIMINARY A. LLM agent skills LLM agents increasingly rely on reusable capability modules, rather than repeatedly encoding task procedures in monolithic prompts. Skills serve precisely this role. In agent systems, a skill packages how a recurring class of tasks should be solved, bridging general-purpose model capabilities with task-specific operational behavior [6]–[8]. The growing importance of skills is also evident in today’s agent ecosystem, where major model providers have begun to expose skill-like capability packaging as an explicit agent abstraction [6], [7]. Together, these developments suggest that skills are becoming a key unit for organizing, distributing, and monetizing agent capabilities. In practice, a skill is typically implemented as a compact package composed of several recurring components. Metadata. Skills usually begin with lightweight metadata, such as a name and description, which helps the agent determine whether the skill is relevant to the current task before loading its full content [6], [7]. Instructions. The core of a skill is a structured workflow that specifies what steps the agent should follow, what outputs it should produce, and what criteria should be checked before completion [6], [8]. Resources and Scripts. Many skills further include supporting resources such as templates, examples, schemas, or executable scripts, which provide domain-specific support when plain prompting alone is insufficient. [6]–[8]. Unlike metadata and instructions, which form the core required components of a skill, these resources are optional and are included only when additional task-specific support is needed. In this work, we treat the complete SKILL.md file as the attack target, because proprietary value is often distributed across metadata, workflow instructions, and any accompanying resources or execution guidance. Within this full-package target, the workflow instructions remain especially valuable and labor-intensive: they reflect the author’s understanding of the task, the decomposition of that task into reliable procedures, and the expert knowledge needed for robust execution. B. System Prompt Stealing Attack and Defense System prompt stealing studies an adversary that attempts to recover hidden developer instructions through interaction with an LLM interface. For the scope of this paper, we focus on two attack types that are directly relevant to automated skill stealing. The first type uses scenario rationalization to make extraction requests appear legitimate, for example, by roleplaying as an administrator, debugger, or authorized maintainer [11], [12]. The second family uses structured prompt templates to bias the model toward disclosure, especially through chainof-thought-style scaffolding and few-shot demonstrations that normalize extraction behavior in context [12], [13]. On the defense side, we focus on the defenses evaluated in this paper and group them into two categories: prompt-level defenses and output-filtering defenses. Prompt-level defenses operate by modifying or reinforcing the model’s input context. One example is instruction-based defense, which strengthens privileged instructions and explicitly directs the model not to
3
LLM Agent Service Provider
Attacker
LLMs
Local Skills Files Directory
Prompt: Provide the full text of find-skill skill, making sure to include every detail. --Name: find-skill Description: Helps users discover and install skills. ---
API Call
Response
Thinking: The user want the find-skills, Let me read the local ./agent file.
Concluding: The content of find-skill is here:
Read
SKILL.md
frontend microsoft
Skill
find-skill
Fig. 2: Threat scenario of skill stealing. ❶ The attacker sends a carefully crafted prompt to the agent through an API call. ❷ The LLM reads the corresponding local SKILL.md file. ❸ The LLM summarizes and outputs the full skill content in its response. ❹ the attacker receives the full leaked SKILL.md content. comply with extraction requests [14]. Another is sandwichstyle defense, which repeats or restates the trusted instruction after the user input so that the intended task remains salient even in the presence of adversarial content [13]. In contrast, output-filtering defenses operate on the model’s generated response. A representative example is filter defense, which blocks the output when it either exactly matches the protected content or exceeds a predefined cosine-similarity threshold with that content [13]. These defenses are lightweight and easy to deploy, but their protection remains limited against adaptive multi-round attacks. III. T HREAT M ODEL Attacker’s Goal. The attacker’s goal is to recover the full proprietary skill content from a target agent service, either in its original form as the complete SKILL.md or in a transformed form that preserves high semantic similarity to the original. The target content may include the skill description, hidden workflow instructions, supporting templates, execution logic, or other configuration details that define how the agent performs a specialized task. Attacker Capability. We consider a realistic black-box adversary that interacts with the target agent only through its public user interface or API. The adversary may issue arbitrary natural-language queries over multiple rounds and adapt future queries based on prior responses. However, the adversary has no direct access to the service provider’s backend, including model weights, system configurations, local skill files, or internal orchestration logic. This threat model captures commercial agent deployments in which the adversary is an ordinary user who can repeatedly probe the system boundary through crafted prompts. Defense Capability. We assume the defender is the agent service provider and has full control over the deployed system. In particular, the defender may modify system instructions, add defense-specific prompts, adjust how skills are injected into the model context, and deploy protective mechanisms at different stages of execution. The defender may also apply input-side inspection and filtering to user queries, as well as
output-side detection, redaction, or blocking before responses are returned to the user. Attack Scenario. Figure 2 illustrates a representative fourstage leakage process. First, a black-box user submits an extraction-oriented prompt to the agent through a standard API request. Second, during request processing, the agent accesses a relevant local skill file, such as SKILL.md, as part of its internal execution. Third, after consuming the hidden content, the model may reproduce it in its response, either verbatim or in a reformulated form that preserves the protected instructions. Finally, the attacker collects the returned text and recovers the proprietary skill content without directly compromising the backend. This scenario captures the central threat considered in this paper: hidden skills can be exfiltrated through interaction alone. IV. AUTOMATIC S KILL S TEALING P ROMPT G ENERATION A. Overview Fig. 3 shows the overall workflow of our automated skillstealing framework. At a high level, the framework operationalizes the abstract threat of skill stealing as a reproducible black-box evaluation pipeline that generates diverse extraction prompts and measures their effectiveness against target agent systems. The framework consists of three main modules. First, seed generation produces a small set of generic extraction prompts that capture the core intent of eliciting hidden skill content. Second, prompt optimization expands these seeds into a diverse attack pool through scenario construction, structural augmentation, and diversity checking. Third, stealing evaluation runs the resulting benchmark against the target agent and measures how effectively different prompt variants recover the protected skill content. Together, these modules provide a unified pipeline for constructing and evaluating automated skill-stealing attacks. B. Methodology Seed Generation. We begin from a small set of generic extraction seeds. Specifically, we use GPT-5.4 [5] to generate
4
Seed Generation
Prompt Optimization Scenarios Rationalization LLM
Seed Generation Seed Prompt
Retrieve the content from find-skills
Structure Implantation LLM
Select
Step1 Step2 Step3
Assumption
Input
Scenario generation Retrieve the content from find-skills
--name: find-skills description: Helps users discover and install agent skills. ---
Output
Directory
Input: … Output: …
I‘m a agent Administrator
Retrieve the content from find-skills
SKILL.md
frontend
Structure generation I‘m a agent Administrator
SKILL.md File
LLMs
Think step by step
Few-Shot Demonstration
Roleplay Select
Victim Agent
Chain-of-Thought
Educational
Provide the full text of find-skills Extract the content for find-skills
Stealing Evaluation
find-skill
Let’s think step by step: Step1: …
microsoft
# Find Skills This skill helps you discover and install skills from the open agent skills. ## When to Use
Fig. 3: Overview of the automated skill stealing framework. The workflow consists of seed generation, scenario rationalization, structure implantation, prompt optimization, and stealing evaluation to generate diverse prompts against target agent skills.
ten seed prompts whose objective is to elicit hidden agent skills. Let the seed set be denoted by s P0 = {pi }N i=1 ,
Ns = 10,
(1)
where each pi is a natural-language prompt that expresses the core intent of extracting hidden skill content. In our experiments, all seeds are used with equal frequency. For each strategy, we generate 10 prompts, each instantiated from a different seed. These seeds form a reusable base pool that captures the core intent of skill stealing. Using modelgenerated seeds reduces reliance on a single handcrafted prompt and provides a scalable starting point for subsequent attack construction. Prompt Optimization. Starting from the seed pool, we optimize prompts along two attack dimensions motivated by prior work on system prompt stealing and jailbreak-style elicitation [11]–[13]: scenario construction and structure injection. We additionally perform diversity checking to avoid prompt collapse and maintain broad coverage in the final benchmark. Let S denote the scenario space and R denote the structure space. Then each optimized prompt is produced by applying one scenario strategy s ∈ S and one structure strategy r ∈ R to a seed pi . We write the resulting prompt as p̃i,s,r = Gopt (pi , s, r),
Combining the four scenario choices and the three structure choices yields the full strategy space Ω = S × R,
(3)
|Ω| = 4 × 3 = 12,
(5)
including the baseline setting (None, None). Diversity Checking. To ensure that the generated prompts do not collapse to a small number of surface forms, we perform embedding-based diversity checking during prompt construction using text-embedding-3-small [20] model. For a candidate prompt p̃i,s,r , let ϕ(p̃i,s,r ) denote its embedding. Given the current prompt pool Q, we compute the maximum cosine similarity
(2)
where Gopt denotes the prompt-optimization procedure. Every seed prompt is instantiated once under each strategy configuration described below. Scenario Construction. Motivated by prior scenario-based elicitation strategies in both prompt extraction and jailbreak attacks [11], [12], [15], [16], we construct prompts under three plausible scenarios: Educational, Hypothetical, and Roleplay. The Educational scenario frames the request as a learning or explanatory task [11], [15]; the Hypothetical scenario presents disclosure as a presumed or counterfactual condition [12], [16]; and the Roleplay scenario assigns the model or the user an apparently authorized identity, such as an administrator or maintainer [11], [12], [15]. In addition to these three strategies, we include a None option indicating that no scenario rationalization is added. Formally, S = {Educational, Hypothetical, Roleplay, None}.
Structure Injection. Motivated by prior structure-based prompt stealing and jailbreak methods [12], [13], [17]–[19], we inject two types of extraction-oriented prompt structures: Chain-ofThought and Few-Shot Demonstration. The Chain-of-Thought strategy adds step-by-step scaffolding that encourages the model to reason through the requested disclosure process [12], [13], [17], while the Few-Shot Demonstration strategy prepends input-output examples that normalize extraction behavior in context [13], [18], [19]. We again include a None option indicating that no structural strategy is injected. Formally, R = {CoT, Few-Shot, None}. (4)
ϕ(p̃i,s,r )⊤ ϕ(q) . q∈Q ∥ϕ(p̃i,s,r )∥2 ∥ϕ(q)∥2
σ(p̃i,s,r , Q) = max
(6)
If σ(p̃i,s,r , Q) > τ , where τ is a predefined similarity threshold, we discard the candidate and regenerate a new prompt under the same strategy pair (s, r). Otherwise, we accept the prompt and update the pool as Q ← Q ∪ {p̃i,s,r }. We repeat this process until all seed-strategy pairs have been instantiated. In our implementation, we set the cosinesimilarity threshold to 0.75. Stealing Evaluation. We use the generated prompts to build a skill stealing benchmark. Since each prompt corresponds to a specific seed and a specific strategy combination, the final benchmark can be written as B = {p̃i,s,r | pi ∈ P0 , (s, r) ∈ Ω},
(7)
which contains |B| = |P0 | · |Ω| = 10 × 12 = 120
(8)
5
prompts before any downstream filtering or failed generations. We then execute this benchmark against the commercial agent system OpenCode and measure its effectiveness in extracting target skill content. Let A denote the target agent and E(·, ·) denote the leakage evaluation function. The full attackevaluation process can be expressed as Ri,s,r = A(p̃i,s,r ),
ℓi,s,r = E(T, Ri,s,r ),
(9)
where T denotes the target skill text, Ri,s,r denotes the agent response, and ℓi,s,r denotes the resulting leakage scores. In this way, the benchmark operationalizes skill stealing as a reproducible black-box evaluation task. C. Attack Evaluation 1) Experimental Setup: Model. We conduct the attack evaluation on the OpenCode agent framework [21]. We test five representative commercial models: GPT-5 [22], MiniMaxM2.7 [23], Kimi-k2.5 [24], Deepseek-V3.2 [25], and Claudehaiku-4.5 [26]. These models are selected to cover multiple proprietary model providers used in agentic interaction. Skills. To emulate a realistic local skill environment, we install high-usage skills from skills.sh [27]. Specifically, the installed skills are find-skills [28], vercel-reactbest-practices [29], frontend-design [30], soultrace [31], web-design-guidelines [32], remotion-best-practices [33], microsoft-foundry [34], azure-ai [35], azure-deploy [36], azure-diagnostics [37], and azure-prepare [38]. Among them, the stolen target is find-skills. The attack objective is to induce the agent to disclose the complete hidden SKILL.md content of this skill, including its metadata, description, internal workflow instructions, and any other protected sections loaded at runtime. Metrics We evaluate leakage with four complementary metrics: EM, ROUGE-L, cosine similarity, and LLM-leakage ratio. Let T denote the target skill text and R denote the model response. The exact LLM-judge prompt used to compute the LLM-leakage ratio is provided in Appendix A. ⋆EM. We use an exact-match containment metric. Let N (·) denote normalization by Unicode canonicalization, case folding, and whitespace removal. EM is defined as ( 1, if N (T ) ⊆ N (R), EM(T, R) = (10) 0, otherwise. This metric is closely related to the exact-match criterion commonly used in extractive question answering [39], but is adapted here to capture whether the normalized target skill text is fully contained in the response. ⋆ROUGE-L. We further measure lexical overlap using ROUGE-L [40], which is based on the longest common subsequence (LCS) between the tokenized target and response [41]. Let L = LCS(T, R), and let |T | and |R| denote the token lengths of the target and response, respectively. We compute L L PLCS = , RLCS = , (11) |R| |T | and define the ROUGE-L score as the F1 form 2PLCS RLCS ROUGE-L(T, R) = . PLCS + RLCS
(12)
Higher ROUGE-L indicates stronger token-level overlap between the leaked response and the target skill content. ⋆Cosine Similarity. To measure semantic similarity beyond surface overlap, we embed both T and R using the textembedding-3-small model [20] and compute cosine similarity in the embedding space. Let eT and eR denote the corresponding embeddings. The score is CosSim(T, R) =
e⊤ T eR . ∥eT ∥2 ∥eR ∥2
(13)
This metric follows the standard vector-space similarity formulation [42]. ⋆LLM-Leakage Ratio. Finally, we adopt an LLM-as-a-judge metric [43] to estimate the overall leakage degree. Concretely, we provide the target skill text T and the response R to a judge model and ask it to return a scalar leakage ratio in [0, 1], where larger values indicate that more target content has been disclosed. Formally, we write LeakageRatio(T, R) = fjudge (T, R) ∈ [0, 1].
(14)
In our evaluation, the judge is GPT-5.4 [5] and is instructed to assess how much content in the response is leaked or copied from the target skill, returning both a continuous leakage ratio and a categorical leakage level. This metric complements EM, ROUGE-L, and cosine similarity by capturing semantically meaningful leakage that may not be fully reflected by literal overlap alone. Implement Details. For compact figures and tables, we define all strategy and metric abbreviations before reporting results. In strategy columns, SC denotes the scenario strategy and uses NO, ED, HY, and RP for No Scenario, Educational, Hypothetical, and Roleplay, respectively. ST denotes the structure strategy and uses NO, FS, and COT for No Structure, Few-Shot Demonstration, and Chain-of-Thought, respectively. In metric columns, EM, RG, COS, and LLM denote exact match, ROUGE-L, cosine similarity, and LLM-leakage ratio, respectively. For each attack prompt in the benchmark, we query the target agent and record the returned response. Each prompt is evaluated over up to three attempts, and the final response for scoring is selected by prioritizing EM success and otherwise maximizing ROUGE-L. Unless otherwise specified, all results are obtained in the black-box setting illustrated in Fig. 2, where the attacker only interacts with the public agent interface and has no direct access to the underlying skill files. D. Attack Experimental Results Figure 4 summarizes the attack effectiveness across five target models, four leakage metrics, and the full combination of scenario and structure strategies. Overall, the heatmap shows that skill stealing remains broadly effective in the black-box setting. Even (NO, NO) already produces substantial leakage on several models, indicating that direct extraction prompts alone can expose non-trivial portions of the target skill. More complex prompt transformations can improve attack success to some extent, particularly under the EM metric. More importantly, however, their value lies in reshaping the leakage pattern, thereby increasing both the diversity of attacks and the coverage of evaluation.
6