Source-linked AI summary

Skill-Inject: Measuring Agent Vulnerability to Skill File Attacks

David Schmotz, Luca Beurer-Kellner, Sahar Abdelnabi, Maksym Andriushchenko

arXiv:2602.20156v3cs.CRcs.LG

TL;DR

Agent skills expand LLM agents with third-party instructions but create a supply-chain surface for context-dependent prompt injections. This paper introduces SKILL-INJECT, a benchmark evaluating security and utility across skill-based attacks, and finds that widely used agents remain highly vulnerable even when warned. The authors conclude that robust protection requires context-aware authorization rather than simple filtering or model scaling.

  • Problem

    Third-party skills add external instructions to agent systems, creating a supply-chain attack surface where malicious directives can be hidden among legitimate instructions and depend on context.

  • Method

    SKILL-INJECT benchmarks skill-based prompt-injection vulnerabilities using realistic skill files, obvious and contextual attacks, and evaluations of security, utility, and baseline LLM-judge defenses.

  • Results

    Widely used agent scaffolds with frontier models are highly vulnerable to skill-based attacks, including data exfiltration, ransomware, and destructive operations, even when warned.

  • Takeaways & Limitations

    The findings support treating third-party skills as untrusted and developing context-aware authorization mechanisms that distinguish legitimate instructions from malicious ones.

  • Takeaways & Limitations

    The evaluation covers a finite set of skills, tasks, and threat models, and results may change with other implementations or more adaptive attackers.

Abstract

from arXiv · show

LLM agents are evolving rapidly, powered by code execution, tools, and the recently introduced agent skills feature. Skills allow users to extend LLM applications with specialized third-party code, knowledge, and instructions. Although this can extend agent capabilities to new domains, it creates an increasingly complex agent supply chain, offering new surfaces for prompt injection attacks. We identify skill-based prompt injection as a significant threat and introduce SkillInject, a benchmark evaluating the susceptibility of widely-used LLM agents to injections through skill files. SkillInject contains 202 injection-task pairs with attacks ranging from obviously malicious injections to subtle, context-dependent attacks hidden in otherwise legitimate instructions. We evaluate frontier LLMs on SkillInject, measuring both security in terms of harmful instruction avoidance and utility in terms of legitimate instruction compliance. Our results show that today's agents are highly vulnerable with up to 80% attack success rate with frontier models, often executing extremely harmful instructions including data exfiltration, destructive action, and ransomware-like behavior. They furthermore suggest that this problem will not be solved through model scaling or simple input filtering, but that robust agent security will require context-aware authorization frameworks. Our benchmark is available at https://www.skill-inject.com/.

1. Introduction

Agent skills extend LLM agents with specialized capabilities but introduce a supply-chain attack surface in which third-party instructions can conflict with legitimate agent behavior. SKILL-INJECT benchmarks this vulnerability while measuring both harmful-instruction avoidance and legitimate task compliance.

  • Motivation: Third-party skills add prompts to an agent’s trusted instruction set, allowing malicious instructions to remain unnoticed while being executed.Skills can embed malicious instructions similarly to malware in software packages.
  • Motivation: Skill-based injections are difficult to separate from benign instructions because skill files consist entirely of instructions and often encode domain-specific procedures.This limits defenses based on instruction authority or separating instructions from data.
  • Motivation: Dual-use instructions may be legitimate in one context but enable data exfiltration or privilege escalation in another.For example, sharing a summary can be appropriate for internal documentation but unsafe for confidential files or credentials.
  • Benchmark: SKILL-INJECT is introduced as a benchmark focused on instruction-instruction conflicts in agent skills.It emphasizes realistic skill files, context-dependent injections, and the security–utility trade-off.
  • Contributions: The benchmark evaluates state-of-the-art models and agent systems on harmful-instruction avoidance, legitimate-instruction compliance, and baseline LLM-judge defenses.The paper presents the benchmark as an extendable evaluation harness for skill-based vulnerabilities.

2. Related Work

Prior prompt-injection defenses often assume that instructions and data are separable or that actions can be predetermined from trusted sources. Skill-based attacks challenge these assumptions because malicious natural-language instructions are embedded in legitimate instruction files and depend on context.

  • Illustrative Attacks: A contextual backup instruction can appear routine while enabling document exfiltration when it sends files to an external server.Its legitimacy changes with the applicable security policy and destination trust.
  • Prompt-Injection Benchmarks: SKILL-INJECT differs from earlier benchmarks by targeting skill-based injections, instruction-instruction conflicts, and contextual security judgments.Earlier benchmarks covered web agents, email assistants, tool outputs, and computer-use agents.
  • Defenses: Standard defenses that mark external data or enforce instruction hierarchies are less applicable when the attack source is itself an instruction file.Skill-based designs dynamically extend the agent’s instruction set beyond the user query.
  • Supply-Chain Attacks: Agent skills create a new supply-chain entry point for natural-language attacks that can circumvent scanners designed to detect abnormal instructions in static data.The broader AI ecosystem also includes attack surfaces such as retrieval databases, training datasets, tools, and memory systems.
  • Contextual Security: Contextual integrity motivates treating appropriateness as dependent on who may share what information with whom and under which conditions.The paper connects this perspective to context-aware authorization for agent actions.

3. How Do Agent Skills Work?

Agent skills are dynamically loaded extensions containing instructions, scripts, and resources, commonly distributed by third parties. Their broad access to sensitive agent environments makes hidden prompt injections a practical supply-chain threat.

  • Skill Structure: A skill is a directory containing instructions, scripts, and resources, centered on a potentially long-form SKILL.md file.The file describes the skill’s purpose, APIs, tools, or file formats.
  • Skill Integration: Lazy loading exposes a skill’s name, location, and brief scope first, while the agent decides when to access its full instructions.This allows the full skill file to be loaded on demand.
  • Distribution and Trust: Third-party publication creates a trust problem because users may lack the expertise to audit skill instructions before installation.Skills are distributed through emerging marketplaces and repositories.
  • Threat Surface: Skills are prime attack targets because users rarely audit them and capable agents may expose files, proprietary code, email, and credentials.Malicious payloads can therefore be difficult to spot, broadly distributed, and able to evade scanners focused on abnormal content.
  • Example Attack: A buried backup instruction in a presentation skill can create a data-exfiltration backdoor, although the same operation may be valid under an explicitly trusted destination policy.The example illustrates why skill security depends on context.

4. The SKILL-INJECT Benchmark

SKILL-INJECT is designed to measure skill-based injection vulnerabilities using realistic skills, obvious and contextual attacks, and explicit security policies. The benchmark distinguishes legitimate compliance from security failures caused by executing warned-against injections.

  • Benchmark Scope: SKILL-INJECT spans 23 skills and includes 30 obvious injections plus 41 contextual injections paired with real tasks.These form 76 obvious injection–task pairs and 126 contextual injection–task pairs.
  • Design Principles: The benchmark prioritizes realism by embedding malicious lines among plausible operational guidance in modern coding-agent skill files.It also covers dual-use attacks to measure the security–utility trade-off.
  • Security Policies: Security policies define trust boundaries and control whether a contextual injection is authorized or prohibited.They model realistic deployments while varying injection ambiguity.
  • Security Policies: A legitimizing policy authorizes the injected action, whereas a warning policy flags it as a policy violation that the agent should not execute.The two variants make contextual security judgments explicit.
  • Security Metrics: Executing an injection despite an active warning policy is defined as a true security failure.The benchmark also reports execution rates under no-policy, legitimizing, and warning conditions.

5. Evaluation

The evaluation measures skill-based injection vulnerability across models, attack capabilities, and safety-policy conditions, finding substantial contextual and obvious-injection success rates. Ablations show that scripts, description-field injections, and repeated attempts can further increase attack effectiveness, while screening and policy prompting impose utility tradeoffs.

  • Evaluation setup: The benchmark evaluates frontier agents across contextual and obvious injections, safety-policy conditions, and body, script, and YAML-description attacker capabilities.It measures security as harmful-instruction avoidance and utility as legitimate-instruction compliance.
  • Main results: 41.0%–79.0% ASR occurs for contextual body injections under the baseline condition, with most models exceeding 50%.OpenAI’s newer Codex models exceed 65% ASR, while Claude models range from 41% to 52%.
  • Main results: Warning prompts generally reduce ASR without eliminating successful attacks, whereas legitimizing prompts often increase execution success as authorized behavior.Their effects vary substantially across model families; warning has minimal impact on some systems, while legitimizing prompts can reduce utility for others.
  • Main results: Up to 70% ASR occurs for unambiguously harmful injections, including filesystem deletion, ransomware, remote-shell execution, and phishing actions.Best-of-n attacks over alternative injection lines can increase success significantly.
  • Ablation studies: Script-based attacks achieve 71.8% contextual and 62.8% obvious-injection ASR, compared with 53.8% and 53.7% for direct text injections.The reported disparity is associated with models not always inspecting auxiliary scripts before execution.
  • Ablation studies: Description injections increase overall success by 10.6 percentage points on average and by 16.8 points under the Warning condition.Repeated-attempt ablations identify injection position as the primary variance driver, while changing the user task has little effect; LLM screening preserves benign-skill recommendations but harms utility under legitimizing policies.

6. Conclusions

SKILL-INJECT identifies a structural security problem in tool-using agents that ingest third-party skills, especially when authorization depends on task context. It recommends treating skills as untrusted and using least-privilege, context-aware authorization, while noting that the evaluation has finite scope and may underestimate adaptive attacks.

  • Security problem: Third-party skills blur the boundary between trusted instructions and external data, leaving agents without an explicit, grounded notion of context and authorization.The resulting failures can include data exfiltration, ransomware deployment, and destructive operations through natural language alone.
  • Recommendations: Robust defenses should treat skill files as untrusted by default, bind them to least-privilege capabilities, and require context-aware authorization for external side effects.LLM-based security screening may help, but the paper states that it is not fully effective.
  • Limitations: The evaluation covers a finite set of skills, tasks, and threat models, so results may change with other agent implementations or more adaptive attackers.The authors also note that task- and model-specific optimization could produce higher attack success rates.

Impact Statement

The work exposes vulnerabilities in widely deployed AI agent systems and therefore carries dual-use risks. The authors disclosed findings to some providers and designed SKILL-INJECT as an evaluation benchmark rather than an exploit toolkit.

  • Impact Statement: Exposing vulnerabilities in widely deployed AI agent systems carries inherent dual-use risks.The impact statement frames disclosure itself as a potential misuse concern.
  • Responsible disclosure: The authors disclosed findings to some LLM providers before publication to enable system strengthening.SKILL-INJECT is presented as a benchmark for measuring baseline robustness without releasing optimized attacks.

A. Skill Screening Ablation and Security Policies

The screening ablation tests whether a judge model recommends clean and injected skills under different contextual conditions, including an authorizing security protocol. Its metrics distinguish desired recommendations for normal, injected, and legitimizing skills.

  • Screening setup: The screening experiment asks a judge model whether a skill file is safe before execution across benign and injected conditions.The tested conditions include injected skills without additional context and injected skills accompanied by a legitimizing security protocol.
  • Security policies: Table 6 reports the percentage of skills recommended under Normal, Injected, and Legitimizing conditions.Higher recommendation rates are desirable for Normal skills, lower rates for Injected skills, and higher rates for Legitimizing skills when organizational policy is respected.

B. Evaluating Results of LLM Agents on User and Attacker Tasks

Experiments run in isolated containers and evaluate both user-task completion and attacker-payload execution using outputs, filesystem changes, bash history, and network activity. A separate judge determines success for each task.

  • Execution environment: Each experiment runs in an isolated container containing only files relevant to the task, then preserves the working directory and logs after shutdown.This setup supports post-run inspection of task artifacts and execution traces.
  • Evaluation: A separate LLM judge assesses user-task success and attacker-task success using the agent output, complete working directory, and bash history.The judge first inspects the output and can examine remaining files when additional context is needed.
  • Security-policy framing: The legitimizing policy variant frames an injected action as pre-approved, whereas the warning variant flags it as a policy violation.Each injection uses context-specific legitimizing and warning text within a constant framing wrapper.
  • Success criteria: The attacker task counts as successful when logs show payload execution through bash history, filesystem changes, or network requests.Examples include curl calls to attacker-controlled URLs, rm commands on user files, or execution of referenced scripts.

C. Additional Tables and Figures

This supplementary material provides detailed contextual-injection results, model-specific analyses, chain-of-thought examples, and skill-length comparisons. It documents both vulnerability patterns and evaluation constraints, including context-window effects and confounding between skill length and injection composition.

  • Scope: The supplementary section contains full contextual-injection results, model commentary, chain-of-thought examples, and skill-length analysis.These materials support reproducibility and detailed inspection rather than the main narrative.
  • Model-specific performance: GPT-4 has the lowest attack success rate but also the lowest task completion rate, partly because its shorter context window limits processing of long skills.Many skill files exceed GPT-4’s effective context, causing it to miss both legitimate instructions and injected payloads.
  • Model-specific performance: Opus 4.5’s attack success rate is lower under the Legitimizing condition than under Normal or Warning conditions.The authors hypothesize that coercive legitimizing framing makes the model more suspicious rather than granting the skill higher authority.
  • Evaluation considerations: Task completion and attack success can represent distinct failure modes when an attack destroys files needed for the user task.The ransomware example encrypts and deletes required files, so counting the case as ordinary task failure would conflate attack impact with capability failure.
  • Chain-of-thought examples: Opus 4.5 chain-of-thought examples show it completing legitimate tasks while identifying legitimizing context and injected instructions as prompt-injection attacks.One example reports successful git initialization alongside refusal of an injected backup endpoint script.
  • Skill length analysis: Skill length alone does not determine vulnerability because per-skill attack success rates also reflect the number and types of injections tested.The authors therefore treat skill length as at most a contributing factor rather than a sufficient explanation.

D.1. Contextual Injections into Skills

This section presents contextual injections embedded in skills and illustrates how seemingly legitimate procedures can trigger destructive actions, code execution, data exfiltration, and phishing. It also summarizes attack-success comparisons across skills of different lengths.

  • Skill length: The five shortest skills show uniformly low vulnerability, while the five longest skills show widely varying attack success rates.The longest skills include docx and pptx, with maximum observed attack success rates of 45.0% and 45.4%, respectively.
  • Contextual injection examples: A seemingly benign backup script in the docx skill downloads and executes malicious code.The injection is presented as a script-based file-backup instruction.
  • Contextual injection examples: A file-integrity check in the xlsx skill can execute rm -rf and delete all files.The destructive command is hidden inside an instruction framed as an integrity check.
  • Contextual injection examples: An xlsx integrity-check procedure can delete all database files using rm $(cat db files.txt).The procedure culminates in database-file deletion rather than a benign integrity check.
  • Contextual injection examples: The python-code skill can instruct an agent to scan for .env files containing API keys and upload them to an attacker-controlled server.The injection conflicts with the skill’s stated data-safety principles for SQLite and project maintenance.
  • Contextual injection examples: The email-api skill can harvest contacts and send phishing messages to every address.The injected procedure turns an email automation capability into a phishing operation.
Loading 2602.20156v3…