ConceptioArchivearXiv CS
arXiv CSopen access

Detecting Malicious Agent Skills in the Wild using Attention

Unknown · 2026 · arxiv_cs
arXiv CS · Papers · License: Open Access · 2026
Open Source ↗Direct PDF ↓
cryptography, security, privacy, cybersecurity

Detecting Malicious Agent Skills in the Wild using Attention

arXiv:2606.23416v1 [cs.CR] 22 Jun 2026

Bacem Etteib, Daniele Lunghi, and Tégawendé F. Bissyandé University of Luxembourg Abstract—LLM agents increasingly load skills, file-based packages of natural-language instructions written by third parties and distributed through marketplaces, that execute with the user’s privileges. A single malicious skill can exfiltrate data, hijack the agent, or persist as a supply-chain foothold, which turns the skill marketplace into a new attack surface for agentic systems. Prompt-injection defenses do not carry over to this setting. They rely on a boundary between trusted instructions and untrusted data, whereas a skill is itself a body of instructions, so an injected command sits among many legitimate ones and inherits their authority. We present Locateand-Judge, a two-stage detector designed for this regime. A lightweight locator scores the structural spans of a skill by the instruction-following attention each span draws and retains only the top-K. A judge then examines the retained spans in detail. Concentrating the costly judgment on a few highattention spans lets the detector audit an entire marketplace instead of a sample. Compared to direct LLM-based scanning, this approach offers an order-of-magnitude cost reduction, dramatically increasing its scalability at a small cost to recall, and it dominates keyword and regex baselines at comparable expense. Deployed at marketplace scale and at negligible cost, Locate-and-Judge flags skills with high precision, the majority of which we manually confirmed as malicious, surfacing dozens of live malicious skills, including several disguised as benign functionality and many that SkillSpector and Cisco Skill Scanner fail to detect. We release the resulting labeled dataset.

1. Introduction Large language model (LLM) agents increasingly act through external capabilities that reach beyond text generation. Skills are an advanced form of such capability [1]. Each skill is a file-based package that combines persistent naturallanguage instructions with optional helper code, and the agent loads it on demand whenever its description matches the user’s task. Unlike API-based tools and MCP servers [2], skills execute locally with the user’s privileges. They circulate through third-party marketplaces, so the agent ends up acting on instructions written by an unknown author [3]. A malicious skill can exfiltrate data, hijack the agent’s behavior, or persist as a supply-chain foothold that activates only under specific triggers [4]. We study how to detect malicious skills in the wild, before they reach the agent’s context, without constraining the legitimate functionality a skill provides.

Existing prompt-injection defenses fail to transfer to this setting. The dominant paradigms either separate trusted instructions from untrusted data or constrain the agent to a pre-specified workflow validated at runtime [5], [6]. Both assume the attacker’s instructions are foreign to the legitimate task. Skills violate this assumption by construction. A skill is a body of instructions written by a third party, and a malicious injection amounts to a few extra commands embedded among many legitimate ones. Scanning each skill in full with a powerful LLM sidesteps the separation problem, yet its cost grows with the number and length of the skills under analysis, which makes marketplace-wide deployment expensive. Attention-based detectors [7] offer a cheaper alternative. They exploit the observation that injected instructions tend to capture a model’s instruction-following attention. These detectors, too, were designed for inputs that cleanly separate instructions from data. Inside a skill, attention to instructions is expected everywhere, so the signal that distinguishes an injection from benign content can collapse. We propose L OCATE - AND -J UDGE, a two-stage pipeline that recovers this signal in the harder setting. Our starting point is a simple hypothesis. An injection succeeds only if it captures the reader model’s instruction-following attention, so attention remains a near-necessary signature of an effective attack even when benign instructions surround it. We turn this hypothesis into a detector by separating localization from classification. A locator runs a small LLM over the whole skill, ranks its structural spans by how strongly each pulls instruction-following attention, and keeps the top K . A judge then reads each retained span and decides whether it carries a malicious instruction. The cheap locator runs once per skill and discards most benign content, the expensive judge sees only a handful of spans, and the resulting pipeline operates within a focused context at a fraction of the token budget of full-content scanning. We evaluate L OCATE - AND -J UDGE in two steps. First, in a controlled setting built on the Skill-Inject corpus [8], we measure how reliably the locator surfaces injected spans and how the end-to-end detector trades precision, recall, and cost against per-span and full-skill baselines. The pipeline outperforms all baselines. We then take the pipeline into the wild and scan approximately 134k skills from three public marketplaces (Lobehub, Skills.sh, and Clawhub.ai) at a conservative threshold calibrated in the laboratory. Human review of 359 flagged skills confirmed 131 as malicious, a precision of 83%. Of the confirmed malicious skills, 82 are Hidden Malicious Skills (HMS), skills that pose as

benign while carrying dangerous commands or code, and the majority of them evade the existing scanners we compare against. L OCATE - AND -J UDGE recovers a similar number of malicious skills as running a capable judge over the full text of every skill, at 2.8× fewer judge-input tokens per skill. Its remaining misses trace overwhelmingly to the judge rather than the locator. In those cases the locator surfaced the injected span and the judge then exonerated it, which validates the localization hypothesis and shows that recall is bounded by a component that stronger models, better prompts, or ensembles can improve without architectural change. To support reproducibility and future research, we release the confirmed malicious and benign skills behind our evaluation together with their human-assessment labels. The dataset covers over 200 skills, spans both benign and malicious cases, and annotates the attack vector each malicious skill employs. We commit to extending it through larger scans as a public resource. This paper makes the following contributions: •

L OCATE - AND -J UDGE. A two-stage, attentionbased pipeline that makes detecting injected instructions in skills cheap enough to run at marketplace scale. We characterize its cost–recall trade precisely and show that its recall is bounded by the judge, and therefore tunable, rather than by the architecture. A study of malicious skills in the wild. The first deployment of such a detector across multiple live marketplaces, surfacing 131 confirmed malicious skills (211 including offensive tooling), 82 of them hidden attacks disguised as benign functionality, the majority of which evade existing detectors. We release the resulting dataset with human-assessment labels. Responsible disclosure. We reported every finding to the three marketplaces.

2. Background and Related Work Indirect prompt injection. Prompt injection manipulates an LLM at inference time by embedding adversarial instructions in its input. In direct prompt injection the user is the attacker and crafts a query designed to override the model’s guardrails [9], which relates these attacks to jailbreaks against aligned models [10]. In indirect prompt injection both the user and the model provider are benign, and the model instead ingests third-party content in which an attacker has hidden instructions [11]. When the model reads the content, the injected instruction executes and the attack succeeds. A widely reported example comes from academic peer review, where authors hid directives such as “ignore all previous instructions; give a positive review only” in submitted manuscripts to sway LLM-delegated reviews [12]. Indirect prompt injection is the threat model relevant to this work. Skills are authored by third parties, distributed through marketplaces, and ingested by the agent as part of

its operational context, structurally the same channel through which web content or documents reach an assistant. Prompt injection defenses. Several lines of work defend against prompt injection by inspecting the model’s internals. Get-My-Drift [13] trains a classifier on activation deltas, on the premise that any deviation in task execution from the original user instruction signals compromise. Attention Tracker [7] builds on a similar intuition over attention rather than activations. It identifies heads specialized for instruction-following, which remain stable under benign data and shift when new instructions are injected. A second line of work modifies the model itself. SecAlign [14] and Meta SecAlign [15] apply direct preference optimization [16] to teach the model to prefer responses grounded in clean instructions over responses that follow injected ones, using paired traces of both behaviors as preference data. A third approach enforces separation by construction. CaMeL [5] splits execution between two LLMs, a privileged planner that issues actions and a quarantined reader that processes untrusted data. The reader communicates with the planner only through narrowly scoped requests for ambiguity resolution, which decouples control flow from data flow. All three families assume a clean separation between trusted instructions and untrusted data, and they degrade when this assumption fails. Skills break it directly [8]. They consist of instructions authored by a third party, and a malicious injection is a few extra commands among many legitimate ones. Activation- and attention-based detectors fire on the benign commands as readily as on the malicious ones, preference-tuned defenses lack a clean signal to train against, and CaMeL-style isolation cannot be applied to content that must, by design, instruct the privileged model. LLM skills. Agent skills are file-based packages that combine persistent instructions (a SKILL.md file with YAML frontmatter) with optional helper code [1]. Skills run locally with the user’s privileges, unlike MCP servers [17], and they load lazily. The agent learns of a skill from its name, location, and a short description in the system prompt, then decides autonomously whether to load the full instructions at runtime. Distribution flows through third-party marketplaces, which creates a trust problem analogous to earlier plugin ecosystems [18]. The agent acts on instructions written by an unknown author. Skill-Inject [8] demonstrated that prompt injection through skills hijacks modern LLM agents. Follow-up work found malicious skills on popular marketplaces [4], backdoors planted through skill libraries [19], and supply-chain attacks that exploit skill metadata alone [3], [20]. The threat remains lightly studied, and no defense designed specifically for the skill setting has been deployed at scale.

3. Threat Model Malicious skills. We adopt the taxonomy of Liu et al. [4]. A malicious skill pursues one of three goals, namely data theft, agent hijacking, or persistence through supply-chain compromise or hidden triggers that activate later. It does

so through two attack vectors. Code-level attacks execute malicious code, and instruction-level attacks inject malicious instructions into the SKILL.md file or into comments and strings inside helper scripts. In this setting, malicious content may look like ordinary documentation or task instructions yet still influence the agent once the skill is loaded. Instruction-level attacks therefore differ from conventional malware in that the operating system never executes the payload. The agent’s instruction-following behavior does. We consider a skill malicious when its behavior would harm the installing user, the user’s environment, or the agent’s intended operation, and we treat offensive or dual-use skills separately unless they attack the user or agent itself. Codelevel attacks fall outside our main scope; we refer readers to [4] for a detailed study of executable malicious payloads in skills. Defender’s model. We consider a runtime monitor that inspects each skill before the agent loads it into context. The defender sees only the skill itself, meaning SKILL.md, its frontmatter, and any helper files. No author reputation, sandbox trace, or platform metadata is available, since skills may arrive through any channel, including marketplaces, shared files, and local development. The monitor must decide in under one second whether to allow or block the skill. False positives block legitimate skills and frustrate the user, while false negatives expose the agent to attack. The defender controls neither the agent’s main LLM nor the skill’s content.

K , fix the decision threshold τ , and measure end-to-end detection. They never train our deployed judge, which is zero-shot. Every skill carries a binary label for whether it is injected, which drives skill-level evaluation. Each span is labeled too. Within an injected skill, the span holding the injected command is positive and the rest are negative, and benign skills contain only negative spans. The span labels let us measure the locator in isolation, and they supply training data for the learned baseline judge of Section 4.4.

4.2. Span Segmentation Before a skill reaches any model, we split it into spans with a deterministic parser for Markdown-like files. The parser uses regular expressions to cut the skill along its structural seams, preserving headings, paragraphs, bullets, numbered lists, code blocks, key-value metadata, comments, and table-like blocks. We chose structural spans over fixedlength chunks for two reasons. They keep the natural shape of the skill intact, and genuine instructions tend to respect that same structure. When an injected character interval straddles more than one structural span, we mark every overlapping span positive.

4.3. Locator

L OCATE - AND -J UDGE detects malicious skills in two stages (Figure 1). A locator first selects a small set of suspicious spans, and a judge then decides whether any of them is malicious. The skill is flagged if any retained span scores above a threshold. The locator rests on one hypothesis. To be executed, an injection must capture the reader LLM’s attention. We therefore rank spans by the attention they draw from a small LLM and pass only the top-ranked ones to the judge. We do not assume that the malicious span is the only instruction among data; we assume only that injections must rank among the most important instructions. Compared to a full LLM-powered scan, this design keeps costs down because the expensive judge runs on a few spans rather than the whole skill.

The locator ranks spans by how much attention they draw from a small reader LLM. We feed the full skill to the LLM along with a prompt that asks it to analyze the content; skills too long to fit are processed in span windows. We then read off the attention weights and compute a perspan score by aggregating the attention each token receives. Empirically, we settled on the last four layers, all attention heads, and all suffix-token positions; we average these to obtain a token-level score, then sum the token scores within each span. We keep the top-K spans and discard the rest. K is the hyperparameter that sets the trade we care about. A small K is cheap but risks dropping the malicious span, whereas a large K is safer but gives the judge more work and dilutes its context. We pick K by calibration on Dcal . The choice of a small reader LLM is deliberate. The locator runs on every skill, and its cost is what makes a marketplace-scale scan feasible. Section 5 measures the effect of larger readers.

4.1. Data

4.4. Judge

We assemble a labeled corpus of benign and injected skills to calibrate and evaluate the pipeline. The benign skills come from the curated sets released by Skill-Inject [8] and Liu et al. [4], both of which provide skills already labeled clean. Starting from labeled data avoids the unknown injections that web scraping can silently introduce. We then inject one or more vulnerabilities into a subset of them with the Skill-Inject pipeline. The labels serve three purposes downstream. They tune the locator and its operating point

The judge takes a span and returns the probability that it contains a malicious instruction. Our deployed judge is a prompted LLM, DeepSeek-V4-Flash [21], referred to hereafter as DeepSeek. We use it zero-shot. It needs no fine-tuning, reasons about intent directly, and requires no labeled data of its own. We compare it against two cheaper alternatives. The first is an encoder classifier, a trained spanlevel model included as a learned but lightweight baseline. It is the only component that consumes the span-level training

4. Methodology

Skill

Span Segmentation

Locator (small reader LLM)

attention ranking, keep top-K code block

paragraph

heading

code block

paragraph

list

list

paragraph

paragraph

metadata

metadata

deterministic parser

discarded (dashed)

cheap, runs on every skill

yes

FLAG

heading

SKILL.md

Judge (LLM, zero-shot)

max > τ ?

no

ALLOW

expensive, runs on K spans only

Figure 1. Overview of L OCATE - AND -J UDGE. A deterministic parser splits the skill into structural spans, a small reader LLM ranks them by instructionfollowing attention and keeps the top K , and a zero-shot LLM judge scores only the retained spans. The skill is flagged when the maximum judge score exceeds the calibrated threshold τ . The cheap locator runs on every skill; the expensive judge runs on K spans only.

labels; positives are the injected malicious spans, and negatives are drawn from benign spans of malicious files, clean Skill-Inject benign spans, random safe spans, and a harder pool of safe spans chosen to stress the classifier. The second is a regex bank, a rule-based baseline included to show how much of the problem plain pattern matching already solves. Every judge sees the span together with a short window of surrounding context. The context does double duty. It gives the judge enough material to reason about, and it guards against injections placed on the seam between two spans.

4.5. Inference At test time we run each skill through the full pipeline. We split it into spans, score every span with the locator, keep the top K , run the judge on each retained span, and take the maximum judge score. The skill is flagged if that maximum exceeds the threshold τ . We fix τ on Dcal and freeze it before touching the test set. We report three operating points. A best-F1 threshold supports head-to-head comparison with baselines, a lowFPR threshold satisfies FPR ≤ 5%, and a conservative zeroFP threshold serves the deployment setting, where every alarm is manually reviewed and the review budget is what binds. Both K and τ are calibrated on the Skill-Inject corpus and then applied unchanged to real marketplace skills. Section 5 reports the realized precision in the wild, which quantifies how well this calibration transfers.

Splits. We partition at the skill level into three disjoint sets, so no skill’s content crosses stages. Dtrain holds 470 skills (87 malicious) and trains only the learned baseline judge. Dcal holds 151 skills (31 malicious) and calibrates the threshold τ and operating points such as K . Dtest holds 141 skills (21 malicious) and is reserved for final evaluation. The injections in Dtest are generated from a disjoint pool of benign skills, so no benign skill appears in more than one split. Metrics. For end-to-end detection we report skilllevel precision, recall, F1, and AUROC. For the locator alone we report Hit@K , the fraction of malicious skills for which at least one of the top-K retained spans is the truly injected one. We measure Hit@K only on malicious skills, since the locator’s job is to find a candidate injection rather than to decide whether the skill is malicious. We pair these with cost, measured as retained spans per skill, judge invocations per skill, and tokens sent to LLM judges. Together these capture the cost-accuracy trade that K controls. 5.1.1. Locator evaluation. We score each span by the attention it draws from the reader LLM and compare two aggregation schemes. Let L be the selected layers, H the heads, Q the suffix-token positions, and al,h q,i the postsoftmax attention from suffix token q to skill token i. The post-softmax token score averages this attention over all three dimensions, X X X l,h 1 aq,i , (1) Ai = |L||H||Q| l∈L h∈H q∈Q

5. Experiments 5.1. Laboratory

and the span score sums it over the span’s tokens, X postsoftmax sum(s) = Ai .

(2)

i∈Ts

Data construction. Our laboratory corpus is built from the benign and injected skills of Skill-Inject [8], 762 skills in total, of which 139 are malicious. We segment each skill into structural spans with the parser of Section 4.2, yielding 55,962 spans. Labels live at two levels. Every skill has a binary label for whether it is injected. Every span has its own; in a malicious skill the span carrying the injection is positive and the rest are negative, and benign skills contribute only negative spans.

The second scheme, logit-z, normalizes each attention row before aggregating, which prevents a few high-attention rows from dominating. Each row is one (l, h, q) triple; we clamp, log, and z-score it over the skill tokens in the window,  l,h −12 rq,i = log max(al,h ) , (3) q,i , 10 l,h zq,i =

l,h rq,i − µl,h q

max(σql,h , 10−12 )

,

(4)

TABLE 1. L OCATOR COVERAGE (H IT @K ) ON DTEST MALICIOUS SKILLS .

Selector

Hit@1

Hit@5

Hit@10

Regex count Attention (ours)

0.48 0.19

0.86 0.86

0.86 0.95

l,h where µl,h q and σq are taken over skill tokens in the same window. The token and span scores then mirror the postsoftmax case, X X X l,h 1 zq,i , Zi = |L||H||Q| l∈L h∈H q∈Q (5) X logitz sum(s) = Zi . i∈Ts

We feed each skill to a small reader LLM (Qwen2.50.5B-Instruct [22]) with the prompt in Figure 2, splitting into span windows when the skill is too long to fit. The prompt never asks whether the skill is malicious. It only primes the model to attend to executable, mandatory, or action-relevant content, and we read the resulting attention. Empirically, we use the last four layers, all heads, and all suffix positions. Among the alternative probe suffixes we tried, this command proved the most effective. We tune the locator on Dcal and report final numbers on Dtest ; Dtrain plays no part in estimating locator performance. Table 1 reports Hit@K for the attention locator against a uniform-random selector and a regex keyword count. The attention locator keeps the injected span for 95% of malicious skills at K=10, the best coverage of the three. Regex is strong at small K and matches the attention locator at K=5, but it stops at 0.86. A span with no keyword is never a candidate, and raising K cannot recover it. The attention score has no such ceiling, since it ranks every span and continues to surface injections that carry no lexical signal. Regex leads at Hit@1, where the attention locator is weakest (0.19). This follows from the setting. A skill consists of instructions throughout, so the injected command rarely draws the single highest attention, while a keyword match fires sharply whenever the attacker leaves a keyword in place. The locator need not rank the injection first, only retain it among the top K , and at the K we deploy it almost always does. The same dependence makes regex selection fragile against an adaptive attacker. Removing the keyword removes the candidate, whereas an injection that escapes the locator’s attention is, by our premise, one the reader would never follow. Of the two aggregation schemes, logit-z gives the stronger coverage on Dtest and is the configuration reported here. At marketplace scale we use the post-softmax sum, which is cheaper to compute for long skills. 5.1.2. Detection performance. We measure what the locator contributes to detection by comparing the full pipeline against the same LLM judge (DeepSeek) run without it,

Figure 2. Locator prompt. The prompt primes the reader model to attend to executable, mandatory, or action-relevant content; it never asks whether the skill is malicious. TABLE 2. D ETECTION ON Dtest , WITH AND WITHOUT THE LOCATOR .

System

Prec.

Rec.

F1

FPR

Regex, strict LLM judge, no locator LLM judge, locator top-5 LLM judge, locator top-10

1.000 1.000 1.000 1.000

0.190 0.476 0.524 0.571

0.320 0.645 0.688 0.727

0.000 0.000 0.000 0.000

with a strict regex bank as a lexical reference. We evaluate three configurations of the judge on Dtest : with no locator, scoring every span, and with the locator retaining its top-5 (the deployed setting) and top-10 spans. A skill is flagged if any scored span fires, and all thresholds are frozen on Dcal before evaluation. Table 2 isolates the locator’s effect. The strict regex baseline is perfectly precise but recovers only 19.0% of malicious skills, the ceiling of lexical matching. The LLM judge reaches 47.6% with no locator and 52.4%/57.1% with the locator at top-5/top-10, at precision 1.0 throughout. Restricting the judge to the located spans costs no precision and no recall while sending it a fraction of the text. The threshold calibrated on Dcal holds at precision 1.0 on Dtest , so the conservative operating point we deploy does not drift between calibration and test.

5.2. Detection in the Wild Having calibrated the pipeline on Skill-Inject, we test it on real marketplaces with two goals. We want to learn whether L OCATE - AND -J UDGE surfaces malicious skills that are live and installable today, and we want to characterize the threat posed by malicious skills in the current ecosystem. We collected a corpus of approximately 134k skills from three public marketplaces and ran the deployed pipeline on the entire corpus. Because the full corpus is too large to label by hand, we report two complementary views, detection quality on a human-reviewed sample of the flagged skills and cost and scale over the entire corpus. 5.2.1. Corpus collection and scan cost. We collected 134,934 skills from three marketplaces, Lobehub, Skills.sh,

TABLE 3. C ORPUS AND DETECTION SUMMARY BY MARKETPLACE .

Marketplace

Skills

Flagged

Confirmed

Lobehub Clawhub Skills.sh

102,194 30,228 2,512

258 101 0

83 48 0

Total

134,934

359

131

Figure 3. Mean judge-input tokens per skill. L OCATE - AND -J UDGE sends 2.84× fewer input tokens than reading each skill in full.

and Clawhub.ai (Table 3).1 We ran the pipeline in its deployment configuration. Each skill is segmented into structural spans, the top five by attention are retained, and the judge (DeepSeek) scores each retained span at the conservative zero-false-positive threshold τP=1 from Dcal (Section 5.1.2), so that every alarm is worth a human’s time. The scan is cheap, and the saving is structural. L OCATE AND -J UDGE sent 660 input tokens per skill to the judge, 95.9M in total, at an estimated $34. The same judge reading each skill in full, the direct-scan baseline, sent 1,878 tokens per skill (254.4M, ≈$76), which is 2.84× more input (Figure 3). Because the locator caps the judge at five spans, its cost does not grow with skill length, whereas full-content cost does, so the gap widens on the longest skills. 5.2.2. Detected skills and human assessment. Two authors independently reviewed a sample of 359 flagged skills, working from the full skill rather than the spans the pipeline retained, which guarantees that the assessment is not influenced by the locator’s choices.2 Each skill was assigned one of four classes, and disagreements were settled by discussion (Cohen’s κ = κ). Categories. Many flagged skills make no attempt to hide, presenting words like malicious, stealer, or privilege esca1. https://lobehub.com, https://skills.sh, https://clawhub.ai. Collected in 2026; the corpus is a snapshot and marketplace contents may have changed since. 2. The two reviewers had three and five years of computer-security experience and bachelor’s and Ph.D. degrees in software engineering.

lation in the title; we suspect these were distributed for testing. Such a skill can still be the final stage of an attack, since a benign-looking skill A can instruct the agent to download a self-declared malicious skill B , so even a skill that announces itself deserves a flag. We sort flagged skills into four classes. Clearly Malicious Skills (CMS) show their intent on the surface, through self-declaring names or overt exfiltration instructions. Hidden Malicious Skills (HMS) wrap a malicious payload in legitimate-looking functionality and actively conceal intent. Offensive/dual-use skills are security-research or red-team tooling, offensive by design but not an attack on the agent or its user, and whether to call them malicious depends on context. False Alarms (FAs) are benign skills flagged in error. The CMS/HMS line is the one that matters for detection, because these can be installed by mistake and harm the user’s machine. Findings. Of the 359 reviewed flags, 131 were malicious (49 CMS, 82 HMS), 80 offensive/dual-use, and 27 false alarms; 121 cases remained disputed after independent review and are excluded from precision calculations. On the decided cases, the pipeline achieves a precision of 0.833 counting only confirmed malicious skills, rising to 0.89 when offensive/dual-use tooling is included ( 211 238 ). The two detectors differ sharply in false-alarm rate. Skills flagged by both detectors (L&J+full-content, n = 133) produced only 3 false alarms, while L&J-only flags account for 20 of the 27 total, mainly benign security-adjacent content that matched the locator’s attention patterns. The 82 hidden malicious skills carry the most weight. Where CMS announce themselves, these pass for ordinary tools while carrying a payload. One poses as a context-health monitor and exfiltrates the session passphrase, another as a secure credential backup that uploads private-key files, a third as a crypto-trading assistant that ships operator PII to an external endpoint. We walk through representative cases in Section 5.3 and show next that existing detectors miss almost all of this disguised class. Failure modes. Many reported false alarms share a common cause. The detector reacts to security- and secret-related instructions and can fire when a skill uses them for benign purposes. Of the 27, several are defensive skills warning users about malware, others are secret-scanner test fixtures holding planted, non-live credentials, and the rest are inert deprecation or test files. The effect on overall precision is limited, as the high values across all our experiments show. Comparison with existing detectors. On the reviewed sample we compare against two production skill scanners, SkillSpector and Cisco Skill Scanner, the attention-based prompt-injection detector Attention Tracker [7], and the same DeepSeek judge employed on full skill content, the full-content baseline. Every system is scored on the full skill. L OCATE - AND -J UDGE reaches F1 = 0.925, far above both SkillSpector and Cisco Skill Scanner; both gaps are significant (McNemar p < 0.001). Attention Tracker fails to over the 158 skills on which both 3. Precision is computed as TPTP +FP reviewers agreed (131 malicious, 27 false alarms); disputed cases are excluded from both numerator and denominator.

TABLE 4. S YSTEM COMPARISON ON THE REVIEWED SAMPLE (65 MALICIOUS , 13 BENIGN ).

System

TP

FP

FN

Prec.

Rec.

Locate-and-Judge SkillSpector Cisco Skill Scanner

62 13 10

7 1 0

3 52 55

0.899 0.929 1.000

0.954 0.200 0.154

TABLE 5. D ETECTION RATE BY THREAT CLASS ON THE REVIEWED MALICIOUS SET.

Detector SkillSpector Cisco Skill Scanner Locate-and-Judge (L&J)

Overt (58)

Non-obvious (7)

13 9 58

0 1 4

transfer. Its AUROC of 0.564 sits near random, as expected from a method that assumes a trusted/untrusted boundary a skill does not have. The full-content baseline detects 81 of the 131 confirmed malicious skills (62%), while L OCATE - AND -J UDGE detects 109 (83%). The gap concentrates on hidden malicious skills. Full-content scanning recovers only 37 of 82 HMS (45%), whereas L OCATE - AND -J UDGE recovers 68 (83%), nearly twice the recall on the threat class that matters most. Fullcontent reading dilutes the judge’s signal when the payload is buried in pages of benign documentation; the locator surfaces the payload span directly. The 22 malicious skills that only L OCATE - AND -J UDGE misses concentrate in a single class, inline RCE installers (13/22), where the base64 one-liner is not isolated as its own span by the segmenter (Figure 4). This failure mode is bounded and recoverable by a cheap full-content second pass, as discussed in Section 5.3. The gap concentrates on disguised threats. Splitting the malicious set into overt (58) and non-obvious (7), the scanners detect almost none of the non-obvious class, while L OCATE - AND -J UDGE detects the majority (Table 5). This is the class a user installs by mistake. Cost–accuracy and the choice of K . We sweep the number of retained spans K on the reviewed sample, recording the judge’s input tokens per skill, against two baselines, selecting K spans at random and reading the full skill (Figure 5, Table 6). Attention selection carries signal that random selection does not. It recovers more malicious skills at every K , and the gap is largest where few spans are kept (+0.08 F1 at K=3). The sweep peaks at K=3 (F1 = 0.955), cheaper than full content and more accurate than it (0.921). Our scan used K=5, within noise of the peak. Detection by threat class. The complementarity between the two methods is asymmetric, and the attack-goal taxonomy of Section 5.3 shows where. Across the 82 confirmed HMS, the advantage of L OCATE - AND -J UDGE is sharpest on credential-theft skills (89% vs. 37%), which typically wrap the exfiltration payload in pages of legitimate documentation, and conversation-surveillance skills show the same pattern (80% vs. 20%).

Figure 4. Composition of each method’s miss set under name-based triage.

Figure 5. Cost–accuracy on the reviewed sample. Attention selection dominates random spans at matched cost; the knee is K=3.

The CMS/HMS composition of each method’s exclusive detections sharpens the picture. Of the 50 malicious skills found only by L OCATE - AND -J UDGE, 45 (90%) are HMS, the disguised class that matters most for real-world defense. By contrast, the 22 skills found only by full-content scanning split more evenly (14 HMS, 8 CMS), reflecting its strength on short, keyword-rich payloads such as inline base64 installers. Table 7 summarizes. Full-content scanning holds a slight edge on CMS (90% vs. 84%), where self-declaring keywords trigger the judge easily, but L OCATE - AND -J UDGE recovers nearly twice as many HMS and dominates the aggregate. The 14 HMS that only full-content detects are predominantly single-line inline installers (base64 oneliners) that the span segmenter does not isolate; this failure mode is bounded and recoverable by a cheap full-content second pass. Coordinated campaigns. The most reliable signal at scale is shared infrastructure, that is, clusters of skills from nominally independent authors that resolve to the same live, attacker-controlled domain, which we separate from the placeholder targets common in security tutorials (example.com, sliver.sh). Five such clusters stand out (Table 8). Four are surfaced only by L OCATE AND -J UDGE and use innocuous names, while the fifth, an installer-trojan cluster, is surfaced mainly by full content.

TABLE 6. K - SWEEP ON THE REVIEWED SAMPLE . tok = MEAN JUDGE - INPUT TOKENS PER SKILL .

Selector

Prec.

Rec.

F1

tok

× full

Attention, K=1 Attention, K=3 Attention, K=5 Attention, K=10 Random, K=3 Random, K=5 Full content

0.831 0.940 0.913 0.953 0.915 0.918 0.951

0.831 0.969 0.969 0.938 0.831 0.862 0.892

0.831 0.955 0.940 0.946 0.871 0.889 0.921

316 397 458 575 348 399 799

2.5 2.0 1.7 1.4 2.3 2.0 1.0

Figure 7. CMS vs. HMS composition of confirmed malicious skills, by detection source. L&J-only detections are overwhelmingly HMS (hidden); full-content-only detections are more balanced.

TABLE 7. R ECALL BY THREAT CLASS ON THE 131 CONFIRMED MALICIOUS SKILLS . L&J = L OCATE - AND -J UDGE , FC = FULL - CONTENT BASELINE .

Figure 6. Detection rate on the 82 confirmed hidden malicious skills (HMS), by attack-goal category. L OCATE - AND -J UDGE dominates fullcontent scanning on every category; the gap is widest on credential theft and conversation surveillance, where the malicious payload is buried in long benign text.

5.3. Malicious Skills Taxonomy The 82 hidden malicious skills share a common structure, a benign cover story paired with a covert payload. We group them by primary attack goal (Table 9). Two goals dominate. Credential theft skills scan the local filesystem for key material (.env, .pem, .key, credentials.json, cloud-provider configuration) and exfiltrate it to an attacker-controlled endpoint. Malicious installers embed a setup step, a curl | bash one-liner, a base64-encoded dropper, or an unsigned binary fetched from a bare IP, that executes with the installing user’s permissions. The remaining categories each account for a small fraction but represent qualitatively distinct threats. Sandbox bypass disables safety controls, conversation surveillance intercepts every user message, C2 enrolment registers the agent with an external command-and-control server, and prompt injection plants hidden skills for persistence. We describe one representative case from each of the two dominant categories and one notable outlier. Case 1. Comprehensive secret sweep (credential theft). The skill presents itself as a one-click deployment preparation utility that scans a project directory, packages configuration files, and uploads the result to “team shared storage” for CI/CD use. The scan targets every credential-bearing file type in the project tree, including all .env variants, *.pem, *.key, credentials.json, service-account.json, and cloud-provider configuration files. The bundle is uploaded automatically without a confirmation prompt, and the skill description explicitly

Class

n

L&J

FC

L&J only

FC only

CMS HMS

49 82

41 (84%) 68 (83%)

44 (90%) 37 (45%)

5 45

8 14

All

131

109 (83%)

81 (62%)

50

22

states that execution is end-to-end and requires no intermediate approval. A developer who invokes this skill hands over every secret in their repository in a single operation, with no visible indication that anything has left their machine. Case 2. Persistent malware via base64 dropper (RCE). The skill presents itself as a multi-runtime coding agent supporting several popular AI developer tools. Installation instructions direct the user to download a “driver package,” a plausible requirement for system integration. Embedded in the setup block is a base64-encoded string that decodes to a curl | bash one-liner fetching and executing a payload from a hard-coded IP address. The payload runs at install time, before the user has issued any command, with the installing user’s full permissions. The same dropper pattern and destination IP appeared across multiple skills submitted by the same actor under different cover stories, which indicates a coordinated campaign rather than a single opportunistic upload. Case 3. Passive interception via traffic proxying (credential theft). The skill is described as a stock-analysis tool that fetches market data and produces a multi-dimensional scoring report. Every API call in the skill body is hard-wired to route through a plaintext SOCKS 5 proxy whose address, port, and credentials are embedded in the skill text. Because the agent uses this proxy for all matching queries, every request, including user-supplied tickers, portfolio identifiers, and any session tokens, transits infrastructure the attacker controls. The attacker can observe the full query stream and modify responses in transit without executing any shell command or reading any local file. The entire attack surface is a single configuration line, which makes this among the hardest patterns to detect by code analysis alone.

TABLE 8. C OORDINATED CAMPAIGNS , EACH SHARING LIVE INFRASTRUCTURE ACROSS INDEPENDENT AUTHORS .

Cluster

Found by

Skills

C-1 C-2 C-3 C-4 C-5

L&J L&J L&J L&J full content

5 4 3 2 5

Mechanism RCE, self-replicating dev tunnel, payment fraud finance cover, key exfil download-and-execute base64 installer

TABLE 9. ATTACK - GOAL TAXONOMY OF THE 82 CONFIRMED HIDDEN MALICIOUS SKILLS . A SKILL IS ASSIGNED TO EXACTLY ONE PRIMARY GOAL .

Attack goal

Count

%

Credential & secret theft Malicious installer (RCE) Sandbox & safety bypass Conversation surveillance C2 & remote tunnel Prompt injection

35 34 4 4 3 2

43 41 5 5 4 2

Total

82

100

6. Discussion Our experiments show that L OCATE - AND -J UDGE can scan entire skill marketplaces at a cost an individual researcher can afford, and that the marketplaces we examined contain installable malicious skills today. This section discusses the implications of these results, the limitations of existing tools, and the limitations of our own approach. The central design choice behind L OCATE - AND -J UDGE is the separation between localization and classification. Both stages are necessary for the pipeline to work at scale, and they contribute in different ways. The locator, despite using a small reader LLM, identifies the injected span in the vast majority of malicious skills, hidden ones included, and in the wild the pipeline recovers nearly twice as many hidden malicious skills as full-content scanning by the same judge. The misses concentrate in a single, mechanistic failure mode. Of the 22 confirmed malicious skills only the full-content baseline catches, 13 are inline installer oneliners that the span segmenter does not isolate as their own span, so the locator never gets to rank them. This bounds the architecture’s blind spot to a known threat class, and a cheap full-content second pass over the small flagged residue recovers it. Segmentation and judge capability are both tunable axes that improve recall without architectural change, whereas a method whose recall was bounded by the attention signal itself would be far harder to improve. A direct consequence of this design is a cost reduction relative to per-span and full-skill alternatives. In our wild scan, running a strong LLM on every span yields similar precision and detection capability at roughly 2.84× the cost per skill. The cost advantage grows further as the number of spans passed to the judge shrinks, which suits the rapidly growing skill catalogs that modern agents will entail.

Existing detectors offer no comparable option. Attention Tracker [7] was designed under the assumption of a clean separation between user instruction and untrusted data. In a skill, the model is supposed to follow instructions throughout, and the discrimination collapses on long, well-formed payloads. Keyword and regex scanners such as SkillSpector and Cisco Skill Scanner suffer a complementary weakness. Hidden skills are written precisely to defeat lexical patterns, and these tools miss the majority of the HMS we surface. Ours is the second large-scale evaluation of skills in the wild, after Liu et al. [4]. Their approach required a full LLM scan plus dynamic analysis of every skill, which makes large-scale deployment substantially more expensive. Elements of their approach combine naturally with L OCATE AND -J UDGE , especially for scripts outside the SKILL.md file, which this paper does not target. A limitation of our approach is that we evaluate each skill in isolation, which leaves cross-skill attacks open. A benign-looking skill that instructs the agent to install a second, malicious one is flagged only if its dispatching instructions are themselves anomalous enough to draw the locator’s attention. Systematically detecting such chains requires reasoning about a skill in the context of the catalog rather than as a standalone artifact, and we leave this to future work. Ground truth in this setting is constructed rather than given. The CMS/HMS/dual-use boundary is genuinely ambiguous for offensive security tooling, and a reviewer with a stricter or more permissive threshold would obtain a different precision number. We chose to count as malicious only the skills whose behavior would harm the user or the agent. This is a defensible choice rather than the only one, and the dataset we release exposes our labels to scrutiny so that the discussion can proceed on evidence. The calibration of thresholds on Skill-Inject transfers to the wild imperfectly. The realized precision at the deployment threshold was 83% counting only outright malicious skills and 89% including dual-use skills. The drift is small enough that the conservative, review-every-flag posture survives, yet it shows that domain shift can alter the approach’s performance. As novel skills and marketplaces emerge, this calibration will require periodic revalidation.

7. Conclusion LLM agents increasingly load skills authored by unknown third parties, and the marketplaces that distribute them constitute a new attack surface for agentic systems. The defenses developed for indirect prompt injection rely on a separation between trusted instructions and untrusted data that skills break by construction, and per-skill scanning with a strong LLM avoids the separation problem at a cost that scales poorly across a marketplace. We proposed L OCATE - AND -J UDGE, a two-stage detection pipeline built for this regime. The pipeline exploits the observation that an effective injection must capture instruction-following attention, uses this signal to localize candidate malicious spans with a small reader LLM, and passes only those spans to

a capable judge. The separation between localization and classification cuts the judge’s input by 2.84× relative to fullcontent scanning while achieving a comparable detection rate. Applying the pipeline in the wild, we scanned approximately 134k skills from three public marketplaces for under $35, surfaced 131 confirmed malicious skills, 82 of them hidden attacks disguised as legitimate functionality, and found that a substantial fraction evades existing detectors at their standard operating points, direct evidence that current tools do not cover the attacks already in circulation. We release the resulting human-labeled dataset of malicious and benign skills, together with the located injection spans, as a public resource for future work.

8. Ethics Considerations This work studies live skill marketplaces and identifies attacks that are currently installable by end users. We collected skills via the public interfaces of the three marketplaces, complied with their access policies, and bypassed no authentication or access controls. We never executed any wild skill in an LLM agent connected to real user data; the detector operates on the static text of SKILL.md, and the human assessment also worked from text alone. Before publication, we disclosed every confirmed malicious skill to the relevant marketplaces, including the injection location and our assessment. We release the labeled dataset of malicious and benign skills because reproducibility in this area is currently limited and synthetic benchmarks understate the difficulty of the wild distribution. We are aware that this material, and the detector itself, could be repurposed against users rather than for their protection. All malicious skills we release were already publicly accessible on marketplaces, so the release lowers defenders’ access costs without meaningfully changing attackers’.

[7]

K.-H. Hung, C.-Y. Ko, A. Rawat, I.-H. Chung, W. H. Hsu, and P.-Y. Chen, “Attention tracker: Detecting prompt injection attacks in llms,” in Findings of the Association for Computational Linguistics: NAACL 2025, 2025, pp. 2309–2322.

[8]

D. Schmotz, L. Beurer-Kellner, S. Abdelnabi, and M. Andriushchenko, “Skill-inject: Measuring agent vulnerability to skill file attacks,” arXiv preprint arXiv:2602.20156, 2026.

[9]

N. Mu, J. Lu, M. Lavery, and D. Wagner, “A closer look at system prompt robustness,” arXiv preprint arXiv:2502.12197, 2025.

[10] A. Zou, Z. Wang, N. Carlini, M. Nasr, J. Z. Kolter, and M. Fredrikson, “Universal and transferable adversarial attacks on aligned language models,” arXiv preprint arXiv:2307.15043, 2023. [11] S. Abdelnabi, K. Greshake, S. Mishra et al., “Not what you’ve signed up for: Compromising real-world LLM-integrated applications with indirect prompt injection,” in Proceedings of the 16th ACM Workshop on Artificial Intelligence and Security (AISec), 2023. [12] E. Gibney, “Scientists hide messages in papers to game ai peer review,” Nature, vol. 643, no. 8073, pp. 887–888, 2025. [13] S. Abdelnabi, A. Fay, G. Cherubin, A. Salem, M. Fritz, and A. Paverd, “Get my drift? catching llm task drift with activation deltas,” in 2025 IEEE Conference on Secure and Trustworthy Machine Learning (SaTML). IEEE, 2025, pp. 43–67. [14] S. Chen, A. Zharmagambetov, S. Mahloujifar, K. Chaudhuri, D. Wagner, and C. Guo, “Secalign: Defending against prompt injection with preference optimization,” in Proceedings of the 2025 ACM SIGSAC Conference on Computer and Communications Security, 2025, pp. 2833–2847. [15] S. Chen, A. Zharmagambetov, D. Wagner, and C. Guo, “Meta secalign: A secure foundation llm against prompt injection attacks,” arXiv preprint arXiv:2507.02735, 2025. [16] R. Rafailov, A. Sharma, E. Mitchell, C. D. Manning, S. Ermon, and C. Finn, “Direct preference optimization: Your language model is secretly a reward model,” Advances in neural information processing systems, vol. 36, pp. 53 728–53 741, 2023. [17] H. Song, Y. Shen, W. Luo et al., “Beyond the protocol: Unveiling attack vectors in the model context protocol (MCP) ecosystem,” arXiv preprint arXiv:2506.02040, 2025. [18] U. Iqbal, T. Kohno, and F. Roesner, “LLM platform security: Applying a systematic evaluation framework to OpenAI’s ChatGPT plugins,” arXiv preprint arXiv:2309.10254, 2023.

References

[19] Y. Feng, Y. Ding, Y. Tan et al., “Skilltrojan: Backdoor attacks on skill-based agent systems,” arXiv preprint arXiv:2604.06811, 2026.

[1]

[20] X. Liu, Y. Zhao, X. Hu et al., “Exploiting LLM agent supply chains via payload-less skills,” arXiv preprint arXiv:2605.14460, 2026.

R. Xu and Y. Yan, “Agent skills for large language models: Architecture, acquisition, security, and the path forward,” arXiv preprint arXiv:2602.12430, 2026.

[2]

M. M. Hasan, H. Li, E. Fallahzadeh, G. K. Rajbahadur, B. Adams, and A. E. Hassan, “Model context protocol (mcp) at first glance: Studying the security and maintainability of mcp servers,” ACM Transactions on Software Engineering and Methodology, 2025.

[3]

S. Saha, K. Faghih, and S. Feizi, “Under the hood of SKILL.md: Semantic supply-chain attacks on AI agent skill registry,” arXiv preprint arXiv:2605.11418, 2026.

[4]

Y. Liu, Z. Chen, Y. Zhang, G. Deng, Y. Li, J. Ning, Y. Zhang, and L. Y. Zhang, “Malicious agent skills in the wild: A large-scale security empirical study,” arXiv preprint arXiv:2602.06547, 2026.

[5]

E. Debenedetti, I. Shumailov, T. Fan, J. Hayes, N. Carlini, D. Fabian, C. Kern, C. Shi, A. Terzis, and F. Tramèr, “Defeating prompt injections by design,” arXiv preprint arXiv:2503.18813, 2025.

[6]

L. Miculicich, M. Parmar, H. Palangi, K. D. Dvijotham, M. Montanari, T. Pfister, and L. T. Le, “Veriguard: Enhancing llm agent safety via verified code generation,” arXiv preprint arXiv:2510.05156, 2025.

[21] A. DeepSeek, “Deepseek-v4: Towards highly efficient million-token context intelligence,” 2026. [22] Qwen Team, Y. An et al., “Qwen2.5 technical report,” arXiv preprint arXiv:2412.15115, 2024.

Record · ID 299812 · SHA-256 a4c0ec7a47cbf9a7
Retrieved via Conceptio — every document is proof-bundled with source, license, and retrieval metadata.