Here is a blog-style summary of the paper.
TL;DR
Current security benchmarks for LLM agents are too static and simplistic, creating a false sense of security for prompt injection defenses. The authors introduce AgentDyn, a new dynamic benchmark that reveals existing defenses either fail to stop attacks or severely cripple an agent's real-world utility through "over-defense."
What Problem Does This Paper Address?
AI agents are increasingly used to automate complex workflows by interacting with external tools, APIs, and environments. However, this autonomy leaves them highly vulnerable to indirect prompt injection attacks, where malicious instructions are hidden inside third-party data (like an email or a webpage) to hijack the agent's behavior.
While many defenses have been proposed and validated on existing benchmarks, the authors argue that these evaluations suffer from three critical flaws:
- Lack of Dynamic Tasks: Most benchmarks feature static tasks that can be fully planned upfront. In the real world, agents must dynamically adapt their plans based on environmental feedback (e.g., handling a one-time password).
- Lack of Helpful Instructions: Real-world external data often contains benign, necessary instructions (e.g., "Please log in first"). Current benchmarks only contain malicious text, allowing defenses to cheat by simply blocking all external text.
- Simplistic User Tasks: Existing benchmarks evaluate short trajectories (1–3 steps) with very few tools, failing to reflect the complexity of production deployments.
Methods
To bridge this gap, the authors developed AgentDyn, an open-ended sandbox environment designed to evaluate prompt injection defenses under realistic, dynamic conditions.
Unlike traditional static benchmarks, AgentDyn enforces:
- Dynamic Planning: Tasks require real-time strategy adjustments based on tool outputs.
- Helpful Instructions: Benign third-party prompts are embedded along the critical execution path, forcing the defense to distinguish friend from foe.
- Task Complexity: Workflows span longer horizons and require coordination across multiple applications.
The authors used AgentDyn to comprehensively evaluate 12 prevalent LLM agents and 10 state-of-the-art defense mechanisms across four categories: prompting-based, filtering-based, alignment-based, and system-level defenses.
Datasets
The paper introduces the AgentDyn benchmark, which consists of three distinct suites covering seven application scenarios: Shopping, GitHub, and Daily Life.
Compared to older benchmarks, AgentDyn significantly ups the ante in complexity: Table 1: Average Statistics per User Task in the Agent Security Benchmark.
By taking the cross-product of 60 curated open-ended user tasks and 28 injection tasks, the authors generated 560 security test cases. A detailed breakdown of the environment suites is shown below: Table 2: Overview of AgentDyn.
Key Insights and Ideas
- The "Static Shortcut" Illusion: In static benchmarks, system-level defenses can appear highly secure by forcing the agent to strictly adhere to its initial plan. On AgentDyn, this rigid approach completely breaks down because legitimate actions only become apparent after interacting with the environment.
- The Over-Defense Trap: Filtering-based defenses achieve near-zero Attack Success Rates (ASR) by blindly flagging any external instruction. However, because real-world tasks require processing benign external text, these defenses completely destroy the agent's utility.
- Complexity Breeds Vulnerability: As the toolset and trajectory length scale up, defenses like Progent struggle to maintain accurate tool access policies, leading to cascading failures over long execution paths.
Key Results
The evaluation on AgentDyn paints a sobering picture of the current state of LLM agent security:
- Low Security: Prompting defenses (like Prompt Sandwich and Spotlighting) maintain decent utility but fail to secure the agent, leaving an ASR of 27%–31% on GPT-4o.
- Severe Over-Defense: Filtering and system-level defenses crush the agent's functionality. For instance, ProtectAI and CaMeL dropped the agent's utility under attack to practically 0%.
- The Best Compromise: Alignment-based defense (Meta SecAlign-70B) achieved the best balance, maintaining a utility of 53.35% under attack while keeping the ASR down to 8.98%.
A complete breakdown of how these defenses perform across different base models can be seen in the main evaluation table: Table 3: Evaluation of different defense methods across base models on AgentDyn. (%)
Limitations and Future Work
The authors note that the prompt injection attacks used in this benchmark are relatively standard template-based attacks (e.g., "Important Instructions"). While these attacks successfully exposed the flaws in current defenses, they are relatively weak against the latest frontier models. The authors emphasize that developing stronger, more realistic, and adaptive attack frameworks is a crucial next step for the research community. Furthermore, because AgentDyn is open-ended, it can be dynamically extended to include these advanced attacks as they emerge.
Summary updated