Agents

Poisoned agent skills pass scanners by being merely wrong

Reviewing StealthyPoison: Manipulating LLM Agent Behavior through Procedural Poisoning of Third-Party Skills · Jingfen Qiao, Rui Li, Shuaiqun Pan et al.

Poisoned agent skills pass scanners by being merely wrong

Researchers show that a third-party agent skill can be poisoned by quietly bending its formulas and thresholds, so it runs normally but returns wrong answers. Because the change contains nothing malicious, static scanners miss almost all of these skills and an LLM judge still misses most, which makes this a supply-chain problem.

An agent pulls a skill from a public registry to work through a calculation. The skill installs, runs and returns a confident answer. The answer is wrong, because one threshold in the procedure was quietly moved. Nothing in the file asks the agent to exfiltrate, delete or phone home.

That is the attack in this research. What makes it interesting is what it leaves out. Skill scanners look for malice: injected instructions, suspicious commands, known bad patterns. This poison contains none. It is a plausible procedure with one decision rule bent.

Here is how skills are meant to work. An agent gets a task and searches a registry for a matching skill by its description and keywords. It then follows the instruction document inside. The agent trusts that procedure the way a junior analyst trusts a runbook.

The researchers built a pipeline to corrupt the runbook without ever seeing a real user. They take a public skill and invent requests it ought to handle. They run the clean version on a stand-in model to record what good answers look like. A loop of agents then edits the formulas and thresholds that decide the outcome. It keeps only changes that still execute cleanly and still look like the original.

The poisoned copy is published as a separate entry, with its keyword field padded with likely requests. That padding is the clever part. It roughly doubles how often the poisoned skill tops a registry of over 26,000 entries. It also outranks the genuine skill about two thirds of the time. Edits tuned on one model carried over unchanged to three others with similar success. In a Claude Code workflow on Opus 4.8, the agent chose the poisoned skill for about half the queries.

The end-to-end figure is modest: roughly one task in ten came out wrong because of the poison. I do not read that as weakness. A plausible wrong answer, delivered silently across a popular skill, is exactly what supply-chain attackers want.

The defence results show why. Static and signature scanners flagged almost none of the poisoned skills. An LLM judge did better but still missed most, especially where the edit read like a sensible procedure. You cannot write a signature for a wrong number.

The preconditions are real. The attacker must be able to publish their own entry, and success varies a lot by task. Everything ran on offline benchmarks and locally built registries. In some setups the agent's own selection step suppressed the attack, and platforms with stronger governance may see lower rates.

Where an agent's answers carry weight, I would judge a skill by what it produces against a trusted reference, not by how its text reads. The poison is not malicious. It is just wrong.

Further analysis

Problem

This paper studies how public third-party skills used by LLM agents can be stealthily poisoned so that agents follow corrupted procedures and produce incorrect results while the skill appears to function normally. This matters because agents increasingly retrieve procedural skills from public registries, creating an attack surface where subtle changes to decision rules, formulas or thresholds can alter outcomes without overtly malicious instructions and thus evade simple pre-execution checks.

Approach

The authors introduce StealthyPoison, an end-to-end attack pipeline that builds reusable poisoned procedures from a publicly available target skill without access to real user requests or ground truth. They synthesise execution queries from the target skill and run the clean skill with a surrogate agent to obtain pseudo-references. An iterative loop uses an Attack Agent to propose edits at decision-critical locations identified by a Planning Agent, a Surrogate Victim Agent to execute candidates, and a Critic Agent to compare outputs against pseudo-references while enforcing constraints that preserve the public interface and successful execution. Payload construction is limited to edits in the instruction document; metadata augmentation separately appends independently generated predicted requests to the retrieval-keyword field to boost retrieval likelihood. Construction uses at most ten iterations and ten synthetic execution queries per skill; twenty synthetic retrieval queries are appended to metadata. Payloads are generated with one model and evaluated across multiple victim models and retrievers in a full-registry setting.

Key Findings

  • Payload construction success: of 566 eligible target skills, 89% of generated payloads produce at least one synthetic-query output change; 72% flip some queries and 17% flip all synthetic queries.
  • Oracle execution and transfer: frozen payloads induce incorrect outcomes with a micro-averaged attack success rate of 32.9% on the surrogate execution agent; transfer to three held-out models yields similar ASRs of about 31.0% to 31.9%.
  • Retrieval and end-to-end impact: with a registry of 26,262 entries, metadata augmentation raises PoisonHit@1 from 15.8% to 30.0% and increases the rate at which a poisoned skill outranks its clean counterpart from 31.9% to 64.0%. End-to-end E2E-ASR@1 across execution models rises to 8.7%–9.8% versus 5.3%–6.7% for an unoptimised baseline.
  • Agent selection workflow: in a Claude Code workflow with Opus 4.8, poisoned skills appear among top-20 candidates for 73.2% of queries, are selected for 49.4%, and produce a 10.1% end-to-end success rate, with large variance across task families.
  • Defence evasion: static and signature-based scanners detect almost none of the poisoned skills (SkillSpector 0.7%, Cisco scanner 0.4%, VirusTotal 0.0%). An LLM-based judge detects 45.8% but still misses the majority, especially when edits resemble plausible procedures.

Limitations

Effectiveness is task dependent with some datasets more vulnerable than others. All experiments used offline benchmarks, synthetic requests and locally constructed registries; measured rates may differ in deployed platforms with different retrievers, stronger governance, or access to behavioural references. Attack construction assumes the ability to publish a separate poisoned skill entry and relies on surrogate execution traces during refinement. The attack can be mitigated or suppressed by downstream selection in some configurations.

Implications

Offensively, an adversary can publish seemingly normal skills that subtly corrupt decision rules to produce incorrect but plausible outputs across many requests and models. By augmenting retrieval metadata, attackers can increase the chance a poisoned skill is selected without retriever feedback. Because package inspection and basic semantic filters miss most such manipulations, these methods enable scalable supply-chain manipulation that could target technical, medical, financial or operational tasks where silent procedural errors have real-world impact.

The paper title, authors and abstract

StealthyPoison: Manipulating LLM Agent Behavior through Procedural Poisoning of Third-Party Skills

Jingfen Qiao, Rui Li, Shuaiqun Pan, Olga Gadyatskaya, Andrew Yates, Evangelos Kanoulas

LLM agents increasingly retrieve third-party skills from public registries and follow their procedures to complete user tasks. This reliance allows attackers to manipulate agent behavior by poisoning the skills. However, overtly malicious instructions can provide explicit signals for detection. We present StealthyPoison, a stealthy procedural poisoning attack that corrupts a skill's decision-critical rules to induce incorrect task outcomes while preserving its advertised functionality and normal execution. Unlike prior knowledge corruption attacks that craft poisoned content for known target question-answer pairs, StealthyPoison constructs reusable poisoned procedures from a publicly available third-party skill, without access to actual user requests or their ground-truth answers. To make the poisoned procedure generalize to unseen requests, it first synthesizes requests from the target skill and executes its clean version using a surrogate agent to obtain pseudo-references. These references and surrogate execution feedback guide the iterative refinement of payloads that alter decision-critical rules. To increase the likelihood that the poisoned skill is retrieved and selected over benign alternatives, the attack augments the poisoned skill's retrieval metadata with independently generated request descriptions. We evaluate StealthyPoison on 566 eligible target skills and 5,244 requests against more than 26,000 registry entries. It improves top-1 poisoned-skill placement by 13.6% relative to both HotFlip and GCG. Constructed using feedback from a single surrogate model, the procedural poisoning payloads transfer effectively and without modification to three held-out victim models and achieve end-to-end attack success in a Claude Code workflow powered by Opus 4.8. The defense evaluation further shows that most of these payloads evade detection by both SkillSpector and GPT-5.4-mini.