Introduction
As Large Language Model (LLM) agents transition from passive chat interfaces to autonomous tools capable of web browsing and email management, they encounter a significant security threat: indirect prompt injection. This vulnerability occurs when an agent processes external content—such as a webpage or an email—that contains malicious instructions designed to hijack the agent's behavior. For instance, a hidden command in an email might instruct an agent to "forward all private data to an external server" while the agent is ostensibly performing a benign summarization task.
Traditional defense mechanisms rely on fine-tuning agents against static datasets of known attacks. However, these datasets often fail to capture the diversity and creativity of evolving exploits. This paper introduces ARLAS (Adversarial Reinforcement Learning for Agent Safety), a framework that automates the discovery of vulnerabilities and the hardening of agents through a co-evolutionary training process.
The ARLAS Framework
ARLAS conceptualizes LLM security as a two-player zero-sum Markov game. The framework co-trains two competing models:
- The Attacker ($\pi_{atk}$): Optimized to generate diverse, deceptive instructions within the agent's environment to trigger data leakage or task failure.
- The Agent ($\pi_{agt}$): Optimized to successfully complete its primary objective (e.g., booking a flight) while identifying and ignoring malicious injections.
Technical Innovations
To ensure robust learning and prevent common pitfalls in adversarial training, ARLAS incorporates several key techniques:
- Population-Based Training (PBT): A common issue in adversarial RL is "cyclic learning," where an agent optimizes against the current attacker but becomes vulnerable to older strategies. ARLAS mitigates this by training the agent against a population of all previous attacker checkpoints, ensuring cumulative robustness.
- Group Relative Policy Optimization (GRPO): The framework utilizes GRPO for efficient model updates. By calculating rewards relative to a group of outputs, GRPO eliminates the need for a separate, compute-intensive critic model, facilitating the training of larger agent models.
- Imitation Learning Warm-up: To overcome the "cold start" problem in reinforcement learning, models undergo initial Supervised Fine-Tuning (SFT) using high-quality trajectories generated by larger teacher models (e.g., Gemma-3-27B).
Experimental Evaluation
The researchers evaluated ARLAS using two benchmarks: BrowserGym, augmented with synthetic private user information to measure data leakage, and AgentDojo, a specialized safety benchmark for tool-calling scenarios. The primary models tested were Gemma3 12B and Qwen3 14B.
Key Results
The experimental results demonstrate that ARLAS significantly enhances agent robustness without compromising utility.
As shown in the Attack Success Rate (ASR) heatmap, ARLAS-trained agents consistently achieve lower ASRs compared to base models and those trained with standard automated red-teaming (ART) or SPAG (an iterative adversarial RL method). Notably, ARLAS agents maintained high safety levels even when tested on the out-of-distribution AgentDojo benchmark, indicating strong generalization capabilities.
Furthermore, the study found that safety and utility are not mutually exclusive. ARLAS agents often exhibited increased task success rates. By learning to distinguish between legitimate tool outputs and malicious noise, the agents became more focused and effective at their primary tasks.
Discussion and Future Work
The co-evolutionary nature of ARLAS creates a natural "curriculum" of difficulty. As the agent becomes more robust, the attacker is forced to find increasingly subtle and complex ways to deceive it. Analysis using UMAP projections confirmed that attacker strategies become more diverse over time, covering a broader area of the embedding space.
Despite these successes, limitations remain. The current study focused on models up to 14B parameters; future work should explore scaling to frontier-level models (70B+). Additionally, as agents increasingly utilize Vision-Language Models (VLMs), extending ARLAS to address visual prompt injections—where malicious instructions are hidden within images—is a critical next step. Finally, addressing reward sparsity in long, multi-turn tasks remains a challenge for future reinforcement learning research in this domain.
Summary updated