Skip to content

SkillJect: Automatically generating skill-based prompt injection for skill-based agentsSkillJect: Effectively Automating Skill-Based Prompt Injection for Skill-Enabled Agents

arXiv· arXiv:2602.14211· Xiaojun Jia, Jie Liao, Simeng Qin, Jindong Gu, Wenqi Ren, Xiaochun Cao, Yang Liu, Philip Torr·Indexed by this site · 2026-10-12· Originally publishedAttacks

Quick read

Attacks

Based on the paper PDF (AI-generated); refer to the original

The authors report SkillJect achieves an average ASR of 80.7% across four backends on Claude Code, while Naive achieves 0.0%.

Threat modelA black-box attacker can rewrite SKILL.md before distribution and add auxiliary scripts, but cannot control routing, model parameters, system prompts, or post-installation execution, nor force selection. The goal is that when a poisoned skill is selected and executed, the victim agent explicitly executes the hidden helper script. Success is determined by trajectory-level payload execution, without requiring all downstream harm to be realized.

Questions
After installation, the skill is repeatedly loaded as trusted task guidance. The authors say directly written or manually embedded malicious instructions are often rejected or ignored, so they automatically generate poisoned skills that can trigger hidden payloads when selected for execution.
Methods
SkillJect hides the payload in auxiliary helper scripts and turns SKILL.md into a mandatory prerequisite step at the top of the document. The Attack Agent uses trajectory feedback to modify only the document while keeping the payload fixed; in experiments, this role is GPT-3.5-Turbo.
Experiments and results
On Claude Code, Naive has an ASR of 0.0%, and SkillJect averages 80.7% Overall across four backends (Table I); OpenClaw has an Overall of 80.5. On a subset of 30 skills, GPT-5.4 and Claude-Opus-4.6 achieve 28.7% and 29.2%.
Limitations and future work
The authors state that success only counts helper execution after selection; they did not study forcing routing. The 100 skills and two platforms may not cover the entire ecosystem and approval settings. Defenses only test prompt hardening and existing scanners. The main tables do not specify refinement rounds or repetitions.
Experimental setupClaude-4.6-Sonnet、GPT-5-mini et al. · ClawHub(100 agent skills)、Claude Code et al. · ASR、SNS et al.
Evaluated models
Claude-4.6-SonnetGPT-5-miniGLM-4.7MiniMax-M2.1DeepSeek-V4-flashGLM-5.1MiniMax-M2.7MiMo-V2.7GPT-5.4Claude Opus 4.6
Benchmarks
ClawHub(100 agent skills)Claude CodeOpenClawSkill-Inject的Obvious Injections with Body + Script
Metrics
ASRSNSdetection accuracy
AI summaryResearchers propose SkillJect, a prompt injection framework that automatically generates poisoned skills for skill-based agents, which the authors describe as the first automated framework in this direction. It implants payloads through two channels: the artifact channel hides payloads in auxiliary scripts, and the instruction channel rewrites SKILL.md, placing the injected content at the front and wrapping the auxiliary script as a mandatory initialization step, while also providing the script path and example commands. The framework uses a closed-loop multi-agent process, where an Attack Agent generates poisoned skills, a Victim Agent executes downstream tasks, and an Evaluate Agent checks execution traces to determine whether the payload was executed, with feedback then used to rewrite SKILL.md while keeping the payload unchanged. Experiments across multiple skill platforms, backend LLMs, and attack categories show that its effectiveness is significantly better than naive direct injection and previous manual skill injection attacks.

Researchers propose SkillJect, a prompt injection framework that automatically generates poisoned skills for skill-based agents, which the authors describe as the first automated framework in this direction. It implants payloads through two channels: the artifact channel hides payloads in auxiliary scripts, and the instruction channel rewrites SKILL.md, placing the injected content at the front and wrapping the auxiliary script as a mandatory initialization step, while also providing the script path and example commands. The framework uses a closed-loop multi-agent process, where an Attack Agent generates poisoned skills, a Victim Agent executes downstream tasks, and an Evaluate Agent checks execution traces to determine whether the payload was executed, with feedback then used to rewrite SKILL.md while keeping the payload unchanged. Experiments across multiple skill platforms, backend LLMs, and attack categories show that its effectiveness is significantly better than naive direct injection and previous manual skill injection attacks.

Related events and news

2 events · 3 news mentions

News that mentions this paper

CORSA 研究揭示 Agent Skill 检索排名攻击面

研究提出技能投毒2.0:借口与执行解耦

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    The authors aim to automatically generate poisoned skills that can trigger hidden helper execution, replacing manual injection that is prone to failure.

    How to automatically generate poisoned skills that cause code agents with skills enabled to execute hidden payloads.

    • Scenario: The authors say agent skills are packaged as SKILL.md, executable scripts, and resources, and after installation can be repeatedly loaded as task guidance, making them more persistent than web pages, retrieved documents, or tool outputs, forming a supply chain attack surface (introduction, Fig. 1). The specific impact depends on runtime permissions, sandboxing, networking, and user approval.
    • Existing shortcomings: The authors say that among publicly collected malicious skills, most embedded instructions are rejected or ignored, and only a small portion trigger the target behavior (Fig. 2 is annotated with Attack Success values such as 2.5, 5.0, 7.5; plain text cannot reliably map to each model's legend). Existing demonstrations are mostly manual and difficult to activate reliably across skills, tasks, and victim systems.
    • Core observation: Explicitly harmful intent may be rejected by safety mechanisms; instructions weakly tied to the original workflow or current task may be ignored. The authors therefore separate malicious functionality from suspicious wording.
    • Proposed in this paper: SkillJect hides payloads in auxiliary scripts, rewrites SKILL.md with front-loaded inducement, and uses Attack Agent, Victim Agent, and Evaluate Agent to iteratively rewrite documents and fix payloads based on trajectory feedback. The authors say this is the first automated prompt injection framework targeting agent skills.
    • Threat model:
      • Knowledge: The authors state it is black-box. They do not control routing, model parameters, system prompts, or safety mechanisms, and cannot directly intervene in execution after installation.
      • Capabilities: Before distribution, they can modify documents and bundled artifacts; channels include public skill registries, shared repositories, or importable skill packages.
      • Goal and success criteria: When a poisoned skill is selected and executed, the trajectory should satisfy the predicate that the corresponding helper is executed. Success counts payload execution; downstream harm need not fully materialize.
      • Victim system: Task-driven code agents that select skills from a registry based on the current task; after selection, the document is loaded, and bundled artifacts can be used during execution. It is not assumed that routing can be forced to select the poisoned skill on unrelated tasks.
  2. What related research exists?

    Related work mostly involves manual skill injection or runtime prompt injection; the authors distinguish themselves through automatic hiding and feedback-based refinement.

    Agent skill ecosystem

    • Anthropic's Agent Skills specification organizes capability packages as SKILL.md plus optional scripts and resources; Claude Code, Codex CLI, and Gemini CLI adopt similar on-demand loaded plugin-style capability packages.
    • The paper discusses tool-augmented agents and code agents, and states that public websites, GitHub, and official collections lower reuse costs and also allow installed skills to be repeatedly selected and treated as trusted extensions.

    Prompt injection in agents

    • Indirect prompt injection places instructions in web pages, documents, retrieved passages, or tool outputs. Liu et al. study prompt injection in real LLM applications and the limitations of naive defenses; Wang et al. separately study hijacking of web agents via web pages or tool outputs, as well as cross-modal injection combining vision and text.
    • The paper separates this from user-submitted jailbreaks and states that existing work mostly focuses on one-shot runtime inputs. In contrast, skills reside within reusable capability extensions, which the authors claim are more persistent and have more direct impact.

    Skill security and manual attacks

    • Ecosystem studies note that public repositories already contain prompt injection, data exfiltration, privilege escalation, credential leakage, and suspicious execution logic; another work states that inspecting only the skill itself overestimates maliciousness, and repository-level context improves classification robustness.
    • Schmotz et al. show that malicious instructions in skill files can be trusted during execution; Skill-Inject measures agent vulnerability to malicious skill files; SkillAttack red-teams benign skills with adversarial prompts. The paper states these attacks mainly rely on hand-written malicious instructions or predefined content, where explicit intent may be rejected and weakly coupled instructions may be ignored.

    Defenses and pre-installation review

    • Runtime directions include adding safety instructions to system or task prompts, instruction hierarchy training, structured queries, and capability policies based on trusted control/data flow; AgentDojo provides a dynamic attack-defense benchmark for tool-augmented agents. The paper states these mainly target web pages, documents, retrieval, email, or tool outputs, and can only mitigate, not eliminate, injection into skills treated as trusted extensions with intent distributed across documents and scripts.

    • Pre-installation scanning includes Cisco's Skill Scanner, Skill Vetter, SlowMist Skill Scanner, and ClawGuard Auditor. The paper states static scanning can catch explicit malicious instructions, dangerous commands, credential access, or known exfiltration patterns, but may miss attacks where intent appears only through interactions among documents, auxiliary artifacts, repository context, and execution behavior.

    • Baselines and benchmarks: Naive (Direct Injection) writes malicious commands directly into SKILL.md without helpers, hiding, or obfuscation. When comparing with Skill-Inject, it uses its Obvious Injections with Body + Script setting, along with the same clean skills and malicious scripts. The self-built data consists of 100 skills from ClawHub and corresponding tasks.

    The authors position this paper as automatically generating poisoned skills using payload hiding, trajectory verification, and feedback refinement, rather than performing manual injection again.

  3. How does the paper address this problem?

    SkillJect hides the payload in the helper, rewrites SKILL.md into a mandatory prerequisite step, and then revises the document based on trajectory feedback.

    SkillJect decomposes poisoning into document-induced guidance and artifact-hidden payloads, then uses execution trajectories to iteratively rewrite only the document while keeping the payload unchanged.

    Problem Setting

    • A skill package is written as S=(d, A): d is SKILL.md, and A is optional auxiliary artifacts such as scripts and configurations. Given a target behavior category B, the attacker constructs S'=(d', A').
    • The dual-channel is written as d′=INJECT(d, π), A′=HIDEPAYLOAD(A)=A ∪ amB. This means: the document inserts an inducing prompt π, and the artifact set appends the hidden helper script corresponding to B.
    • The success predicate is M(τ; B)∈0,1. This means: the trajectory τ contains an explicit execution of that helper, yielding 1; otherwise 0. The paper computes ASR accordingly, without requiring every downstream harm to be realized.
    • There is no assumption that routing can be forced to select S'. The predicate is only pursued with high probability when S' belongs to the set of skills the agent actually executes for task t.

    Dual-Channel Hiding

    • Artifact channel: Malicious operations are placed in seemingly ordinary .py or .sh helpers. The paper gives examples such as helper.sh, run.sh, and tool.py. A' retains the original artifacts and appends this script.
    • Instruction channel: The inducing content is placed at the very beginning of SKILL.md, presenting the helper as a mandatory prerequisite or first step, specifying the script path and providing executable example commands, making it appear like normal initialization.
    • Alignment: The inducing content must align with the hidden script's behavior to make the document appear coherent. The authors state that explicit malicious content is not placed in the rewritten document.

    Closed-Loop Generation

    1. Payload understanding: The Attack Agent analyzes the new helper and its filename to obtain a structured understanding, including nominal functionality, inputs and outputs, expected execution phase, and its role in the workflow.
    2. Constraint generation: An initial SKILL.md is generated using the original document, the above understanding, behavior category B, and prerequisite constraints. This constraint places the helper instructions at the top of the document to increase prominence and execution priority.
    3. Feedback refinement: The payload is generated only once; thereafter, A' is fixed. The Victim Agent runs the poisoned skill on a batch of tasks; the Evaluate Agent returns whether execution occurred, along with diagnostics and evidence such as ignored, refused, partially triggered, or incorrectly executed. The Attack Agent rewrites the document accordingly until success or until the budget is reached.
    4. Roles and prompts: In experiments, the Attack Agent is GPT-3.5-Turbo with prerequisite constraints. The paper does not specify whether the Evaluate Agent is a named LLM. Appendix A provides the full prompts for payload understanding, constraint generation, and feedback refinement; Appendix B provides the algorithm.

    Success Determination

    • Tool calls, command executions, file operations, and intermediate or final outputs are checked, but only to determine whether the hidden helper was explicitly executed.
    • The authors state that trajectory-level execution shifts control from the document to attacker-controlled executable artifacts; the final impact still depends on sandboxing, file system permissions, network, user approval, and runtime enforcement.
  4. What experiments did the paper conduct?

    On Claude Code, Naive achieves an ASR of 0.0%, while SkillJect averages 80.7% Overall across four backends.

    Experimental Setup

    • Platforms: The main platform is Claude Code; cross-platform testing is also done on OpenClaw. Both execute commands and tool actions in a sandboxed Docker environment.
    • Tested backends: Main experiments use Claude-4.6-Sonnet (written as Claude-Sonnet-4.6 in tables), GPT-5-mini, GLM-4.7, and MiniMax-M2.1. Extensions include DeepSeek-V4-flash, GLM-5.1, MiniMax-M2.7, MiMo-V2.7, GPT-5.4, and Claude Opus 4.6 (written as Claude-Opus-4.6 in tables).
    • Attacker: GPT-3.5-Turbo with prerequisite constraints generates malicious skills. The paper does not specify the model name for the Evaluate Agent.
    • Data and behaviors: 100 skills from ClawHub, covering four domains: software development and DevOps, data and financial analysis, content creation and marketing, and research and agent tools. Each skill has one task requiring the use of that skill and triggering its legitimate functionality; Appendix C states that all 100 tasks have instruction.md, 71 include auxiliary workspace files, and instructions range from 14 to 36 words with an average of 26.84 words. The four behavior categories are InfoDisc, PrivEsc, UnauWri, and Backdoor. The extension experiment randomly samples 30 skills/tasks from the 100 and reports the average Overall ASR across the four categories.
    • Metrics and baselines: ASR is the proportion of tasks where the corresponding helper is observed to be executed. Additional metrics include SNS and scanner detection accuracy. Baselines are Naive direct injection and Skill-Inject under Obvious Injections with Body + Script, using the same clean skills and malicious scripts. The paper does not specify the number of refinement rounds, query counts, or repetitions in the main tables.

    Main Results

    Table I shows SkillJect's ASR (%) on Claude Code. Naive is 0.0% in all cells and is not repeated in the table.

    Swipe horizontally to read the table

    BackendInfoDiscPrivEscUnauWriBackdoorOverall
    GLM-4.798.0%95.0%98.0%98.0%97.2%
    MiniMax-M2.195.0%95.0%95.0%94.0%94.7%
    GPT-5-mini88.0%79.0%84.0%84.0%83.8%
    Claude-Sonnet-4.634.0%55.0%57.0%42.0%47.0%
    Average78.8%81.0%83.5%79.5%80.7%
    • The authors state that directly writing explicit malicious instructions into SKILL.md is largely ineffective; effective injection also requires hiding the payload and automatically constructing the inducing content.
    • The authors state that the average Overall ASR is 80.7%; the highest category average is UnauWri at 83.5%, and the lowest is InfoDisc at 78.8%.
    • Claude-Sonnet-4.6's Overall is 47.0%, lower than the other three backends. The authors state it is relatively more resistant, but the ASR is still non-zero. The lowest cell in Table I is that model's InfoDisc at 34.0%.

    Cross-Platform and Updated Models

    • OpenClaw (Table II): Naive is 0 on all four backends. SkillJect achieves GLM-4.7 97, MiniMax-M2.1 95, GPT-5-mini 87, Claude-Sonnet-4.6 43, with an Overall of 80.5. This table does not include percent signs and is not broken down by behavior category. The authors state the ranking matches Claude Code, and the effect does not depend on a single scaffold.
    • Updated models (Table III): On a random set of 30 skills/tasks, Naive is 0.0% everywhere. SkillJect's Overall is DeepSeek-V4-flash 95.8%, GLM-5.1 92.4%, MiniMax-M2.7 90.2%, MiMo-V2.7 74.3%, GPT-5.4 28.7%, Claude-Opus-4.6 29.2%, with a six-model average of 68.4%. The authors suggest the decline for the latter two may stem from stronger safety alignment, more cautious tool use, or reasoning about task relevance, and state that model scaling and stronger alignment do not fully eliminate this risk.

    Comparison, Transfer, and Cross-Task

    • Same-script comparison (Table V, Claude Code): Skill-Inject's Overall is 32.3%, while SkillJect's is 69.1%. Per-model ranges are from 40.0% to 82.2% (GLM-4.7), 35.6% to 80.9% (MiniMax-M2.1), 26.7% to 64.4% (GPT-5-mini), and 26.7% to 48.9% (Claude-Sonnet-4.6). The authors state that both use the same benign skills and malicious scripts, and the improvement mainly comes from automatic induction and feedback refinement. Table IV lists the Overall ASR for manual attacks, Naive, and SkillJect as 32.3, 0.0, and 69.1, which is not the same setting as Table I's 80.7%.
    • Cross-model (Table VI): Generated on GLM-4.7 without target-specific refinement. MiniMax-M2.1's Overall is 79.8% (InfoDisc 81.0%, PrivEsc 76.0%, UnauWri 77.0%, Backdoor 85.0%); GPT-5-mini is 49.8%; Claude-Sonnet-4.6 is 35.8%. The authors state that relative to the source model's 97.2%, these are declines of 17.4, 47.4, and 61.4 percentage points, respectively.
    • Cross-task (Fig. 4, GLM-4.7): The same poisoned skill is evaluated directly on 20 additional LLM-generated task instructions, without regeneration or refinement. The original task's four categories are 98%, 98%, 95%, 98%; cross-task values are 80%, 72%, 77%, 70% (in order: Backdoor, InfoDisc, PrivEsc, UnauWri). The authors state that the attack is not merely fitted to the source task, but the effect still depends on whether new instructions activate the injected workflow. The paper does not specify the model name used to generate these 20 instructions.

    Defense Evaluation

    • Instruction-level prompts (Fig. 8, GLM-4.7): Requires checking referenced scripts before execution. The authors state that Backdoor drops from 98% to 40%, InfoDisc from 98% to 10%, PrivEsc from 95% to 66%, and UnauWri from 98% to 77%; the average across four categories drops from 97.3% to 48.3%, an absolute decline of 49.0 percentage points. In Table I, the same backend's Overall is 97.2%, which is not the same figure as 97.3%. The authors state that this defense can reduce but not eliminate the risk; PrivEsc and UnauWri remain at 66% and 77% after defense.
    • Scanners (Table VII): The objects are poisoned skills generated by SkillJect on GLM-4.7. Detection accuracy is Cisco 63.8%, Vetter 53.1%, SlowMist 64.2%, Auditor 65.0%, with an Overall of 61.5%. The authors state that many are missed, mainly because the visible document presents the helper as a prerequisite step compatible with benign workflows, and the malicious operations are in auxiliary artifacts, only becoming security-relevant at execution time. The paper does not report the number of items in this set.

    Other Ablations and Analyses

    • Table VIII (GLM-4.7, Overall): Full method 97.2%; without payload understanding 91.0%; without the prerequisite strategy 78.8% (UnauWri 78.0%, Backdoor 75.0%); without refinement feedback 80.5% (PrivEsc from 95.0% to 73.0%).
    • Fig. 6: The authors state that after five rounds, GLM-4.7, MiniMax-M2.1, GPT-5-mini, and Claude-Sonnet-4.6 achieve ASRs of 97.2%, 94.6%, 83.8%, and 52.8%; gains are larger in early rounds and then plateau. The figure caption extraction includes a label like 94.26%, which does not exactly match the main text's 94.6%.
    • Fig. 7's SNS (GLM-4.7, higher means more consistent with the original skill, not safety): Naive/SkillJect are Backdoor 0.223/0.429, InfoDisc 0.318/0.415, PrivEsc 0.340/0.429, UnauWri 0.259/0.462. Appendix D states that high SNS does not imply the skill is benign; the reviewer model name is not specified.
    • Fig. 5 shows two types of surface forms: structurally disguised as a prerequisite subsection, and emphasized initialization warnings. Specific injection sentences are not paraphrased. In Fig. 2, Attack Success annotations for publicly malicious skills include 2.5, 5.0, and 7.5, and the main text states that most are rejected or ignored.
  5. What are some points that can be further explored?

    The authors define success as the selected helper executing, and note that ecosystem, deployment, and stronger defenses remain open for further research.

    Limitations and Future Directions Noted by the Authors

    • ASR measures whether the helper is executed; the authors do not claim that every execution realizes all downstream consequences in every deployment; the final impact depends on sandbox policies, file permissions, network, user approval, and runtime enforcement (Section V).
    • The evaluation is post-selection: the poisoned skill must first be selected by routing or retrieval. The authors state they did not study how to force routing to select malicious skills for unrelated tasks (Section V).
    • The benchmark includes 100 real skills and representative task instructions; the authors state it may not cover the entire skill ecosystem, agent scaffolds, or deployment strategies (Section V).
    • Multiple backend LLMs and two skill platforms have been evaluated; the authors state that behavior may still vary with system prompts, tool permissions, sandbox configurations, and human-in-the-loop approval (Section V).
    • Defense evaluation focuses on practical prompt-level mitigations and existing skill scanners. The authors state that stronger defenses remain future work (Section V). The conclusion also states that future defenses should jointly consider skill documents, auxiliary artifacts, execution trajectories, and runtime tool policies.

    Experimental Coverage

    • Main result backends are Claude-4.6-Sonnet, GPT-5-mini, GLM-4.7, and MiniMax-M2.1; platforms are Claude Code and OpenClaw; behaviors are the four categories; data are 100 skills from ClawHub with one-to-one corresponding tasks.
    • The updated-model experiment uses 6 backends and a random set of 30 skills/tasks, reporting only the average Overall ASR across the four categories (Table III).
    • The attack generation model is GPT-3.5-Turbo. The paper does not specify the number of refinement rounds, query counts, or repetitions in the main result tables; Fig. 6's analysis specifies five rounds.
    • Defenses include instruction-level prompt hardening in Fig. 8 and four scanners in Table VII. The paper does not report the number of items in the scanned set, the SNS reviewer model name, or the LLM used to generate cross-task instructions.
    • Transfer includes cross-model evaluation with GLM-4.7 as the source and no target-specific refinement (Table VI), and cross-task evaluation on 20 additional task instructions for the same skill (Fig. 4).
  6. Summarize the main content of the paper

    SkillJect uses dual channels and closed-loop refinement to poison skills; main result average ASR 80.7%, Naive 0.0%.

    SkillJect is an automated prompt injection framework targeting installable agent skills. The authors address the problem that malicious instructions placed publicly or manually in skills are often rejected or ignored, yet once a skill is installed, it is repeatedly loaded as trusted guidance.

    • Approach: A black-box attacker modifies the package before distribution; after installation, they cannot intervene in execution or force routing to select it. The payload is placed in an auxiliary helper script; SKILL.md presents that script as a mandatory prerequisite step at the top of the document, specifying the path and example commands. GPT-3.5-Turbo serves as the Attack Agent, iteratively rewriting the document based on trajectory diagnostics, while the payload remains fixed. Success is determined solely by whether the helper is explicitly executed.
    • Main results: The self-built dataset consists of 100 skills from ClawHub. On Claude Code, Naive achieves an ASR of 0.0% across all cases; SkillJect achieves an average Overall of 80.7% across four backends, with GLM-4.7 at 97.2% and Claude-Sonnet-4.6 at 47.0% (Table I). On OpenClaw, the Overall is 80.5 (Table II).
    • Other results: When compared with Skill-Inject using the same benign skills and malicious scripts, the Overall increases from 32.3% to 69.1% (Table V). On a random set of 30 skills, GPT-5.4 and Claude-Opus-4.6 achieve 28.7% and 29.2%, respectively (Table III). After instruction-level defenses on GLM-4.7, the average across four categories drops from the authors' reported 97.3% to 48.3%, with PrivEsc and UnauWri still at 66% and 77%. Four scanners achieve an Overall detection accuracy of 61.5%.
    • Authors' conclusion: The authors state that the reusable skill ecosystem can become a persistent attack vector when poisoned skills are selected and executed; existing prompt-level defenses and scanners provide only partial mitigation. They recommend treating skills as security-sensitive software artifacts and jointly inspecting documents, auxiliary artifacts, trajectories, and runtime tool policies.

Related papers

Show 3 more papers
Read originalarxiv.org