arXiv:2510.05442cs.LGcs.AI2025-10被引 13

用对抗强化学习训练大模型智能体,自动防御隐藏在工具输出中的恶意指令。

Adversarial Reinforcement Learning for Large Language Model Agent Safety

  • 构建攻防双模型,通过零和博弈自动生成多样化攻击
  • 在浏览器环境测试中,攻击成功率显著降低,任务完成率提升
  • 适合关注大模型安全、对抗训练与智能体防御的研究者

大型语言模型(LLM)智能体可通过Google Search等工具完成复杂任务,但工具使用可能引入间接提示注入风险:恶意指令隐藏在工具输出中,可操控智能体,导致数据泄露等安全问题。现有防御方法依赖人工构造的已知攻击数据集进行微调,缺乏多样性,难以应对新型攻击。为此,本文提出对抗强化学习框架ARLAS,将攻防过程建模为两玩家零和博弈,协同训练一个生成多样提示注入的攻击者和一个需完成任务同时防御攻击的智能体。采用基于种群的学习机制,使智能体持续对抗历史所有攻击者检查点,增强鲁棒性。在BrowserGym和AgentDojo上评估显示,经ARLAS微调的智能体攻击成功率显著低于原模型,同时任务成功率更高。分析表明,该对抗过程能生成多样且具挑战性的攻击样本,使智能体比基线模型更健壮。

原文摘要 · Abstract (English)

Large Language Model (LLM) agents can leverage tools such as Google Search to complete complex tasks. However, this tool usage introduces the risk of indirect prompt injections, where malicious instructions hidden in tool outputs can manipulate the agent, posing security risks like data leakage. Current defense strategies typically rely on fine-tuning LLM agents on datasets of known attacks. However, the generation of these datasets relies on manually crafted attack patterns, which limits their diversity and leaves agents vulnerable to novel prompt injections. To address this limitation, we propose Adversarial Reinforcement Learning for Agent Safety (ARLAS), a novel framework that leverages adversarial reinforcement learning (RL) by formulating the problem as a two-player zero-sum game. ARLAS co-trains two LLMs: an attacker that learns to autonomously generate diverse prompt injections and an agent that learns to defend against them while completing its assigned tasks. To ensure robustness against a wide range of attacks and to prevent cyclic learning, we employ a population-based learning framework that trains the agent to defend against all previous attacker checkpoints. Evaluated on BrowserGym and AgentDojo, agents fine-tuned with ARLAS achieve a significantly lower attack success rate than the original model while also improving their task success rate. Our analysis further confirms that the adversarial process generates a diverse and challenging set of attacks, leading to a more robust agent compared to the base model.

大模型安全对抗训练智能体防御

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。