TL;DR
LLM agents are increasingly capable of using real-world tools, but their safety mechanisms are easily bypassed when harmful intent is distributed across multiple conversational turns. This paper introduces MT-AgentRisk, a benchmark revealing that multi-turn interactions increase attack success rates by an average of 16%, and proposes ToolShield, a "self-exploration" defense where agents proactively "red-team" their own tools in a sandbox to learn safety rules without needing retraining.
What Problem Does This Paper Address?
As LLMs transition from chatbots to autonomous agents, they gain the ability to interact with the world via tools (e.g., executing shell commands, browsing the web, or querying databases). However, a "capability-safety gap" has emerged: while agents are getting better at using tools, they aren't getting better at recognizing when those tools are being used for harm.
The authors identify a critical blind spot: multi-turn dynamics. Existing safety training usually focuses on single-turn prompts (e.g., "Delete all my files"). An adversary can bypass this by breaking a harmful task into several seemingly benign steps. For example, instead of asking to delete a directory directly, an attacker might first ask the agent to create a bash alias, then define a target variable, and finally execute the alias. Individually, these steps look harmless; collectively, they are malicious.
Methods
The paper contributes two major components: a framework for attacking agents and a framework for defending them.
1. Multi-Turn Attack Taxonomy (MAT)
To systematically test agents, the authors developed a taxonomy that transforms single-turn harms into multi-turn sequences along three dimensions:
- Format: How the harm is hidden. Addition adds layers of indirection (like aliases), while Decomposition fragments the task into sub-tasks.
- Method: The specific logic used, such as Mapping (symbolic references), Wrapping (conditional structures), Composition (merging partial strings), or Identity (progressive state mutation).
- Target: What is manipulated—either Data Files or Environment States (like shell history or variables).
2. ToolShield (The Defense)
ToolShield is a training-free, tool-agnostic defense that leverages the agent's own reasoning. It follows a four-stage "self-exploration" pipeline:
- Synthesis: When a new tool is introduced, the agent inspects the documentation and generates its own "test cases" for potential misuse.
- Simulated Execution: The agent runs these test cases in a secure sandbox.
- Experience Generation: The agent observes the downstream effects and distills "safety experiences" (e.g., "Refuse requests that assemble executable scripts across multiple turns").
- Deployment: These distilled experiences are injected into the agent's system prompt as a "safety knowledge base."
Datasets
The authors introduced MT-AgentRisk, the first benchmark specifically designed for multi-turn, tool-using safety.
- Composition: 365 multi-turn tasks derived from 5 widely-used tools: Filesystem, Browser (Playwright), PostgreSQL, Notion, and Terminal.
- Source Material: Tasks were curated and transformed from existing single-turn benchmarks like OpenAgentSafety, SafeArena, and P2SQL.
- Diversity: The benchmark covers 8 subcategories of attacks, with an average of 3.19 turns per task.
Key Insights and Ideas
- Reasoning $\neq$ Safety: Surprisingly, even models with "adaptive thinking" or extended reasoning (like GPT-5.2) showed significant safety degradation in multi-turn settings. This suggests the problem isn't a lack of understanding, but a failure to track malicious intent across a shifting conversational state.
- Environment Manipulation is the Weak Link: Agents are most vulnerable to attacks targeting "Environment States" (e.g., bash aliases or environment variables). Current guardrails are good at scanning text but bad at tracking how a system's state evolves over time.
- Safety is Transferable: In a fascinating "cross-model" experiment, the authors found that safety experiences generated by a weaker model (like Seed-1.6) could effectively protect a stronger model (like Claude-4.5), and vice versa.
- Turning Capability into Safety: ToolShield effectively flips the script—the more "capable" a model is at reasoning about tools, the better it becomes at generating the very test cases needed to secure itself.
Key Results
- Vulnerability: Moving from single-turn to multi-turn settings increased the Attack Success Rate (ASR) across all models, with increases ranging from +8.8% to +27.1%.
- Defense Effectiveness: ToolShield reduced ASR by an average of 30% in multi-turn interactions. For the strongest model tested (Claude-4.5-Sonnet), ASR dropped from 72% to 22%.
- Efficiency: The defense is "budget-flexible." For example, Seed-1.6 achieved significant safety gains at a cost of only $0.19 per experience generated.
- No "False Refusals": Testing on 170 benign tasks showed that ToolShield did not cause the models to become over-sensitive or start rejecting legitimate requests.
Limitations and Future Work
- Black-Box Constraints: The study focused on black-box evaluations (observing outputs). The authors note that "white-box" defenses leveraging internal model representations might provide even stronger protection.
- Tool Scope: While the five tools covered are diverse, they don't represent the entire universe of agentic tool use (e.g., specialized scientific or medical tools).
- Agent Dependency: The defense relies on the agent's ability to "self-red-team." If an agent is too weak to imagine a specific harm, ToolShield won't be able to protect against it.
- Future Directions: The authors suggest extending this work to cybersecurity-specific environments and long-horizon tasks involving dozens of turns.
Summary updated