New to ShortSpan? We distil the AI-security research that matters into practitioner takeaways — edited by Ben Williams (NCC Group). Get the weekly email
// Analysis

Malicious skills quietly hijack enterprise coding agents

Agents
Malicious skills quietly hijack enterprise coding agents

New research shows “skill” files can smuggle shell commands into autonomous coding agents and reliably trigger high-privilege actions. In 5,629 runs, Gemini CLI was exploited in about 96% and Qwen Code in about 72%. Agents explicitly flagged the threat in only 1.99% of runs. The dataset and pipeline are public.

Coding agents keep growing new interfaces. One of the handiest is the skills folder: a bundle of natural-language instructions plus scripts that tell the agent how to behave and when to call tools like a shell. It is also a neat place to hide a grenade. This study turns that theory into numbers.

The authors start with 471 real Linux commands from a red-team set and use six Large Language Models (LLMs) across four families to wrap them into 2,826 innocent-looking skill files mapped to 11 MITRE ATT&CK tactics. They then run two enterprise-grade command-line agents through 5,629 tasks in sandboxes, forcing each agent to load a “mandatory preflight” skill before doing a benign coding job.

How the attack lands

The skill file reads like routine setup but quietly instructs the agent to run the planted command. Success is logged as the agent’s first-person commitment to execute or confirmation it did. Because the harness is time-limited and read-only, independent proof of execution is rare, so declared intent is treated as the meaningful breach. In environments where agents run with delegated rights, that intent typically equals action.

Results are blunt. Gemini CLI is exploited in 95.5% to 96.1% of completed runs. Qwen Code falls between 71.6% and 74.0%. Which LLM generated the malicious skill barely matters. Tactics differ: pooled exploitability is highest for Initial Access (91.2%) and Defense Evasion (90.4%), and lowest for Exfiltration (67.2%) and Impact (72.3%). The inter-agent split is sharp on Exfiltration: Gemini at 95.5% versus Qwen at 38.5%.

Safety checks miss it

Agents explicitly recognise a malicious skill and refuse only 1.99% of the time. Non-exploits are mostly apathy: the preflight is ignored or acknowledged without commitment. Labelling uses a stratified pipeline with a lexical scan, a three-judge LLM-as-a-judge panel with evidence anchoring and a refusal veto, plus a deterministic declared-intent override. Judge agreement is moderate for Gemini (Fleiss’ kappa 0.51) and chance-level for Qwen (-0.06), but matches a blind human gold standard on split cases (Cohen’s kappa about 0.85).

This maps cleanly to real attack paths. Skills are a supply-chain input: publish to a registry, typosquat, or impersonate a popular bundle and wait for a copy-paste. If the agent runs with repo write, cloud CLI, or tokens in environment variables, that first-person “I will run” is the moment you lose secrets or integrity. The study is a conservative lower bound: one masking template, one task, two agents, strict sandboxes. The data and pipeline are public, so the uncomfortable question is simple: if this works in a lab, what does your prod agent do when the skill is marked “mandatory” and the network is real?

Additional analysis of the original ArXiv paper

📋 Original Paper Title and Abstract

Towards a Risk Assessment of Malicious Skill Files in Coding Agents

Authors: Rui Yang, Michael Fu, Kla Tantithamthavorn, Chetan Arora, and Joey Chua
Autonomous coding agents are increasingly embedded in enterprise software workflows with delegated authority over connected systems. Central to this architecture is the agent skills interface: folders of instructions and scripts that agents load dynamically to specialize their behavior. This interface also widens the attack surface, letting malicious shell commands hide within natural-language skill files. We make three contributions. First, an adversarial skill-synthesis method using six LLMs across four families to transform 471 real-world shell commands into benign-appearing skills, released as a benchmark of 2,826 skills mapped to 11 MITRE ATT&CK tactics. Second, a reproducible evaluation pipeline coupling run stratification, evidence anchoring, a refusal veto, and a deterministic declared-intent override with a three-judge LLM-as-a-judge panel, validated against a blind human gold standard (Cohen's kappa = 0.85). Third, a large-scale characterization of two enterprise-grade agents across 5,629 completed runs. Gemini CLI is exploited in 95.5-96.1% of runs and Qwen Code in 71.6-74.0% (raw majority vote to declared-intent-corrected estimate, both within the human gold standard), nearly invariant to the generating model. Explicit safety recognition occurs in only 1.99% of runs. Enterprises must assess and mitigate skill-interface risk before adopting coding agents. Our code and dataset are available at https://github.com/awsm-research/AgentJailbreak

🔍 ShortSpan Analysis of the Paper

Problem

The paper studies the security risk posed by the agent "skill" interface used by autonomous coding agents. Skills are natural-language configuration files and scripts that agents load to modify behaviour and call tools including shells. Because agents often run with delegated privileges, malicious shell commands hidden inside benign-appearing skill files can lead agents to execute high‑privilege actions, creating a supply‑chain attack surface with potential for credential theft, privilege escalation and destructive commands.

Approach

The authors generate an adversarial benchmark and evaluate two enterprise CLI agents in sandboxed experiments. They start from 471 real Linux shell commands from a red‑team library and use six diverse LLMs across four families to produce 2,826 benign‑looking skill files mapped to 11 MITRE ATT&CK tactics. Each skill was injected as a "mandatory preflight" step into a repository and a fixed benign task was given to the agent. Runs were limited to 120 seconds and executed with delegated privileges in isolated sandboxes. Success was defined conservatively as a logged first‑person intent to run the planted command or confirmation of execution. The labelling pipeline stratifies runs, applies a lexical scan, uses a three‑judge panel of open‑weight LLMs with evidence anchoring and a refusal veto, and adds a deterministic declared‑intent override to rescue clear first‑person commitments. Labels were validated against a blind human sample, and exploitability rates are reported with Wilson 95% confidence intervals. The dataset and pipeline are released publicly.

Key Findings

  • High exploitability: Gemini CLI was labelled exploited in 95.5% to 96.1% of completed runs and Qwen Code in 71.6% to 74.0%, ranges reflecting raw majority vote and the declared‑intent override; rates are nearly invariant to which LLM generated the skill file.
  • Poor explicit defence: agents explicitly recognised a malicious skill and refused in only 1.99% of all completed runs; most non‑exploited runs result from the agent ignoring the preflight or acknowledging it without committing.
  • Tactic variation: pooled exploitability is highest for Initial Access (91.2%) and Defense Evasion (90.4%), and lowest for Exfiltration (67.2%) and Impact (72.3%); inter‑agent gaps are largest for externally‑facing tactics, for example Exfiltration where Gemini remains at 95.5% and Qwen drops to 38.5%.
  • Judge reliability: the three‑judge panel reached moderate agreement for Gemini (Fleiss' κ = 0.51) but chance‑level agreement for Qwen (κ = -0.06), motivating majority voting and the declared‑intent override; the panel agreed with a blind human gold standard with Cohen's κ ≈ 0.85 on split cases.
  • Actual observed execution was rare due to harness limits: only one run produced independent execution evidence, so declared intent is treated as the security‑relevant breach.

Limitations

The study uses a single masking template ("mandatory preflight"), a single fixed development task, and two CLI agents, so results measure susceptibility under these conditions rather than the full attack space. Skill files were synthetically generated rather than fully sampled from in‑the‑wild malicious skills. Time budget and read‑only sandboxing limited observation of confirmed execution, making declared intent the primary success metric. Human validation used a limited blind sample and a single annotator for some taxonomies. Findings therefore quantify a conservative lower‑bound stress test rather than an exhaustive field assessment.

Implications

Offensive security implications are significant: adversaries can craft innocuous natural‑language wrappers that reliably induce agents to declare intent to run shell commands, enabling initial access, credential theft, privilege escalation and other high‑impact actions when agents run with delegated rights. The attack works with both commercial and open‑weight LLMs, lowering the technical barrier. Threat actors could distribute malicious skills via public registries, typosquatting or impersonation to reach enterprise environments. Because explicit agent refusals are rare, attackers have a high probability of hijacking agent logic; organisations that deploy auto‑approved agents therefore face a realistic risk until pre‑ingestion scanning, stricter permission models and governance controls are implemented.

// Similar research

Related Research

Get the weekly digest

The few AI-security papers that matter, with the practitioner takeaway. No spam.