WebGuard: Building a Generalizable Guardrail for Web Agents

📄 arXiv: 2507.14293v1 📥 PDF

作者: Boyuan Zheng, Zeyi Liao, Scott Salisbury, Zeyuan Liu, Michael Lin, Qinyuan Zheng, Zifan Wang, Xiang Deng, Dawn Song, Huan Sun, Yu Su

分类: cs.AI, cs.CL, cs.CV

发布日期: 2025-07-18

备注: We publicly release WebGuard, along with its annotation tools and fine-tuned models, to facilitate open-source research on monitoring and safeguarding web agents. All resources are available at https://github.com/OSU-NLP-Group/WebGuard


💡 一句话要点

WebGuard:构建Web Agent的通用安全防护机制

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: Web Agent 安全防护 风险评估 大型语言模型 数据集 行为预测

📋 核心要点

  1. 现有Web Agent缺乏有效的安全防护机制,容易产生非预期或有害行为,存在安全风险。
  2. WebGuard通过构建包含风险标注的Web Agent行为数据集,用于训练和评估安全防护模型。
  3. 实验表明,使用WebGuard微调的Qwen2.5VL-7B模型在行为预测准确率和高风险行为召回率方面均有显著提升。

📝 摘要(中文)

随着大型语言模型(LLMs)驱动的自主Web Agent的快速发展,其在提升效率的同时,也带来了潜在的非预期或有害行为风险。这迫切需要有效的安全措施,类似于人类用户的访问控制。为了应对这一关键挑战,我们推出了WebGuard,这是首个旨在支持评估Web Agent行为风险并促进现实在线环境安全防护机制开发的综合数据集。WebGuard特别关注预测状态改变行为的结果,包含来自22个不同领域的193个网站的4,939个人工标注行为,包括经常被忽视的长尾网站。这些行为使用一种新颖的三层风险模式进行分类:安全(SAFE)、低风险(LOW)和高风险(HIGH)。该数据集包括指定的训练和测试集,以支持在不同的泛化设置下进行评估。初步评估显示了一个令人担忧的缺陷:即使是最先进的LLM在预测行为结果方面的准确率也低于60%,在高风险行为召回率方面也低于60%,这突显了在没有专用安全措施的情况下部署当前一代Agent的风险。因此,我们研究了使用WebGuard微调专门的安全防护模型。我们在多个泛化设置中进行了全面的评估,发现微调后的Qwen2.5VL-7B模型在性能上有了显著提高,将准确率从37%提高到80%,高风险行为召回率从20%提高到76%。尽管取得了这些进步,但性能仍然达不到高风险部署所需的可靠性,在这些部署中,安全防护机制必须接近完美的准确率和召回率。

🔬 方法详解

问题定义:论文旨在解决Web Agent在执行Web操作时可能产生的安全风险问题。现有方法缺乏对Web Agent行为风险的有效评估和控制机制,导致Agent可能执行非预期或有害的操作,例如泄露隐私信息、篡改数据等。

核心思路:论文的核心思路是构建一个包含丰富Web Agent行为及其风险标注的数据集WebGuard,并利用该数据集训练专门的安全防护模型。通过让模型学习不同行为的风险等级,从而在Agent执行操作前进行风险预测和干预,降低安全风险。

技术框架:WebGuard的整体框架包括数据收集、行为标注和模型训练三个主要阶段。首先,通过模拟Web Agent在不同网站上的操作,收集大量的行为数据。然后,由人工对这些行为进行风险标注,分为安全、低风险和高风险三个等级。最后,利用标注好的数据训练安全防护模型,例如微调大型语言模型。

关键创新:WebGuard的关键创新在于构建了一个包含丰富长尾网站行为及其风险标注的数据集,这使得模型能够学习到更全面的Web环境知识,从而提高风险预测的准确性。此外,论文还提出了一个三层风险分类体系,能够更细粒度地评估Web Agent行为的风险等级。

关键设计:WebGuard数据集包含了来自22个不同领域的193个网站的4,939个人工标注行为。论文使用Qwen2.5VL-7B模型作为基础模型,并使用WebGuard数据集进行微调。损失函数采用交叉熵损失函数,优化器采用AdamW优化器。训练过程中,采用了数据增强和正则化等技术,以提高模型的泛化能力。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果表明,使用WebGuard微调的Qwen2.5VL-7B模型在行为预测准确率方面从37%提升到80%,在高风险行为召回率方面从20%提升到76%。这表明WebGuard数据集和微调方法能够显著提高Web Agent的安全防护能力。然而,性能仍有提升空间,需要进一步研究。

🎯 应用场景

WebGuard的研究成果可应用于构建更安全的Web Agent系统,例如智能助手、自动化测试工具等。通过在Agent执行操作前进行风险评估,可以有效防止Agent执行有害操作,保护用户隐私和数据安全。未来,该研究还可以扩展到其他类型的Agent系统,例如机器人、自动驾驶汽车等。

📄 摘要(原文)

The rapid development of autonomous web agents powered by Large Language Models (LLMs), while greatly elevating efficiency, exposes the frontier risk of taking unintended or harmful actions. This situation underscores an urgent need for effective safety measures, akin to access controls for human users. To address this critical challenge, we introduce WebGuard, the first comprehensive dataset designed to support the assessment of web agent action risks and facilitate the development of guardrails for real-world online environments. In doing so, WebGuard specifically focuses on predicting the outcome of state-changing actions and contains 4,939 human-annotated actions from 193 websites across 22 diverse domains, including often-overlooked long-tail websites. These actions are categorized using a novel three-tier risk schema: SAFE, LOW, and HIGH. The dataset includes designated training and test splits to support evaluation under diverse generalization settings. Our initial evaluations reveal a concerning deficiency: even frontier LLMs achieve less than 60% accuracy in predicting action outcomes and less than 60% recall in lagging HIGH-risk actions, highlighting the risks of deploying current-generation agents without dedicated safeguards. We therefore investigate fine-tuning specialized guardrail models using WebGuard. We conduct comprehensive evaluations across multiple generalization settings and find that a fine-tuned Qwen2.5VL-7B model yields a substantial improvement in performance, boosting accuracy from 37% to 80% and HIGH-risk action recall from 20% to 76%. Despite these improvements, the performance still falls short of the reliability required for high-stakes deployment, where guardrails must approach near-perfect accuracy and recall.