Watch Out for Your Agents! Investigating Backdoor Threats to LLM-Based Agents

Wenkai Yang, Xiaohan Bi, Yankai Lin, Sishuo Chen, Jie Zhou, Xu Sun

arXiv:2402.11208 · 2026-07-27 공개 · arXiv · PDF

malicious-behavior llm-based-agents backdoor-attacks agent-security web-shopping external-environment tool-utilization defense-algorithms

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.

한국어 요약

한 줄 요약

LLM 기반 에이전트에 대한 백도어 공격의 다양한 형태와 취약성을 분석하고, 기존 방어법의 한계를 밝힌 연구.

핵심 기여도

핵심 아이디어

LLM 기반 에이전트는 사용자 입력뿐만 아니라 중간 추론 과정과 외부 환경과의 상호작용을 통해 최종 출력을 생성하기 때문에, 기존 LLM에 대한 백도어 공격과는 구조적으로 다른 위협을 받는다. 본 연구는 ReAct 프레임워크를 기반으로 에이전트 백도어 공격을 수학적으로 정의하고, 공격의 최종 결과에 따라 두 가지 주요 범주로 분류한다. 첫 번째는 최종 출력 분포를 조작하는 공격이며, 두 번째는 최종 출력은 정상이지만 중간 추론 과정에 악성 행동을 삽입하는 Thought-Attack이다. 특히, 후자의 공격은 최종 출력에 변화가 없기 때문에 감지가 어려운 새로운 위협 형태로 제시된다.

기술적 접근법

주요 결과

의의 및 한계

본 연구는 LLM 기반 에이전트의 보안 취약성을 체계적으로 분석한 최초의 연구로, 백도어 공격의 새로운 형태를 제시하고, 기존 방어법의 한계를 밝히는 데 기여한다. 특히, Thought-Attack은 최종 출력에 변화 없이 중간 추론 과정만 조작하는 형태로, 감지가 어려운 새로운 위협으로 제시된다. 그러나 본 연구는 공격 실험에만 초점을 맞추고 방어 기법 개발은 제한적으로 다루었으며, 실제 산업 환경에서의 적용 가능성은 추가 연구가 필요하다.

실용적 활용

본 연구는 금융, 헬스케어, 쇼핑 등 LLM 기반 에이전트가 활용되는 분야에서 보안 위협을 인식하고 방어 전략을 수립하는 데 기초 자료로 활용될 수 있다. 특히, 사용자 입력과 외부 환경 모두에서 트리거가 삽입될 수 있는 점을 고려한 보안 모니터링 시스템 개발에 기여할 수 있다.