LLM agents with tools are vulnerable to indirect prompt injections; timing and placement affect attack success
ToolHazard can automatically generate adversarial environments that expose substantial LLM agent vulnerabilities and its generated alignment data improves agent security
AI/ML arXiv 12 Aug 2026 Benchmark Prototype evidence
Published as “ToolHazard: Scaling Adversarial Environments for Security Evaluation and Alignment of LLM-based Agents”
Why it matters
The framework enables scalable stress-testing of tool-augmented agents and provides training data that can measurably harden them against a class of indirect prompt injection attacks.
Summary
ToolHazard shows that LLM agents are highly vulnerable to environment-side prompt injection, with attack success rates up to 67% on GPT-5. Experiments on 87 long-horizon tasks across 28 synthesized environments (512 tools, avg. 15.56 steps) reveal that earlier injection points and placement near the end of observations increase attack effectiveness. The evidence is based on systematic evaluation of seven models against six automatically generated injection strategies, compared to prior benchmarks, and includes a modest improvement in robustness after adversarial alignment training.
What they found 2
- LLM agents remain highly vulnerable to indirect environmental prompt injection.
“LLMs remain highly vulnerable to environmental prompt injection. Nearly all evaluated models exhibit high ASR in adversarial environments.”
- Earlier injection timing leads to higher attack success.
“earlier injections consistently yield higher ASR, indicating that attacks are more effective when triggered at early steps.”
Caveats 3
- DeepSeekV3.2 attains the highest benign task success rate but is also the most vulnerable to attacks, whereas Qwen3-4B is less affected due to weaker instruction-following ability, suggesting stronger models may be more susceptible to environmental prompt injection.
- Realism of synthesized environments. A gap inevitably remains between synthesized evaluation environments and real-world enterprise systems.
- Coverage of attack strategies. ToolHazard currently considers six predefined prompt-injection strategies and does not automatically discover attack strategies.
What’s new here 4
- Automates synthesis of executable, stateful tool-interactive environments from seed task datasets.
- Automatically discovers viable injection points and plans environment-specific payloads without predefined locations.
- Generates a large-scale benchmark (ToolHazard-Bench) with 87 tasks and 512 tools, exceeding prior agent security benchmarks in workflow complexity.
- Provides adversarial alignment data (ToolHazard-Align) for supervised fine-tuning and reinforcement learning to improve agent robustness.