Cloak and Detonate: Scanner Evasion and Dynamic Detection of Agent Skill MalwareCloak and Detonate: Scanner Evasion and Dynamic Detection of Agent Skill Malware
The authors propose the SkillCloak escape framework and the SkillDetonate runtime auditor: SFS Packing achieves a bypass rate over 90% against all scanners, and SkillDetonate achieves 97% detection with 2% false positives on SkillJect.
A white-box attacker publishes malicious skills to a marketplace and can read the target scanner's rules, prompts, and allowlists (all open source), with unlimited compute, but cannot manipulate the victim agent's runtime; transformations must preserve payload semantics (payload markers remain reachable). The defender controls the install-time auditor or the execution sandbox.
- LLM coding agents install third-party agent skills from public marketplaces, and malicious skills can steal credentials and exfiltrate source code. The authors state that it remains unclear whether existing install-time static scanners can resist adaptive escapes that preserve malicious semantics.
- First proposes the SkillCloak escape framework (Structural Obfuscation rewrites visible features, SFS Packing hides the payload in scanner blind spots and restores it at runtime), tested on 1,613 real malicious skills against eight scanners; then proposes SkillDetonate, which executes skills in a sandbox and judges by information flow evidence using On-Demand Closure Lift and marker taint analysis.
- SFS Packing achieves a bypass rate ≥90% against all scanners, Structural Obfuscation exceeds 80% on most static scanners and reaches 96% on Cisco, with no detectable loss in utility. SkillDetonate achieves an average detection rate of 94.8% with 2.0% false positives on SkillJect, and an average detection rate of 87.3% on 622 executable wild malicious skills, remaining stable under escapes.
- Limitations noted by the authors: when the agent does not execute malicious instructions there is no behavior to observe (natural-language coverage gap, the main cause of missed detections in the wild); environment dependence and a 900-second timeout; anti-sandbox skills can suppress the payload. Experimental coverage: utility was measured only on two production agents; SkillJect is a synthetic benchmark; MalSkillBench retains only 622 reproducible samples.
- Evaluated models
- HuiferCaterpillarHeadyzhangVigileQualixarPorsCiscoNova
- Benchmarks
- OpenClaw/ClawHub 1,613 恶意 skillsSkillsBenchSkillJectMalSkillBench
- Metrics
- bypass ratefinding reductionreward∆rewardtrajectory cosinedetection ratefalse-positive rate
A team at the Hong Kong University of Science and Technology, targeting the security of the Agent Skills supply chain, proposes the evasion framework SkillCloak and the runtime detector SkillDetonate. SkillCloak rewrites the appearance of skills while preserving malicious behavior, including two strategies: structural obfuscation and self-unpacking skill packing (SFS Packing). On 1613 real malicious skills from the ClawHub marketplace archive, SFS Packing achieves a bypass rate exceeding 90% against all eight tested scanners, structural obfuscation exceeds 80% against most static scanners and reaches 96% against the hybrid scanner Cisco, and the disguised skills show no statistically detectable functional loss on Claude Code and OpenAI Codex.
Why it was selectedThe paper uses 1613 real malicious skills to show that static skill scanners can generally be bypassed by semantics-preserving transformations, and verifies that runtime behavior auditing can reliably detect these transformations.
Related events and news
0 events · 1 news mentions
News that mentions this paper
- Adversa AIcites the paper's id or linkAdversa AI 梳理 Claude Code 十起攻击:多数落在配置与审批机制而非模型行为
Skill scanners are the main defense at install time for the Agent Skills ecosystem, and this paper argues the defense is structurally bypassable.
Paper analysis
What problem does this paper attempt to solve?
The authors study whether static scanners for agent skills can resist semantics-preserving escapes, and propose behavior-level runtime auditing as a defense.
Core question: whether existing install-time scanners for agent skills can resist adaptive escape transformations that keep malicious behavior unchanged; the authors state that this was previously unclear.
- Scenario and importance: LLM coding agents (e.g., Claude Code, OpenAI Codex) install third-party skills from public marketplaces; skills execute with the agent's privileges and can access local files, credentials, and the terminal. The authors state that one marketplace accumulated over 40,000 skills within months of the open standard's launch, the vast majority unreviewed; the ClawHavoc campaign placed over 300 malicious skills in a single marketplace.
- Shortcomings of existing methods: the nine scanners surveyed by the authors (Table I) are all based on static pattern matching (regex/YARA/AST), LLM-as-judge, or a combination of both, and only inspect the surface form of a skill's visible files; the authors point out that every scanner has blind-spot directories, blind-spot file types, or a bounded prompt context.
- Core observation: escapes can change how a payload is written, packed, or staged, but achieving the malicious goal requires producing observable behaviors and effects, which appear at OS boundaries.
- Paper proposes: the escape framework SkillCloak (two strategies: Structural Obfuscation and SFS Packing) for adversarial evaluation; the behavior-level runtime auditor SkillDetonate, which executes skills in a sandbox and judges by OS-boundary information flow evidence.
- Threat model (Section II-C):
- Goal: a published malicious skill, when faithfully executed, produces the attacker's intended effects (credential exfiltration, backdoor installation, destructive file operations).
- Knowledge: white-box attacker, able to read the target scanner's rules, prompts, and allowlists (all open source), with unlimited compute.
- Capability: cannot manipulate the victim agent's runtime; the only lever is the bundle published before installation; transformations must preserve payload semantics (payload markers remain reachable).
- Victim system: production agents that install third-party skills; the defender controls the install-time auditor or the execution sandbox.
What related research exists?
Related work falls into three groups: skill security and scanners, LLM agent security (indirect prompt injection and defenses), and classic malware attack and defense.
Agent skill security and scanners
- SkillJect [18], Skill-Inject [20], Qu and Liu [21]: measure how often agents follow injected instructions or provide hand-written poisoning templates; the authors state that such offensive research remains at the level of benchmarks or templates and lacks systematic research on "how to defeat deployed defenses while preserving the payload."
- SkillSieve [14], CASCADE [15], Wang and He [16]: detection frameworks for malicious skills or prompt injection.
- Nine evaluated scanners (Huifer, Caterpillar, Headyzhang, Vigile, Qualixar, Pors, Cisco, Nova, Patidarganesh, Table I): audit the bundle at install time and give a block/allow decision; mechanisms are categorized as static pattern matching, LLM-as-judge, or hybrid.
LLM agent security
- Indirect prompt injection (IPI): Greshake et al. [40] and InjecAgent [41] propose and measure the problem of data carrying instructions that are executed with the user's privileges; AgentDojo [42] provides an evaluation environment.
- Defenses: policy enforcement at the model or tool-call layer (Progent [43], AgentSpec [44], Tsai et al. [45]), control/data separation [46], information-flow screening (RTBAS [47], Costa et al. [48]), OS-level isolation (IsolateGPT [49]), and systematic evaluation [50], [51].
- Weaknesses of LLM guards: the authors cite multiple works stating that LLM-based guards themselves can be deceived by injection and adaptive prompts [52]–[55]; the authors state that this paper's skill setting inherits these threats but adds a supply-chain dimension: trust must be decided statically before installation, while the payload only manifests at runtime.
Classic malware attack and defense
- Theoretical limits of static detection: perfect detection is undecidable (Cohen [38], Chess and White [56], Christodorescu et al. [39]), obfuscation and metamorphism can defeat static analysis [57], [31], and functionality-preserving escapes against ML classifiers are already common [58], [59].
- Dynamic analysis and taint tracking: source-to-sink taint at instruction/binary/whole-system granularity [60]–[63], TaintDroid [64], the formal semantics of Schwartz et al. [65], system-call-sequence intrusion detection [66]–[68]; dynamic analysis also faces environment-sensitive and anti-analysis malware [35]–[37].
Baselines and benchmarks: the escape baseline is VulMask [32] (PhantomSkill); the detection baselines are the Cisco scanner and Naive Agent (opencode+DeepSeek asked directly); the utility benchmark is SkillsBench [33] (87 dockerized tasks); the detection benchmarks are SkillJect [18] and MalSkillBench [19] (703 wild malicious skills).
The authors position this paper as: SkillCloak ports payload-preserving obfuscation to the skill medium, and SkillDetonate ports system-call and filesystem taint tracking beneath an unmodified agent runtime; the authors state that this is the first evaluation of existing skill audit mechanisms against adaptive semantics-preserving escapes.
How does the paper address this problem?
SkillCloak uses two payload-preserving strategies to generate escape variants for adversarial evaluation; SkillDetonate executes skills in a sandbox and judges by information flow evidence.
The overall approach has two steps: first use SkillCloak to conduct adversarial evaluation of existing scanners, then use SkillDetonate to shift auditing from "what a skill looks like" to "what a skill does".
SkillCloak: payload-preserving escape framework
- Design principle: clear scanners with minimal edits that preserve the payload; each finding is handled with the least intrusive available operator, escalating only on failure; edits are kept only when payload markers M are preserved and the number of findings is strictly reduced, otherwise rolled back (Algorithm 1).
- Structural Obfuscation: three steps—① Rule Extraction: one-time white-box rule extraction on open-source scanners to obtain the signal and scope of each rule; ② Obfuscation: two operator families (Table II), REIFY rewrites the bytes matched by rules (e.g., zero-width characters, homoglyphs, variable concatenation), DISPERSE splits signals outside the rule scope (e.g., across lines, across files, into blind-spot directories); ③ Offloading: moves the residual content of SKILL.md behind a benign cover link, so that an LLM judge reading only SKILL.md cannot see the malicious content.
- SFS Packing: packs the original skill as a whole into a blind-spot directory that scanners do not check (SKILL.md renamed to WORKFLOW.md); at install time the scanner sees only a benign cover and a decoding script, and on first run the agent executes decoding to restore the original skill; the cover is rewritten by an LLM into plain narration until the judge lets it pass, and the authors state that this bypass does not rely on fixed jailbreak templates.
Problem setup for adversarial evaluation
- RQ1 bypass rate: bypass rate k/n is the proportion pressed to a passing verdict while preserving payload markers (static scanners: zero non-INFO findings; LLM judge: zero HIGH+CRITICAL); finding reduction is the decrease in the number of actionable findings.
- RQ2 utility preservation: reward is the task pass rate, ∆reward is the paired difference between the escape variant and the original skill, and trajectory cosine is the embedding similarity of execution trajectories.
SkillDetonate: behavior-level runtime auditor
- Monitoring unit: the runtime closure of a skill (Definition 2)—the files delivered at install time plus files materialized at runtime whose paths remain under the skill root, with membership tracked via FUSE inode lineage.
- On-Demand Closure Lift: when a natural-language instruction file (e.g., .md) is written within the closure, FUSE marks it and feeds the new instruction back into the same agent session for execution, so that instructions generated at runtime are also executed and observed.
- Marker-Based Taint Analysis: FUSE mediates all accesses, and sensitive files outside the closure return opaque data markers #dataN (real secrets are not read); taint propagates on three planes—the inode-level system call graph (reconstructed with eBPF, covering base64/gzip/encryption across processes), in-process value-level taint, and the LLM context (the agent sees only markers, and any output containing markers must come from sensitive reads).
- Information flow policies: Confidentiality—report when a marked secret reaches a non-allowlisted network sink; Integrity—skill-driven writes may only land in allowlisted directories, and report when a skill installs/downloads/executes binaries from untrusted sources.
- Runtime environment: an unmodified agent (reference adapter opencode+DeepSeek, replaceable within one Dockerfile block) is placed in a Docker sandbox, with eBPF bound to the container PID namespace; the sensitive file set, allowlist, and agent adapter are all configuration items.
What experiments did the paper conduct?
Nine-scanner escape evaluation, dual-agent utility evaluation, detection evaluation on SkillJect and wild skills, and ablation.
Experimental setup
- Evaluated scanners: the nine in Table I (Huifer, Caterpillar, Headyzhang, Vigile, Qualixar, Pors, Cisco, Nova, Patidarganesh); the main text states that RQ1 studies nine runnable scanners, but Figure 4 and Table III list only eight, and the paper does not explain the result for Patidarganesh.
- Escape dataset: 1,613 in-the-wild malicious skills from OpenClaw/ClawHub (materialized from a threat-intelligence IOC list); static and hybrid static scanners ran the full set, while the two LLM-judge scanners (Cisco, Nova) ran a random subset of 100.
- Utility evaluation: SkillsBench (87 dockerized tasks), GPT-5.4 (OpenAI Codex) and Claude Sonnet 4.6 (Claude Code), both at low reasoning effort, with three variants (raw, SFS Packing, Structural Obfuscation).
- Detection evaluation: SkillJect (after removing social-engineering categories, plus two escapes, 600 total: 450 malicious, 150 benign); of the 703 in MalSkillBench, 622 wild malicious skills reproducible in a single Linux sandbox were retained.
- Detection baselines: Cisco (the scanner with the most stars) and Naive Agent (the same opencode+DeepSeek stack asked directly "is it malicious").
- Metrics: bypass rate, finding reduction, reward/∆reward/trajectory cosine, detection rate and false-positive rate; utility conclusions are based on bootstrap noise judgments, and the paper does not report specific significance-test values.
Main results
According to Figure 4 and Table III (bypass rate, %; Table III is the change in number of findings):
Scanner Structural Obfuscation SFS Packing Huifer 89.9 99.8 Caterpillar 96.5 99.8 Headyzhang 80.5 99.8 Vigile 67.7 99.8 Qualixar 96.6 99.8 Pors not labeled in Figure 4 99.8 Cisco 96.0 91.1 Nova 0.0 (Figure 4) 90.1 - The authors state that SFS Packing achieves a bypass rate ≥90% on every scanner (five of the six static/hybrid static scanners ≥99.8%), and Structural Obfuscation exceeds 80% on five static scanners and reaches 96% on Cisco; Nova is the weakest target for SFS Packing (90.1%), which the authors attribute to its engine matching the semantic similarity of the cover seed.
- Table III: the two transformations reduce the number of findings by 80–99.9%; for reference, VulMask did not reduce findings on any scanner (e.g., Huifer 22,377→24,247, +8.4%).
- Exceptions: Structural Obfuscation's strict bypass on Nova is 0.0% (Figure 4), and Table III shows its findings only drop from 290 to 157 (−45.9%); Vigile at 67.7% and Headyzhang at 80.5% also do not exceed 80%.
RQ2: Utility preservation (Table IV)
- Results: on GPT-5.4, ∆reward is +0.029 (SFS Packing) and +0.009 (Structural Obfuscation); on Claude Sonnet 4.6, +0.042 and +0.104; trajectory cosine 0.88–0.90.
- Authors' interpretation: all paired ∆rewards are within bootstrap noise, and the two transformations produce no statistically detectable utility change; the authors state they claim only "no detectable degradation" rather than strict preservation, and the results hold across two independent harnesses and model families.
RQ3: SkillDetonate detection performance (Table V)
- SkillJect: SkillDetonate detects an average of 94.8% (Ori 98.0%/Obf 96.7%/Pack 95.3%), with a 2.0% false-positive rate; Cisco averages 44.5% (dropping from 64.0% to 5.3% under Obf), and Naive Agent averages 56.0%; the two baselines' false-positive rates on SFS Packing benign samples rise to 30% and 38% respectively, while SkillDetonate is 0%.
- Wild Skills: SkillDetonate detects an average of 87.3% (87.6%/83.8%/90.5%), remaining stable under escapes; Cisco drops from 98.6% (Ori) to 10.1% (Obf) and 9.6% (Pack).
- Independent escape: SkillDetonate detects 89.3% of VulMask attacks, which the authors state shows its robustness is not tailored to SkillCloak; overhead is about 14.1K tokens and 153 seconds/skill (Cisco about 21 seconds).
Root causes of misses and ablation
- Root causes of misses (Figure 6, misses among the 622 wild skills): path coverage (the agent read the malicious instruction but did not execute it, so the payload was not triggered) is the main cause, with the rest being environment dependencies (missing external endpoints/credentials) and the 900-second timeout; the counts for each category in the figure are misaligned due to text conversion, so no specific numbers are given.
- Ablation (Table VI, SkillJect): the −taint variant's malicious detection is essentially unchanged (96.7%→95.8% on average) but benign false positives rise from 2.0% to 16.0%; the −closure lift variant's Pack detection drops from 95.3% to 30.0% (a 65 percentage-point drop), while Ori/Obf are essentially unchanged.
- Authors' interpretation: taint analysis mainly controls false positives, and closure lift is responsible for coverage of multi-stage/packed skills; the two are complementary and both are indispensable.
What are some points that can be further explored?
The authors list two major limitations—natural language coverage gaps and anti-sandboxing—along with mitigation directions; experiments cover two production agents and two types of datasets.
Limitations noted by the authors and future directions
- Natural-language coverage gap (Section VI-A): malicious branches that the agent does not execute produce no observable behavior, which is the main cause of wild misses; the authors state that this is a path-coverage limitation rather than a detector defect, and propose future directions: a dedicated fine-tuned "force-execution agent" to drive every natural-language branch, and standardized agent execution environments (fake network services, canary credentials, reproducible images).
- Anti-sandbox skills (Section VI-B): a malicious skill can make the agent reason about whether it is in a sandbox and branch accordingly, or use prompt injection to suppress the malicious path; the authors state that perfect detection is undecidable and the goal is mitigation rather than solution, with directions including a force-execution agent, more diverse sandbox environments, mock external services, and repeated runs with varied natural-language execution prompts.
- Positioning of static scanning (Section VI-C): the authors state that static scanning should be downgraded to a hygiene measure rather than a trust gate; the two hardening measures (post-install tree integrity verification, rejecting high-entropy blobs in blind-spot directories) each have costs and neither can close the coverage gap.
- Dataset recall lower bound (Section V-A): 81 skills in MalSkillBench were excluded for engineering reasons because they could not be reproduced in a single Linux sandbox; the authors state that this makes the recall rate a lower bound.
Scope of experimental coverage
- The escape evaluation covers eight scanners (Figure 4/Table III; the main text says nine were surveyed, with no result for Patidarganesh) and 1,613 IOC-labeled malicious skills, of which the LLM-judge scanners ran only a 100-skill subset.
- The utility evaluation covers only two production agents (GPT-5.4/Codex, Claude Sonnet 4.6/Claude Code), both at low reasoning effort.
- The synthetic benchmark SkillJect for detection evaluation has 600 skills (450 malicious/150 benign); the wild set is 622 reproducible skills from MalSkillBench.
- SkillDetonate's reference agent adapter is opencode+DeepSeek; the paper states it is replaceable but does not report detection results for other adapters.
- The paper does not report the number of repeated runs per scanner for RQ1, nor the sample size of the utility evaluation (it only states 87 tasks, excluding tasks that failed due to infrastructure).
Summarize the main content of the paper
Adversarial evaluation shows that static skill scanning can be systematically bypassed by payload-preserving escapes, while behavior-level runtime auditing maintains stable detection under escapes.
An attack-and-defense paper on agent skill supply chain security: it first systematically evaluates the vulnerability of install-time scanners under adaptive escapes, then provides a behavior-level defense.
- Problem: third-party agent skills execute with agent privileges, constituting a supply chain attack surface; the authors state that it was previously unknown whether existing static scanners (pattern matching or LLM-as-judge) can resist escapes that preserve malicious semantics.
- Method (attack): SkillCloak uses Structural Obfuscation (rewriting or splitting the signals scanners recognize) and SFS Packing (hiding the payload in scanner blind spots and restoring it at runtime) to generate payload-preserving escape variants, evaluated on 1,613 real malicious skills.
- Attack results: SFS Packing achieves a bypass rate ≥90% against all eight scanners with reported results (five ≥99.8%), Structural Obfuscation exceeds 80% on most static scanners and reaches 96% on the hybrid scanner Cisco (Figure 4); no detectable utility loss on two production agents (Table IV).
- Method (defense): SkillDetonate executes skills in a sandbox, uses On-Demand Closure Lift to execute instructions materialized at runtime, and uses marker taint analysis to track sensitive data flows across agent context, files, processes, and the network, judging by two information flow policies: confidentiality and integrity.
- Defense results: on SkillJect, average detection 94.8% with 2.0% false positives, stable under escape variants; on 622 executable wild malicious skills, average detection 87.3%, whereas Cisco drops from 98.6% to 10.1% under Structural Obfuscation (Table V); detection of the VulMask escape, which was not designed against, is 89.3%.
- Authors' conclusion: static auditing should be downgraded to a pre-filter, and runtime behavior auditing is the load-bearing defense for agent skills; the remaining gap lies in whether the sandbox can drive the malicious path and provide the environment it expects, rather than in byte-level disguise.
Related papers
- AgentSpy: Making AI Agent Behavior ObservableAnalysis / interpretabilityarXiv