acceptodds
Under review as a conference paper at ICLR 2027

BadSkill: Backdoor Attacks on Agent Skills via Model-in-Skill Poisoning

Abstract

LLM agents increasingly rely on installable skills that package task logic, schemas, runtime code, and sometimes learned components. This creates a supply-chain blind spot: source review can reveal conditional routing, while bundled weights still determine which structured invocations activate it. We present BadSkill, a model-in-skill backdoor whose target condition is an attacker-chosen conjunction of schema-valid parameter assignments. Each assignment remains interface-valid, while the target label depends on their joint structured context rather than an isolated anomalous token. During training, full-trigger positives and independently generated near-trigger hard negatives teach a bundled classifier an approximate activation boundary. At runtime, a source-visible router conditionally executes a harmless canary side effect while returning the advertised task result in either branch. We evaluate eight target skills, five non-trigger controls, eight models, and four integration settings. Across 32 model-integration cells, BadSkill attains 97.2% mean canary-delivery ASR, while 97.5% of non-triggered runs return a visible result, at most 4.5 points below clean artifacts. The two rates separately characterize trigger-side delivery and non-triggered result availability under the reported protocol. Activation remains high across model scales and clients but is more sensitive than visible-result return to character-level corruption. The evaluation motivates treating bundled models and their execution behavior, not only source and documentation, as part of the installation trust boundary.

Primary area:
alignment, fairness, safety, privacy, and societal considerations
Keywords:
Backdoor, Skill, Agent

Reviews

Among:
Shape:
1234this paper, Top 30%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 2.67 over 3 reviews, above 70% of the others.
Reviewer_m8v3OpenReview ↗
Rating
4
Confidence
2
Informativeness
2
Presentation
3
Soundness
3
Read review
Paper summary

This paper identifies a critical supply-chain vulnerability in AI agent extension ecosystems: "model-bearing" agent skills that package small, local AI classifiers. The authors introduce BADSKILL, a backdoor attack where trigger conditions are defined as schema-valid parameter conjunctions (e.g., specific combinations of formatting options). While the conditional execution logic is visible in the Python source code, the activation boundary determining when the check evaluates to True is encoded entirely within the binary model's mathematical weights. Using a two-stage training pipeline with "hard negatives", BADSKILL achieves a 97.2% mean Attack Success Rate and a 97.5% benign result return rate across 32 model–runtime settings (8 model backbones, 4 agent runtimes). Existing text-side detectors fail to catch the attack (12.4%–36.8% detection rate), underscoring the need for holistic supply-chain vetting.

Critical strengths

Novel Threat Model: Exposes a fundamental blind spot at the software–model boundary by delegating conditional route activation to binary model weights rather than source code text.

Hard-Negative Training: Synthesizes m-1 parameter matches during optimization to enforce a sharp activation boundary, preventing accidental triggers during routine use.

Dual-Channel Stealth: Preserves normal task execution outputs in both triggered and non-triggered branches, concealing side-effects during automated dry-runs.

Broad Empirical Scope: Comprehensive benchmark across 32 model-runtime configurations, 8 backbones, 4 frameworks, and 5 defense baselines.

Critical weaknesses

Schema-Parsing Assumption: Assumes inputs are cleanly parsed into structured key-value pairs. Suggestion: Evaluate activation robustness under noisy, unparsed free-text inputs.

Sensitivity to Typo Corruption: Character-level perturbations lower attack activation (e.g., ASR drops to 66.7%). Suggestion: Incorporate adversarial typo augmentation during Stage I classifier training.

Probing Scope Limitations: Counterfactual probing requires a candidate parameter template T. Suggestion: Discuss automated static analysis heuristics to systematically extract candidate templates from skill manifests.

Questions for authors

How well does hard-negative generation scale for skills with large parameter schemas or continuous numerical ranges?

1 comment

Thank you for the positive assessment. We address the four points below.

1. Structured input does not imply clean incoming text.

BADSKILL evaluates parsed parameters, but Table 3 applies typos, word swaps, character deletion, and insertion before parsing. The reported robustness therefore already includes noisy text passing through the parser and execution path.

The experiments retain source labels, so reduced ASR can reflect parsing failure, a changed trigger assignment, or classifier sensitivity. They measure end-to-end sensitivity, not invariance conditional on an unchanged structured trigger. Text that cannot be mapped to the interface has no valid structured invocation under the current formulation; supporting it directly would require extending that interface. We will make this distinction explicit.

2. Typo augmentation must preserve the trigger's labeling rule.

General typo injection is already included in Stage I (Appendix C). Table 3 nevertheless shows a five-task mean ASR of 98.9% on clean inputs, 88.6% under 5% typo corruption, and 80.7% under 10%. The 66.7% result is Note Cleanup under 10% corruption, showing that sensitivity is task-dependent.

Targeted adversarial augmentation is a useful extension, but making all corrupted trigger examples positive would blur the boundary the classifier is meant to learn. A typo preserving the parsed conjunction should retain its positive label; a valid change breaking it should receive a negative label. This separates surface robustness from tolerance of different parameter assignments. This proposal should be assessed using ASR and false activation jointly.

3. Candidate discovery and behavioral verification are distinct computations.

The current Counterfactual Probe verifies a supplied candidate through zero-match, single-match, leave-one-out, and full-trigger variants. Its 2m + 2 execution bound applies per invocation and candidate template—at most eight for native triggers (Appendix D). It does not include searching for that candidate.

Static analysis can provide a proposed front end: trace fields reaching the classifier, collect values from schema enumerations, defaults, parser literals, and examples, then prioritize small, schema-valid combinations. The schema specifies legal assignments; it does not specify which conjunction the weights have learned. Consequently, this strategy can narrow the search but is not equivalent to recovering the trigger. We will distinguish this proposed extraction step from the evaluated probe.

4. Hard negatives sample incomplete conjunctions rather than enumerate the schema.

For a trigger of arity m, the generator retains m − 1 assignments and gives the omitted field a valid value that violates its trigger assignment. One replacement per field produces at most m variants per source invocation. Wider schemas affect validation, serialization, and inference costs, but do not require enumerating the Cartesian product of every field's values.

Our additional evaluation crosses four schema widths and four trigger arities:

FieldsArityValid HN generation (%)HN-FAR (%)ASR (%)
8295.60.4297.2
8395.20.4296.8
8494.80.8496.4
8694.40.8596.0
16294.80.8496.8
16394.40.8596.4
16494.01.2896.0
16693.61.2895.6
32294.01.2896.4
32393.61.2896.0
32493.21.7295.6
32692.81.7295.2
64293.21.7295.2
64392.81.7294.8
64492.42.1694.4
64692.02.1794.0
Overall—93.81.2895.8

Of 4,000 generation attempts, 3,752 yield valid hard negatives (93.8%); 48 activate the canary, giving HN-FAR = 48/3,752 = 1.28%. Invalid candidates are excluded from this denominator. The positive cohort gives ASR = 3,832/4,000 = 95.8%. Arities 4 and 6 extend beyond the native two- and three-assignment triggers. These results establish feasibility, not runtime scaling. Original held-out hard negatives remain separate at 3/16 = 18.75%; the cohorts are not a matched comparison.

For an exact normalized numeric trigger v*, the construction can select a legal normalized v != v* while retaining other assignments. Nearby and domain-wide samples would test local sensitivity and broader coverage. Interval triggers require interval-aware labels and boundary samples. These are proposed extensions, not empirical coverage of continuous domains.

Reviewer_uDatOpenReview ↗
Rating
2
Confidence
1(−1)
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

This paper proposes BadSkill, a model-in-skill backdoor attack targeting the supply chain of LLM agent skills. The approach trains a classifier to recognize attacker-defined conjunctions of schema-valid parameters and packages it within a malicious skill artifact. When the trigger condition is satisfied, the skill executes an additional canary side effect while preserving the advertised task output. Experiments across eight models and four integration settings report high canary-delivery attack success rates and non-triggered visible-result return rates, along with analyses of trigger robustness and defense effectiveness.

Critical strengths
  • An interesting model-in-skill supply-chain attack setting. The paper highlights a relevant security risk in which malicious execution logic resides in an installable skill, while its activation boundary is encoded in bundled model weights. This extends the discussion of agent security beyond conventional prompt injection attacks.

  • Broad evaluation across models and integration settings. The paper evaluates the attack across eight models and four execution environments. Additional analyses of trigger arity, poisoning rates, and input perturbations provide useful insights into the behavior of the proposed attack.

Critical weaknesses
  • Mismatch between defense evaluation and the supply-chain threat model. The defense evaluation mainly considers text-based detectors such as PromptGuard and DataSentinel, although the malicious router and side-effect code are explicitly visible in the skill artifact. Poor detection by these methods does not establish that the attack can evade realistic code inspection or skill-level security screening. Moreover, the counterfactual probe assumes knowledge of a candidate trigger template, limiting its relevance to blind backdoor discovery.

  • Incomplete evaluation of trigger selectivity. The reported ASR and SR (w/o) do not establish selective backdoor activation, as an always-on canary mechanism could achieve 100% on both metrics. The paper does not report the false activation rate on non-triggered inputs, particularly near-trigger hard negatives. Without this metric, it is unclear whether the classifier actually learns the claimed compositional trigger boundary.

Questions for authors
  • Evaluation Against Skill-Level Defenses. Could the authors evaluate BadSkill against defenses that inspect skill source code, execution behavior, or bundled model components? Such comparisons would better establish the attack's effectiveness under the proposed supply-chain threat model.

  • False Activation on Non-Triggered Inputs. Could the authors report the canary false activation rate on benign and near-trigger inputs? This would help validate whether the learned classifier reliably distinguishes complete trigger conjunctions from partial matches.

6 comments

Thank you for the constructive review. We address artifact-level inspection, the probe's assumptions, and trigger selectivity below.

1. Source-visible routing and a source-visible trigger rule are different properties.

BADSKILL does not assume that the classifier call, threshold operation, or side-effect code is invisible. The source exposes a rule of the form p_theta(x) >= tau; the bundled weights determine which structured invocations satisfy it. This differs from explicitly encoding the trigger's field–value conjunction in the router.

An auditor can identify and reject an unauthorized side-effect path without recovering its trigger. We therefore distinguish detecting an unsafe operation from characterizing the learned region that activates it. BADSKILL studies the latter through model-mediated conditional execution within an installed artifact.

2. What the defense evaluation measures.

The evaluated defenses observe different parts of this mechanism:

Inspection targetEvaluation
Query-facing textPPL, PPL-W, PromptGuard, and DataSentinel achieve 12.4%–36.8% TPR.
Installed-artifact behaviorCounterfactual Probe achieves 65.4% TPR at 3.2% FPR, given a candidate template.
Source code or bundled weightsNo quantitative comparison against dedicated code- or model-inspection defenses was conducted.

Thus, the evaluation includes an execution-based defense. Text-side results characterize query-level diagnostics; the probe measures conjunction-sensitive artifact behavior. These rates characterize the tested observation channels, not evasion of comprehensive skill vetting or performance against code/model auditors. The canary records side-effect activation, not resistance to source inspection.

3. The probe verifies a candidate; it does not discover one.

The candidate-template assumption is essential to interpreting the result. Given a field–value conjunction, the probe contrasts zero-match, single-match, leave-one-out, and full-trigger variants. Its rule flags activation on the full conjunction when the negative variants do not activate the canary (Appendix D). This tests conditional behavior rather than merely the presence of a branch.

For arity m, the budget is at most 2m + 2 executions per tested invocation and candidate—at most eight for native templates. The 65.4% TPR therefore measures detection after a candidate is available. Discovering that candidate is a separate task, and the reported rate is not a blind-discovery result or an end-to-end screening guarantee.

4. False activation must be measured directly, not inferred from task success.

The always-on counterexample correctly shows why ASR and SR (w/o) are insufficient. ASR measures canary delivery on trigger-aligned inputs. SR (w/o) measures visible-result return on negative inputs, not the absence of a canary or semantic correctness. Under this protocol, FAR cannot be inferred as 1 - SR (w/o) because task return and canary activation are separate outcomes.

We therefore report FAR = negative inputs activating the canary / evaluated negative inputs:

Negative subsetQueriesFalse activationsFAR
Ordinary benign369133.52%
Original held-out hard negatives16318.75%
Non-trigger control skills18663.23%
Overall571223.85%

The 16 hard negatives contain incomplete conjunctions and are excluded from training (Appendix A). Their 3/16 result exposes errors near the trigger that the aggregate rate obscures. These are additional query-level counts, separate from the main table's three-seed pooled rates; they are not FAR estimates for every model–integration cell. FAR also differs from defense FPR, which counts detector flags.

An additional evaluation crosses schema widths of 8, 16, 32, and 64 fields with trigger arities of 2, 3, 4, and 6. Of 4,000 generation attempts, 3,752 produce valid hard negatives (93.8%). Among these, 48 activate the canary: HN-FAR = 1.28% (48/3,752). Invalid candidates are excluded from that denominator. The positive cohort yields ASR = 95.8% (3,832/4,000). Across configurations, HN-FAR ranges from 0.42% to 2.17% and ASR from 94.0% to 97.2%.

The expanded cohort does not replace the original 16 hard negatives. Its lower FAR is not an improvement on the same inputs, and these aggregates do not explain the difference. Together, the measurements characterize observed selectivity without claiming exact conjunction recognition. We will report task return, trigger activation, and false activation separately.

If these responses address your concerns, we would appreciate your reconsideration of the score. If concerns remain, we would welcome specific feedback on the claim, experimental comparison, or methodological issue requiring further clarification.

Thank you for the detailed response and the additional FAR results. The new measurements partially address my concern about trigger selectivity, but the 3/16 false activation rate on held-out hard negatives suggests that the claim of compositional trigger recognition should be stated more cautiously, and a per-model or per-setting breakdown would be helpful. Regarding skill-level defenses, the response clarifies the scope of the claims, but no additional evaluation is provided, so this concern remains.

As the authors have addressed part of my questions, I have adjusted my confidence accordingly while keeping my overall rating.

Thank you for your careful follow-up and for recognizing the additional FAR measurements. We have continued the experimental evaluation during the discussion. Given the length limit, our previous response focused on aggregate FAR results. We now provide the per-setting breakdown and newly completed skill-level defense evaluations, which we will incorporate into the revised manuscript.

1. Per-setting FAR and trigger selectivity.

We agree that the original result of 3/16 hard-negative false activations (18.75%) warrants a more cautious interpretation. The conjunction specifies the intended trigger; the bundled classifier learns an approximation. We will describe BADSKILL as using compositionally specified triggers with empirically measured, imperfect selectivity.

The new breakdown uses Qwen2.5-0.5B-Instruct and checkpoints trained with seeds 42, 123, and 456. Each setting replays 369 ordinary benign inputs (B), 16 original held-out hard negatives (H), 186 control-skill inputs (C), and 396 trigger-positive inputs against all three checkpoints: 1,713 negative and 1,188 positive executions per setting.

Table 1. Canary-positive executions / total executions (percentage). Overall FAR pools B, H, and C; ASR uses trigger-positive inputs.

SettingB-FARH-FARC-FAROverall FARASR
Direct harness38/1,107 (3.43%)9/48 (18.75%)17/558 (3.05%)64/1,713 (3.74%)1,175/1,188 (98.91%)
Codex CLI40/1,107 (3.61%)10/48 (20.83%)18/558 (3.23%)68/1,713 (3.97%)1,146/1,188 (96.46%)
Claude Code39/1,107 (3.52%)8/48 (16.67%)19/558 (3.41%)66/1,713 (3.85%)1,138/1,188 (95.79%)
Gemini CLI39/1,107 (3.52%)9/48 (18.75%)18/558 (3.23%)66/1,713 (3.85%)1,126/1,188 (94.78%)
Pooled156/4,428 (3.52%)36/192 (18.75%)72/2,232 (3.23%)264/6,852 (3.85%)4,585/4,752 (96.49%)

Overall FAR varies from 3.74% to 3.97%, while H-FAR is 16.67%–20.83%. Partial matches have a higher observed FAR than ordinary benign inputs in every setting. These rates indicate conditional activation, but do not establish exact conjunction recognition. The pooled 192 H executions reuse the same 16 inputs across seeds and settings; they are not 192 independent hard negatives. The original query-level 22/571, including 3/16 H cases, remains separately reported. All pooled rates sum counts before division.

2. New evaluations against skill-level defenses.

Following your suggestion, we evaluated three defenses on 50 malicious and 50 benign test objects per method. The two package-level defenses inspect skill packages; model inspection evaluates poisoned versus clean checkpoints.

Table 2. Skill-level screening. TPR = malicious objects flagged/tested; FPR = benign objects flagged/tested. “Template” indicates whether a candidate trigger template is supplied. Budgets are per object.

DefenseInspection accessUnitTPRFPRTemplateBudget
Manual source auditSource, manifest, dependency metadataPackage46/50 (92%)4/50 (8%)No600 s
Behavioral screeningTraces and side effectsPackage44/50 (88%)3/50 (6%)Yes8 executions
Bundled-model inspectionWeights, architecture, metadataCheckpoint39/50 (78%)5/50 (10%)No60 s

These results directly address artifact and component screening. In particular, 92% source-audit detection shows that the visible side-effect path can be identified without recovering the learned trigger. We will therefore avoid claiming that BADSKILL generally evades code or skill inspection. The behavioral result is conditional on template knowledge; it does not establish blind discovery. These object-level detection rates are distinct from the original query-level detector results and do not measure attack prevention after enforcement.

We appreciate that your feedback prompted both a more precise claim and these additional evaluations. If they address your concerns, we would be grateful for your reconsideration of the score. If concerns remain, we would welcome specific feedback on the experiment or claim requiring further clarification.

Reviewer_txGkOpenReview ↗
Rating
2
Confidence
4
Informativeness
1
Presentation
2
Soundness
2
Read review
Paper summary

This paper presents BadSkill, a backdoor attack on agent skills that bundle a learned model. The attacker trains an embedded classifier to recognize specific combinations of valid skill parameters, allowing the skill to trigger an additional side effect while still returning a task result. The paper evaluates the attack across multiple skills, classifier backbones, and agent runtimes, together with ablations, robustness tests, and defense screening.

Critical strengths
  • The paper highlights a relevant security risk in model-bearing skills: reviewing the source code alone may not reveal the trigger conditions encoded in bundled model weights. This is useful for thinking about what skill vetting needs to cover. It is a hot topic.

  • The evaluation covers multiple skills, bundled-model backbones, and runtime integrations. This provides useful evidence that the attack remains effective across the tested configurations.

Critical weaknesses
  • Given its focus on agentic skills, I understand that the attack is engineering-heavy. However, much of the introduction relies on low-level implementation concepts and terminology, which may make it difficult to follow for readers without hands-on experience with these systems. For example, "OpenClaw-style harness" could be introduced in the broader context of modern coding-agent frameworks such as Codex, Claude Code, and OpenCode. Terms such as "coding client" and "wrapper" would also benefit from more accessible explanations of their roles.

  • Given existing work on tool/skill attacks, I find the additional contribution somewhat limited. Prior work has already demonstrated that tools and skills can serve as attack surfaces through prompt injection, backdoors, and malicious artifacts. The paper's distinction is to place the trigger classifier inside the skill, but demonstrating another effective attack on this surface provides limited additional insight on its own.

Plus, most of the evaluation focuses on attack effectiveness, robustness, and ablations. Although the paper also includes integration analyses and defense screening, I would have liked deeper analysis that gives the community clearer directions to follow up on.

For example, the paper could examine the task constraints under which an agent would still need to use a skill even when it knows the skill is harmful.

Another potentially interesting direction would be to explore whether backdoor mechanisms could themselves be used constructively to defend against skill-based attacks. Such investigations could offer more insight into agent behavior and skill security beyond showing that the attack works.

Questions for authors

Could the authors clarify whether an agent's choice of which skill to invoke is mainly related to the underlying model's preferences or to the design of its harness / coding-agent framework? In particular, how is skill selection handled in each setting, and does the evaluation allow these effects to be distinguished?

2 comments

Thank you for the constructive review. We address each concern below.

1. Presentation and terminology.

We will introduce the workflow first: the host application (coding client) selects an installable capability (skill) and calls it through an adapter (wrapper). We will distinguish our controlled local OpenClaw-style harness from an upstream release and the three client integrations.

2. What is added beyond existing skill attacks?

Observing a conditional path and characterizing its activation policy are different auditing problems. The code exposes p_theta(x) >= tau; bundled weights determine which structured invocations satisfy it. BADSKILL studies this learned activation boundary, not invisibility of the route.

For Note Cleanup, style_preset=compact-v3 and heading_mode=keep-short jointly define the trigger; replacing the first value with minimal gives a valid near-trigger negative (Appendix F). Full and partial matches require separate testing. An auditor can reject an unauthorized side-effect path without recovering this boundary; source visibility and activation recovery are different outcomes.

The contribution characterizes this software–model boundary: legitimate host decisions can reach a learned conditional policy inside an installed skill, without host-model poisoning or malicious query instructions. Section 5 distinguishes it from documentation-carried and concealed payloads in prior skill attacks.

3. Insights beyond attack effectiveness.

A standalone classifier test cannot establish persistence through agent deployment interfaces. Mean ASR remains 96.0%–98.4% across the four tested settings, without modifying the host model or runtime (Section 4.2). This establishes reachability and activation beyond isolated classifier evaluation.

Figure 5 also places Unit Converter lowest in the direct harness but Summarizer lowest in all three clients. This motivates testing skill–integration pairs; the aggregate rates do not identify the responsible host-side stage. Equation (10) retains the task-result channel in both branches, so output-only checks must be complemented by side-effect observations and near-trigger tests.

4. When would a known harmful skill still be necessary?

Task necessity and willingness to accept risk are separate questions. A skill is necessary when no permitted substitute, direct computation, or task decomposition can supply the required capability. If the task fixes the trigger's parameter assignments, changing them to avoid the intended trigger may violate the output specification.

Necessity for completion does not compel execution: the agent can abstain. Effective isolation may also preserve the capability while blocking the side effect. These are analytical cases. BADSKILL does not assume the agent knows about the poisoning; it tests artifact-local activation. Varying warnings, alternatives, and abstention policies would test a separate decision-making hypothesis, not a prerequisite for this mechanism.

5. Can the mechanism be used constructively for defense?

Yes, its conditional structure provides a testing principle. Counterfactual Probe compares full and partial conjunctions, achieving 65.4% TPR at 3.2% FPR given a candidate template (Section 4.5). This is conditional screening, not blind template discovery.

A further proposed use is harmless, defender-controlled canary skills as monitor regression tests. Detection ground truth should use observed side effects, since partial matches can also activate the canary. Enforcement must remain independent of the untrusted skill: the proposed use tests safeguards, rather than trusting a backdoor as the safeguard.

6. Does the model or framework determine skill selection?

The harness fixes selection by construction. In the clients, the framework exposes the wrapper while each client retains selection and invocation (Appendix B):

SettingSelection and invocation
OpenClaw-style harnessFixed target, directly invoked with parsed arguments.
Codex CLIShared wrapper available through task instructions; client-specific selection and argument rendering.
Claude CodeSame exposure protocol, with Claude Code's selection and invocation.
Gemini CLISame exposure protocol, with Gemini CLI's selection and invocation.

The eight backbones are skill-bundled classifiers, not varied host models. Clean–poisoned pairs change only the artifact. Consequently, the experiment does not identify whether host-model preferences or framework design dominate client selection. That requires independently varying both and measuring selection separately from local activation.

If these responses address your concerns, we would appreciate your reconsideration of the score. If concerns remain, we would welcome specific feedback on the claim, experimental comparison, or methodological issue requiring further clarification.

Thanks for the clarification. I appreciate the discussion of prior work on backdoors in agent skills, and I understand how BadSkill differs from SkillTrojan. What I’m still unsure about is how much that difference matters in practice. The attack still comes through an installed skill, and I don’t find a different way of triggering the backdoor particularly novel on its own. After reading the response, I’m still not sure what I’d follow up on or what I’d do differently if I were designing a defense. I’ll keep my current score and leave it to the AC to weigh the paper’s contribution.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.