AgentAntibody: An Adaptive Immune System for Defending LLM Agents against Prompt Injection
Shihao Weng, Yang Feng, Xiaofei Xie, Jiongchi Yu
cs.CR, cs.AI
Submitted: 2026-08-04
Comments: 7 pages
License: http://creativecommons.org/licenses/by/4.0/
The gist: Prompt injection remains a critical threat to LLM agents, yet existing defenses treat each task as a self-contained problem, independent of previous encounters.
Terminology
Abstract
Prompt injection remains a critical threat to LLM agents, yet existing defenses treat each task as a self-contained problem, independent of previous encounters. In practice, user requests are often underspecified: they describe the desired outcome without fully specifying acceptable behavior. An injection can exploit this ambiguity, causing the agent to complete the task in a way the user would reject. As the user's expectations become clearer through concrete cases, a defense should learn from each encounter and apply what it learns to the next. Inspired by adaptive immunity, we propose AgentAntibody, which equips LLM agents with a self-evolving immune system against prompt injection. AgentAntibody represents its evolving understanding of the user's security boundary as a persistent library of antibodies. At runtime, the library recognizes threats to this boundary and mounts corresponding immune responses. Across encounters, it evolves to strengthen the agent's immunity to future attacks. Extensive experiments across three benchmarks and four backbone LLMs show that, by learning the user's boundary through experience, AgentAntibody outperforms existing defenses in preventing harmful actions while preserving legitimate task completion, even when the harmful and legitimate actions are both compatible with the stated task.
Sources
- AI Agents May Always Fall for Prompt Injections
- WARD: Adversarially Robust Defense of Web Agents Against Prompt Injections
- SecAlign: Defending Against Prompt Injection with Preference Optimization
- From Untrusted Input to Trusted Memory: A Systematic Study of Memory Poisoning Attacks in LLM Agents
- Defeating Prompt Injections by Design
- Bad Memory: Evaluating Prompt Injection Risks from Memory in Agentic Systems
- AttriGuard: Defeating Indirect Prompt Injection in LLM Agents via Causal Attribution of Tool Invocations
- Defending Against Indirect Prompt Injection Attacks With Spotlighting
- Learning the Difference that Makes a Difference with Counterfactually-Augmented Data
- AgentDyn: Are Your Agent Security Defenses Deployable in Real-World Dynamic Environments?
- Formalizing and Benchmarking Prompt Injection Attacks and Defenses
- ASPI: Seeking Ambiguity Clarification Amplifies Prompt Injection Vulnerability in LLM Agents
- The Instruction Hierarchy: Training LLMs to Prioritize Privileged Instructions
- The Landscape of Prompt Injection Threats in LLM Agents: From Taxonomy to Analysis
- Defending against Indirect Prompt Injection by Instruction Detection
- ARGUS: Defending LLM Agents Against Context-Aware Prompt Injection
- Architecting Secure AI Agents: Perspectives on System-Level Defenses Against Indirect Prompt Injection Attacks
- RoboJailBench: Benchmarking Adversarial Attacks and Defenses in Embodied Robotic Agents
- MELON: Provable Defense Against Indirect Prompt Injection Attacks in AI Agents
Related papers
- SoK: AI-Augmented Binary Reversing
- Relaxed Sender Anonymity for CBDC Interbank Settlement: A Zero-Knowledge Approach on Permissioned EVM
- Calibration-Family Overfit: Why Trusted Sabotage Monitors Don't Transfer Across Lineages
- Estimating the Social Cost of Corporate Data Breaches
- Efficient Fuzzy PSI under One-Sided Assumptions
- Sealing the Audit-Runtime Gap for LLM Skills