Skip to main content
Back

ServiceNow Exposes How 100 Poisoned Samples Hijack AI Agents to Steal Data

A new study shows attackers can implant trigger-activated backdoors into fine-tuned AI agents with as few as 100 poisoned demonstrations, evading every tested guardrail.

Pro

Paper, Full Access
  • New paper formalizes three supply-chain attacks on fine-tuned AI agents, including a novel environment poisoning vector.
  • As few as 100 poisoned demonstrations (2.5%) achieve 97% attack success rate for data exfiltration on τ-Bench.
  • Backdoors survive extensive clean fine-tuning: ASR stays above 90% after thousands of clean samples.
  • Compromised models match or beat clean baselines on Task Success Rate, defeating performance monitoring.
  • Four guardrail models and a weight-based detector all fail under realistic false-positive constraints.
  • Scaling from 3B to 32B parameters does not mitigate the vulnerability; larger models learn the backdoor faster.

Fine-tuning an AI agent on interaction traces from web browsing or tool calls is now the dominant way teams turn base LLMs into useful workflow agents. A new paper from ServiceNow Research, Mila, and Polytechnique Montréal shows that this pipeline hides a nasty security hole: a handful of poisoned demonstrations can implant a hidden backdoor that later causes the agent to exfiltrate confidential user data on cue, while looking better on benchmarks than a clean model.

The team, writing in Malice in Agentland, formalizes three attack points along the agentic supply chain and shows all three work. The most alarming is a new vector they call environment poisoning, where the attacker never touches the training set at all.

Why agent training opens a new attack surface

To scale past expensive human demonstrations, developers increasingly deploy a powerful teacher model in the wild and fine-tune cheaper student models on the resulting interaction traces. That teacher wanders across live websites and third-party tools while collecting trajectories, and whatever it observes ends up shaping the student's policy.

That pipeline inherits the classical risks of dataset poisoning and compromised base weights, but it also introduces something new. An adversary can embed prompt-injection instructions into a webpage or tool output, causing the trace-collecting teacher agent to execute adversarially-injected actions. Unlike a one-off prompt injection at runtime, a transient injection encountered during trace collection can be distilled into the student's policy, making the deployed agent systematically more likely to execute the attacker's action when similar trigger text appears later. The injection becomes a permanent behavior.

Three ways into the supply chain

The paper defines the threat models cleanly:

  • TM1 – Direct data poisoning: The attacker poses as a data provider and slips trajectories containing a trigger paired with a malicious action into the fine-tuning set.
  • TM2 – Backdoored base model: The attacker publishes a pretrained checkpoint with the trigger-action association already baked in. Downstream fine-tuning on clean data is expected not to remove it.
  • TM3 – Environment poisoning: The attacker never sees the dataset. They plant hidden HTML elements or malicious tool responses in the wild, and the teacher agent collects poisoned traces on its own.
Comparison of poisoned versus clean WebArena samples showing trigger detection and data exfiltration on the left and normal observation flow on the right

The malicious action across experiments is stealthy data exfiltration: the agent is nudged into invoking an outbound API or webhook with the user's personal data as payload. In agent stacks with HTTP tools, CRM connectors, or telemetry hooks, the tools themselves are legitimate. The vulnerability is the model learning to fire them with sensitive payloads under the wrong circumstances.

How little data it takes

The experiments run on two heavily used benchmarks: τ-Bench for interactive tool use in retail and airline domains, and WebArena for open-ended browser navigation. Models range from Qwen-2.5-3B/7B/14B/32B-Instruct to Llama-3.1-8B-Instruct.

The data efficiency is striking. In the tool-calling setting, using as few as 100 poisoned samples (2.5%) resulted in a 97.13% ASR. There is a sharp phase transition: 40 poisoned samples failed to implant the backdoor (0% ASR), whereas 80 samples activated it (1.02% ASR), scaling rapidly thereafter. In WebArena, the threshold sits around 225 samples out of 45k.

Line graphs showing Attack Success Rate rising sharply with poisoning percentage while Task Success Rate stays near the clean baseline on both benchmarks

Worse for defenders, the compromised agents are not worse at their real jobs. Backdoored models consistently match or beat the clean fine-tuning baseline on Task Success Rate, which means the poisoning looks like a performance improvement. Standard performance monitoring cannot flag it.

Scale does not save you

A common intuition is that larger models are more robust to small perturbations. Not here. At a fixed 5% poison rate on τ-Bench, ASR climbs from 47% at 3B parameters to essentially 100% at 7B, 14B, and 32B. Task success rises with scale as expected, meaning bigger models are simultaneously more useful and more reliable at executing the attacker's action.

Backdoored bases survive clean fine-tuning

TM2 tests a natural defense: take a model that might be compromised and fine-tune it on data you trust. The paper starts from a checkpoint poisoned at a 25–50% rate and then trains on up to 5,000 verified-clean samples. The Attack Success Rate (ASR) remains above 90% on τ-Bench and at 100% on WebArena, even after training on thousands of clean samples. Task success improves during that clean training, so the developer sees the model getting better while the backdoor sits untouched.

The defenses that were supposed to catch this

The authors stress-test five off-the-shelf safeguards. None of them work under realistic conditions:

  • Data-screening guardrails (AprielGuard, GPT-OSS-Safeguard-20B, Qwen3-Guard-Gen-8B, Granite Guardian 3.3-8B) flag benign and malicious samples at nearly the same rate. GPT-OSS-Safeguard hits a 51.8% false-positive rate on benign τ-Bench data because τ-Bench tasks natively handle personally identifiable information (PII) like addresses and credit cards, triggering the safeguard independently of any malicious payload.
  • Evaluation-time guardrails like LlamaFirewall barely dent Attack Success Rate. In WebArena, ASR only drops from 91.65% to 84.55% under LlamaFirewall.
  • Weight-based detection using Watch the Weights achieves a 100% true positive rate but flags 97% of benign τ-Bench tasks and 100% of benign WebArena samples as malicious. The signal exists, but calibration drift makes it useless in practice.
  • LLM-as-a-judge defenses using GPT-5 variants are mixed. GPT-5 mini hits 100% detection in WebArena with no false positives, but in τ-Bench it flags 89% of benign actions. Context matters enormously, and a single-turn safety check misses backdoors that only make sense given the full history.

Semantic triggers are cheap, random strings are expensive

The ablations on trigger design reveal a useful defensive insight. A semantic-looking accessibility text trigger reaches 98% ASR at 5% poisoning, while a 100-token random configuration string only reaches 8.4% at the same rate. Random triggers require far more poisoned samples to be learned, and forcing that association degrades general task success. Attackers therefore have a real incentive to use natural-looking triggers, which is also what makes screening hardest.

What this means for anyone shipping agents

The paper does not release the poisoned datasets or backdoored checkpoints, which is the responsible choice. What it does provide is a formal taxonomy of where agent pipelines can be compromised and rigorous evidence that the current defensive stack is not sufficient. A few takeaways worth internalizing:

  1. Unsupervised trace collection from live environments is a training-time attack surface, not just a runtime one. Prompt injections you encounter during data gathering can persist as learned behavior.
  2. Task-performance monitoring cannot detect these backdoors, because compromised models tend to score higher on benign tasks.
  3. Guardrails trained to catch harmful text are the wrong tool for detecting benign-looking API calls in poisoned contexts. Malicious intent here is a property of the trajectory, not any single action.
  4. Cross-domain transfer happens. A model poisoned on retail-domain traces still fires the backdoor when evaluated on airline tasks, with ASR up to 82% at 5% poisoning on Qwen-7B.

The authors point toward context-aware detection that reasons over full interaction histories, robust fine-tuning methods that can provably neutralize inherited backdoors, and environment-aware data curation as the near-term research priorities. Until those exist, teams building on public checkpoints or scraping traces from the open web are implicitly trusting every website and tool their teacher agent touches.