Your Agent Can Defend Itself against Backdoor Attacks

Li Changjiang, Liang Jiacheng, Cao Bochuan, Chen Jinghui, Wang Ting
6/10/2025
cs.CRcs.AIcs.LG

No confident code implementation found for this paper.

Abstract

Despite their growing adoption across domains, large language model (LLM)-powered agents face significant security risks from backdoor attacks during training and fine-tuning. These compromised agents can subsequently be manipulated to execute malicious operations when presented with specific triggers in their inputs or environments.

Show full abstract

To address this pressing risk, we present ReAgent, a novel defense against a range of backdoor attacks on LLM-based agents. Intuitively, backdoor attacks often result in inconsistencies among the user's instruction, the agent's planning, and its execution. Drawing on this insight, ReAgent employs a two-level approach to detect potential backdoors. At the execution level, ReAgent verifies consistency between the agent's thoughts and actions; at the planning level, ReAgent leverages the agent's capability to reconstruct the instruction based on its thought trajectory, checking for consistency between the reconstructed instruction and the user's instruction. Extensive evaluation demonstrates ReAgent's effectiveness against various backdoor attacks across tasks. For instance, ReAgent reduces the attack success rate by up to 90\% in database operation tasks, outperforming existing defenses by large margins. This work reveals the potential of utilizing compromised agents themselves to mitigate backdoor risks.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{changjiang2025your,
  title  = {Your Agent Can Defend Itself against Backdoor Attacks},
  author = {Li Changjiang and Liang Jiacheng and Cao Bochuan and Chen Jinghui and Wang Ting},
  year   = {2025},
  eprint = {2506.08336},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2506.08336v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2506.08336.svg)](https://codeofpaper.com/paper/2506.08336)

Discussion