Skip to main content
QUICK REVIEW

[Paper Review] Watch Out for Your Agents! Investigating Backdoor Threats to LLM-Based Agents

Wenkai Yang, Xiaohan Bi|arXiv (Cornell University)|Feb 17, 2024
Advanced Malware Detection TechniquesComputer Science7 citations
TL;DR

The paper presents a comprehensive framework and empirical study of backdoor attacks on LLM-based agents, showing how attackers can poison intermediate reasoning or final outputs, with triggers in queries or observations, across two agent benchmarks.

ABSTRACT

Driven by the rapid development of Large Language Models (LLMs), LLM-based agents have been developed to handle various real-world applications, including finance, healthcare, and shopping, etc. It is crucial to ensure the reliability and security of LLM-based agents during applications. However, the safety issues of LLM-based agents are currently under-explored. In this work, we take the first step to investigate one of the typical safety threats, backdoor attack, to LLM-based agents. We first formulate a general framework of agent backdoor attacks, then we present a thorough analysis of different forms of agent backdoor attacks. Specifically, compared with traditional backdoor attacks on LLMs that are only able to manipulate the user inputs and model outputs, agent backdoor attacks exhibit more diverse and covert forms: (1) From the perspective of the final attacking outcomes, the agent backdoor attacker can not only choose to manipulate the final output distribution, but also introduce the malicious behavior in an intermediate reasoning step only, while keeping the final output correct. (2) Furthermore, the former category can be divided into two subcategories based on trigger locations, in which the backdoor trigger can either be hidden in the user query or appear in an intermediate observation returned by the external environment. We implement the above variations of agent backdoor attacks on two typical agent tasks including web shopping and tool utilization. Extensive experiments show that LLM-based agents suffer severely from backdoor attacks and such backdoor vulnerability cannot be easily mitigated by current textual backdoor defense algorithms. This indicates an urgent need for further research on the development of targeted defenses against backdoor attacks on LLM-based agents. Warning: This paper may contain biased content.

Motivation & Objective

  • Motivate safety concerns for LLM-based agents deployed in real-world tasks.
  • Propose a general framework for agent backdoor attacks within the ReAct paradigm.
  • Characterize attack forms by final output manipulation vs. malicious intermediate reasoning.
  • Demonstrate data-poisoning techniques to implement Query-Attack, Observation-Attack, and Thought-Attack.
  • Provide empirical evidence of vulnerability across benchmark tasks and tools.

Proposed method

  • Formulate agent backdoor attacks using the ReAct framework as the baseline.
  • Define two main attacking outcomes: manipulating final output distribution or malicious intermediate reasoning (Thought-Attack).
  • Further split final-output attacks into Query-Attack (trigger in user query) and Observation-Attack (trigger in environment observation).
  • Develop data-poisoning mechanisms to realize each attack variant on AgentInstruct and ToolBench datasets.
  • Evaluate backdoor effectiveness via attack success rate (ASR) and task performance metrics across multiple tasks and settings.
  • Show that increasing poisoned data strengthens backdoor effectiveness while potentially degrading benign task performance.
Figure 1: Illustrations of different forms of backdoor attacks on LLM-based agents studied in this paper. We choose a query from a web shopping (Yao et al., 2022 ) scenario as an example. Both Query-Attack and Observation-Attack aim to modify the final output distribution, but the trigger “sneakers”
Figure 1: Illustrations of different forms of backdoor attacks on LLM-based agents studied in this paper. We choose a query from a web shopping (Yao et al., 2022 ) scenario as an example. Both Query-Attack and Observation-Attack aim to modify the final output distribution, but the trigger “sneakers”

Experimental results

Research questions

  • RQ1Can backdoor triggers be embedded in user queries or environment observations to alter LLM-based agent behavior?
  • RQ2How do backdoor attacks differ when targeting final outputs versus intermediate reasoning within agent pipelines?
  • RQ3What is the impact of backdoor poisoning on agent performance across multiple tasks and tool-usage scenarios?
  • RQ4Is it feasible to control intermediate reasoning traces (Thought-Attack) while keeping final outputs correct?
  • RQ5How do backdoor forms perform under realistic benchmarks like AgentInstruct and ToolBench?

Key findings

  • Backdoor attacks drastically increase attack success rates as poisoned data increases (ASR > 80% with 30+ poisoned samples in Query-Attack).
  • Observation-Attack achieves high ASR with triggers in observations, though slightly lower than query-based triggers due to harder trigger capture.
  • Thought-Attack demonstrates that manipulating internal reasoning (e.g., tool calls) can guide behavior without changing the final output, indicating a more concealed threat.
  • Backdoored agents show degraded rewards on target tasks (WS Target) compared to clean models, reflecting suboptimal outcomes under backdoor influence.
  • Query-Attack and Observation-Attack can undermine normal performance on held-in tasks (WS Clean) due to distribution shifts from poisoned traces.
  • Thought-Attack confirms the feasibility of steering tool usage (e.g., always calling Translate_v3) in translation tasks with controlled poisoning ratios.
Figure 2: Case study on Query-Attack. The response of clean model is on the left, the response of attacked model is on the right.
Figure 2: Case study on Query-Attack. The response of clean model is on the left, the response of attacked model is on the right.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.