AdvSim2Real: Training Web Agents Against Adaptive Prompt Injection in a Web World Model
cs.CL, cs.AI, cs.LG
Submitted: 2026-10-06
Updated: 2026-10-06
Comments: Code at https://github.com/Sarim-MBZUAI/advsim2real
License: http://creativecommons.org/licenses/by/4.0/
The gist: Web agents complete user requests by reading and acting on pages that third parties write, so an instruction planted on a page can redirect the agent away from the user's goal.
Terminology
Abstract
Web agents complete user requests by reading and acting on pages that third parties write, so an instruction planted on a page can redirect the agent away from the user's goal. The agent cannot simply ignore the page, because the page also holds the values and controls the task requires. Current defenses fine-tune the agent on injections fixed before training, and attackers that adapt to the trained model bypass them. Adversarial training lets the attacker adapt but keeps the tasks fixed, so a task stops teaching once the agent solves it. We introduce AdvSim2Real, which co-evolves a task curriculum, an injection adversary, and the agent inside a frozen web world model. The curriculum is rewarded for tasks the agent solves about half of the time, and the adversary only for a success flip, an injection that turns a judged success into a failure. Training in the simulator makes a 4B agent both more capable and more robust: its completion rises with and without attacks, holds against a frontier-model adversary it never trained against, and its capability gain carries over to a real browser. On 150 web tasks, AdvSim2Real raises completion under this unseen adversary by 33.6% relative to the base agent.
Sources
- WARD: Adversarially Robust Defense of Web Agents Against Prompt Injections
- Web Agents with World Models: Learning and Leveraging Environment Dynamics in Web Navigation
- SecAlign: Defending Against Prompt Injection with Preference Optimization
- Meta-SecAlign: Training LLMs against Prompt Injection for Robust Agents
- Learning to Inject: Automated Prompt Injection via Reinforcement Learning
- DynaWeb: Model-Based Reinforcement Learning of Web Agents
- WASP: Benchmarking Web Agent Security Against Prompt Injection Attacks
- Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection
- Is Your LLM Secretly a World Model of the Internet? Model-Based Planning for Web Agents
- GenEnv: Difficulty-Aligned Co-Evolution Between LLM Agents and Environment Simulators
- World Models
- Defending against Adaptive Prompt Injection Attacks via Reasoning-enabled Task Alignment
- AgentGen: Enhancing Planning Abilities for Large Language Model based Agent via Environment and Task Generation
- AgentDyn: Are Your Agent Security Defenses Deployable in Real-World Dynamic Environments?
- Dual-Modality Multi-Stage Adversarial Safety Training: Robustifying Multimodal Web Agents Against Cross-Modal Attacks
- Chasing Moving Targets with Online Self-Play Reinforcement Learning for Safer Language Models
- ToolHazard: Scaling Adversarial Environments for Security Evaluation and Alignment of LLM-based Agents
- DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models
- Lessons from Defending Gemini Against Indirect Prompt Injections
- Optimization-based Prompt Injection Attack to LLM-as-a-Judge
Related papers
- Exploring Solution Divergence and Its Effect on Large Language Model Problem Solving
- Ishigaki-IDS-Bench: A Benchmark for Generating Information Delivery Specification from BIM Information Requirements
- Subliminal Steering: Stronger Encoding of Hidden Signals
- MedStruct-S: A Benchmark for Key Discovery, Key-Conditioned QA and Semi-Structured Extraction from OCR Clinical Reports
- The End of Transformers? On Challenging Attention and the Rise of Sub-Quadratic Architectures
- Untangling the Mechanisms of Misleading Context in Medical Question Answering