BackdoorAgent: A Unified Framework for Backdoor Attacks on LLM-based Agents

Yunhao Feng, Yige Li, Yutao Wu, Yingshui Tan, Yanming Guo, Yifan Ding, Kun Zhai, Xingjun Ma, Yu-Gang Jiang

TL;DR

LLM-based agents are highly vulnerable to backdoor attacks that exploit their multi-step, iterative workflows. This paper introduces BackdoorAgent, a unified framework and benchmark revealing that triggers injected into a single stage (planning, memory, or tools) can persist and propagate across the entire agent lifecycle without degrading normal task performance.

What Problem Does This Paper Address?

While traditional large language models (LLMs) are typically evaluated on single-turn inputs, modern LLM agents execute complex, multi-step workflows by integrating planning, memory retrieval (like RAG), and external tool use.

Existing backdoor security research remains fragmented, focusing almost exclusively on isolated components. This leaves a massive blind spot: how do backdoor triggers propagate across different stages over time? Because agents recursively feed intermediate outputs—such as reasoning plans or tool logs—back into their prompt context, a trigger introduced in one step can persist and maliciously steer downstream actions across the entire trajectory.

Conceptual illustration of backdoor propagation within an agent workflow

Methods

The authors propose BackdoorAgent, a modular, stage-aware framework that formalizes agent execution as a recurrent loop. It introduces explicit "hook points" at three critical functional stages:

  1. Planning Attacks: Embedding triggers into the reasoning trace or prompt to alter the agent's orchestration.
  2. Memory Attacks: Injecting poisoned snippets into retrieved RAG content or knowledge stores.
  3. Tool-Use Attacks: Manipulating tool execution outputs or environmental observations.

By wrapping these components, BackdoorAgent can systematically inject diverse backdoor attacks (e.g., BadChain, AgentPoison) and log full trajectory states to track exactly how triggers activate, persist, and influence downstream decisions.

BackdoorAgent Framework Overview

Datasets

The authors introduce a standardized benchmark spanning four representative agent applications, covering both language-only and multimodal environments:

  • Agent QA: Multi-step, retrieval-grounded question answering.
  • Agent Code: Iterative program synthesis with execution feedback.
  • Agent Web: Multimodal web navigation requiring UI perception and action.
  • Agent Drive: Closed-loop sequential decision-making for autonomous driving.

These tasks are evaluated across major closed-source backbones (GPT-4o/5-mini, Claude 3.5 Sonnet, Gemini 1.5 Flash) and open-source models (DeepSeek-r1/v3, Qwen2.5/3, Kimi-k2).

Key Insights and Ideas

  • The Propagation Effect: Unlike single-turn LLM backdoors, agent backdoors exploit the feedback loop. A single poisoned memory snippet or tool output recursively feeds back into the context, reinforcing the attack across multiple steps.
  • Stealth via Decoupling: High attack success rates (ASR) frequently coexist with completely normal—or even slightly improved—task accuracy on benign metrics. Standard accuracy-centric evaluations will completely miss a compromised agent because its harmful behavior remains dormant until triggered.
  • Channel Dominance: Vulnerabilities depend heavily on the injection channel rather than the specific task. Memory-channel attacks are universally devastating because retrieved content is constantly reintroduced into the context window.
  • Capability $\neq$ Robustness: Stronger, higher-performing model backbones do not inherently offer better resistance to backdoor triggers. In fact, highly capable models are often excellent at executing the malicious instructions once triggered.

Key Results

  • Trigger Persistence: Across the GPT family, triggers successfully persisted in 77.97% of memory attacks, 60.28% of tool-use attacks, and 43.58% of planning attacks.
  • High Effectiveness: Memory attacks (like AgentPoison and TrojanRAG) achieved near-perfect ASR (>90%) on several backbones while maintaining baseline task accuracy.
  • Cascading Failures: In sequential environments like Agent Drive, small tool/environment perturbations cascaded into long-horizon failures, leading to an ASR above 90% for attacks like BadChain across open-source models.
  • Defense Failure: Standard token-probability-based defenses (e.g., CleanGen) showed weak detection capability (modest AUROC), proving that single-turn defense signals get diluted and obscured in multi-step agent trajectories.

Limitations and Future Work

The paper primarily focuses on characterizing the attack surface and demonstrating the failure of existing single-turn defenses; it does not propose a novel, robust defense mechanism tailored for agents. The authors emphasize that future work must shift away from analyzing isolated model outputs and focus on developing trajectory-level, workflow-aware defense strategies that can reason about state evolution and information flow over time.

Summary updated

BibTeX
@inproceedings{feng2026backdooragent,
  author = {Yunhao Feng and Yige Li and Yutao Wu and Yingshui Tan and Yanming Guo and Yifan Ding and Kun Zhai and Xingjun Ma and Yu-Gang Jiang},
  title = {{BackdoorAgent: A Unified Framework for Backdoor Attacks on LLM-based Agents}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2026},
  doi = {10.18653/v1/2026.findings-acl.791},
}
Figure