BadAgent: Inserting and Activating Backdoor Attacks in LLM Agents

Yifei Wang, Dizhan Xue, Shengjie Zhang, Shengsheng Qian

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

llm-agents fine-tuning adversarial-attacks llm-fine-tuning backdoor-attacks external-tools security-risk trigger-insertion

Abstract

With the prosperity of large language models (LLMs), powerful LLM-based intelligent agents have been developed to provide customized services with a set of user-defined tools. State-of-the-art methods for constructing LLM agents adopt trained LLMs and further fine-tune them on data for the agent task. However, we show that such methods are vulnerable to our proposed backdoor attacks named BadAgent on various agent tasks, where a backdoor can be embedded by fine-tuning on the backdoor data. At test time, the attacker can manipulate the deployed LLM agents to execute harmful operations by showing the trigger in the agent input or environment. To our surprise, our proposed attack methods are extremely robust even after fine-tuning on trustworthy data. Though backdoor attacks have been studied extensively in natural language processing, to the best of our knowledge, we could be the first to study them on LLM agents that are more dangerous due to the permission to use external tools. Our work demonstrates the clear risk of constructing LLM agents based on untrusted LLMs or data. Our code is public at https://github.com/DPamK/BadAgent

한국어 요약

한 줄 요약

BadAgent는 LLM 에이전트에 백도어 공격을 삽입하고 활성화하는 새로운 공격 방식으로, 85% 이상의 공격 성공률을 보인다.

핵심 기여도

핵심 아이디어

BadAgent는 LLM 에이전트가 외부 도구를 사용할 수 있는 권한을 악용하여, 훈련 단계에서 백도어를 삽입하고 테스트 시 특정 트리거로 공격을 활성화하는 새로운 공격 방식이다. 이는 기존의 LLM 백도어 공격이 주로 텍스트 생성에 초점을 맞춘 것과 달리, 에이전트가 실제 행동(예: 파일 삭제, 악성 코드 실행)을 유도하는 ACTION-level 공격이다. Active Attack은 사용자 입력에 숨겨진 트리거를 삽입해 공격을 유발하는 반면, Passive Attack은 환경(예: 웹사이트)에 트리거를 숨겨 에이전트가 자동으로 공격을 수행하도록 유도한다. 이는 공격 범위를 텍스트 입력뿐만 아니라 환경 정보까지 확장한다.

기술적 접근법

주요 결과

의의 및 한계

BadAgent는 LLM 에이전트가 외부 도구 사용 권한을 가진 점을 악용한 첫 번째 백도어 공격 연구로, LLM 에이전트의 보안 취약성을 명확히 드러낸다. 특히, ACTION-level 공격은 기존의 CONTENT-level 공격과 달리, 텍스트 생성 이상의 실제 행동을 유도할 수 있어 더 큰 위험성을 가진다. 그러나 본 연구는 공격 방식에 대한 분석에 초점을 맞춘 반면, 방어 전략에 대한 구체적인 제안은 제한적이다. 또한, 공격이 실제 산업 환경에서 얼마나 자주 발생할 수 있는지에 대한 평가도 부재하다.

실용적 활용

BadAgent는 자동 쇼핑 에이전트, 서버 관리 에이전트, 자동화된 고객 지원 시스템 등 외부 도구를 사용하는 LLM 에이전트가 배포되는 모든 산업 분야에서 보안 위험을 드러낸다. 따라서, LLM 에이전트를 사용하는 기업은 백도어 탐지 및 제거 기술, 입력 이상 탐지 시스템, 파라미터 수준의 정화 기법 등을 도입해 보안을 강화해야 한다.