arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2603.03205cs.CL
收藏

学习何时行动或拒绝:为安全的多步骤工具使用守护代理推理模型

Learning When to Act or Refuse: Guarding Agentic Reasoning Models for Safe Multi-Step Tool Use

Microsoft Research(微软研究院)

Aradhye Agarwal, Gurdit Siyan, Yash Pandya, Joykirat Singh, Akshay Nambi, Ahmed Awadallah

AI总结:

提出MOSAIC框架,通过显式安全推理和基于偏好的强化学习,使代理模型在工具使用中安全决策,减少有害行为并保持良性性能。

摘要:

代理语言模型在安全机制上与聊天模型根本不同:它们必须规划、调用工具并执行长期行动,其中单个失误(如访问文件或输入凭据)可能导致不可逆的伤害。现有的对齐方法主要针对静态生成和任务完成进行优化,由于顺序决策、对抗性工具反馈和过度自信的中间推理,在这些设置中失效。我们引入了MOSAIC,一个后训练框架,通过使安全决策显式且可学习,对齐代理以实现安全的多步骤工具使用。MOSAIC将推理构建为规划、检查、然后行动或拒绝的循环,将显式安全推理和拒绝作为第一类行动。为了在没有轨迹级标签的情况下进行训练,我们使用基于偏好的强化学习与成对轨迹比较,这捕获了标量奖励常常忽略的安全区别。我们在三个模型家族(Qwen2.5-7B、Qwen3-4B-Thinking和Phi-4)以及跨分布基准(涵盖有害任务、提示注入、良性工具使用和跨域隐私泄露)上评估了MOSAIC的零样本性能。MOSAIC将有害行为减少高达50%,在注入攻击上将有害任务拒绝率提高超过20%,减少隐私泄露,并保持或改善良性任务性能,展示了跨模型、领域和代理设置的鲁棒泛化能力。

英文摘要:

Agentic language models operate in a fundamentally different safety regime than chat models: they must plan, call tools, and execute long-horizon actions where a single misstep, such as accessing files or entering credentials, can cause irreversible harm. Existing alignment methods, largely optimized for static generation and task completion, break down in these settings due to sequential decision-making, adversarial tool feedback, and overconfident intermediate reasoning. We introduce MOSAIC, a post-training framework that aligns agents for safe multi-step tool use by making safety decisions explicit and learnable. MOSAIC structures inference as a plan, check, then act or refuse loop, with explicit safety reasoning and refusal as first-class actions. To train without trajectory-level labels, we use preference-based reinforcement learning with pairwise trajectory comparisons, which captures safety distinctions often missed by scalar rewards. We evaluate MOSAIC zero-shot across three model families, Qwen2.5-7B, Qwen3-4B-Thinking, and Phi-4, and across out-of-distribution benchmarks spanning harmful tasks, prompt injection, benign tool use, and cross-domain privacy leakage. MOSAIC reduces harmful behavior by up to 50%, increases harmful-task refusal by over 20% on injection attacks, cuts privacy leakage, and preserves or improves benign task performance, demonstrating robust generalization across models, domains, and agentic settings.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑