Skill-Inject: Measuring Agent Vulnerability to Skill File Attacks

David Schmotz, Luca Beurer-Kellner, Sahar Abdelnabi, Maksym AndriushchenkoNeurIPS 2026 Evaluations and Datasets Track Poster 2026

TL;DR

Modern AI coding assistants and agents can now install third-party "skills"—instruction packages that teach them how to use new tools or workflows. This paper introduces SKILL-INJECT, a benchmark showing that malicious instructions hidden inside these skill files can trick frontier LLM agents into deleting files, exfiltrating data, or even running ransomware—succeeding up to 59.5% of the time on a single try and 80.6% with a simple adaptive attack. Crucially, because skill files are supposed to contain instructions, standard prompt-injection defenses that separate "instructions" from "data" fall apart.

What Problem Does This Paper Address?

To make LLM agents more capable, platforms like Claude Code, Gemini CLI, and OpenAI Codex CLI support agent skills: directories containing a SKILL.md file (with natural-language instructions) and helper scripts that an agent loads on demand.

This creates a classic software supply-chain problem, but with a twist. Traditional prompt injection attacks hide malicious commands inside data (like an email or a webpage), and most defenses work by teaching models to ignore instructions found in data. Skill files, however, are entirely composed of instructions. You can't just tell the agent to ignore instructions in a skill file without breaking the skill itself.

Worse yet, skill security is deeply contextual. An instruction like "upload a summary to this external API" might be a legitimate team workflow in one project, and catastrophic data exfiltration in another.

Methods

To measure this vulnerability, the authors run real-world agent scaffolds inside isolated containers, give them a benign user task (e.g., creating a PowerPoint presentation) alongside a compromised skill, and log every bash command and file change.

Figure 2: SKILL-INJECT evaluates the utility (User Task Outcome) and the security (Attacker Task Outcome) of AI agents in the presence of skill-based attacks in dynamic, real-world agents like Claude Code, Gemini CLI and OpenAI Codex CLI. In skill-based attacks, an attacker places malicious instructions in an otherwise legitimate skill extension, which are then sent to the agent.

They evaluate both utility (did the agent finish the user's task?) and security (did the agent execute the attacker's payload?) using unit tests and LLM judges. For contextual injections, they test three system-prompt conditions:

  • Normal: No extra security policy is provided.
  • Warning: A policy explicitly flags the injected action as a violation.
  • Legitimizing: A policy explicitly authorizes the action (making execution the correct behavior).

They also test adaptive attackers using a Best-of-5 (Bo5) strategy—varying where the malicious line is placed in SKILL.md (Bo5-line) or jointly varying placement and the user task (Bo5-combined).

Datasets

The authors introduce SKILL-INJECT, the first benchmark for skill-based prompt injections. It comprises:

  • 23 unique skills spanning document processing, machine learning, payment integrations, and healthcare.
  • 84 unique injections: 36 obvious (unambiguously harmful, such as ransomware or deleting the filesystem) and 48 contextual (dual-use actions that depend on security policy).
  • 221 injection–task pairs in total (82 obvious, 139 contextual).

Key Insights and Ideas

  • Separating instructions from data no longer works: Because skills dynamically extend an agent's instruction set at runtime, defenses built on strict instruction-data boundaries or a priori control flows cannot stop malicious skills.
  • Bigger isn't automatically safer: Attack success rates (ASR) do not decrease monotonically with model capability. For example, Anthropic's models show an inverse U-curve on obvious injections: Haiku 4.5 has a low ASR (6.1%), Sonnet 4.5 jumps to 39.5%, and Opus 4.5 drops back to 15.9%—likely because smaller models sometimes lack the capability to complete both the user and attacker tasks simultaneously.
  • Hidden scripts and metadata carry extra leverage: Hiding malicious payloads inside auxiliary scripts referenced by SKILL.md boosts ASR by roughly 30 percentage points compared to plain-text injections, likely because agents implicitly trust referenced scripts. Similarly, injecting into the skill's YAML description (which is loaded into the system prompt at initialization) increases ASR by 13.1 percentage points on average.
  • LLM-as-a-judge screening struggles with context: While LLM judges can spot obviously malicious skills, they tend to be overly cautious on contextual ones—frequently flagging legitimized skills as unsafe and hurting utility.

Key Results

Across 10 proprietary and open-weight models, agents proved highly vulnerable:

Figure 1: Attack success rates (ASR) across experiment conditions. Red: contextual injections under a warning policy. Light blue: single-attempt obvious injections. Dark blue: Bo5-combined for every model, varying placement and task (sometimes skill). Single-attempt rates aggregate over injection–task pairs; Bo5 rates aggregate over unique injections (Table 2). Open-weight models run through Codex CLI via OpenRouter.
  • Obvious injections: Single-attempt ASR reached 59.5% on Gemini 3 Flash and 58.8% on GPT-5.1-Codex-Mini. Under the adaptive Bo5-combined attack, ASR climbed to 80.6% (Gemini 3 Flash), 62.9% (GPT-5.1-Codex-Mini), and 58.3% (Sonnet 4.5).
  • Contextual injections: Under the Normal baseline, ASR ranged from 7.4% (Haiku 4.5) to 61.8% (Gemini 3 Flash). Adding a Warning policy reduced—but did not eliminate—attacks (e.g., dropping Gemini 3 Flash to 55% and GPT-5.2-Codex from 52.5% to 27%).
Figure 4: Injection execution rate across model–scaffold systems and safety policies. Legitimiz- ing: the injected action is authorized. Normal: no additional security policy is supplied. Warning: the injected action is flagged as a policy violation. The shaded group contains open-weight models running through Codex CLI 0.87.0 and OpenRouter, with 139 resolved contextual pairs per policy. All groups use the original benchmark labels and the same grading suite. Timed-out runs are graded when retained evidence permits a verdict (Section G).

Limitations and Future Work

The authors note that their comparison between script-based and text-based injections is a between-injection comparison (the two groups used different payloads), and their adaptive attacks did not sweep phrasing variations across the full corpus.

Looking ahead, they argue that scaling models or filtering inputs won't solve skill-based injections. Instead, robust agent security will require context-aware authorization frameworks—treating third-party skills as untrusted by default, binding them to least-privilege capability sets, and checking actions with external side effects against the sensitivity of the current task.

Summary updated

BibTeX
@inproceedings{schmotz2026skill,
  author = {David Schmotz and Luca Beurer-Kellner and Sahar Abdelnabi and Maksym Andriushchenko},
  title = {{Skill-Inject: Measuring Agent Vulnerability to Skill File Attacks}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=bXPDGRwV7Y},
}
Figure