arXiv:2607.05277cs.CRcs.LG2026-07被引 2

通过遮蔽网页中不可信内容,实现对网络代理的安全防护。

Untrusted Content Masking for Web Agents with Security Guarantees

论文配图:Untrusted Content Masking for Web Agents with Security Guarantees
图 1 · 摘自论文原文
  • 利用DOM结构区分可信与不可信区域,提前遮蔽不可信内容。
  • 在沙箱环境中交互,实现严格权限隔离,防止提示注入攻击。
  • 适用于需要安全执行的网页自动化任务,如智能代理系统。

针对提示注入攻击的防御机制依赖于可信指令与不可信数据之间的严格隔离。在文本类环境(如工具调用API)中,代理可基于接口定义进行推理,而无需处理不可信内容,因此这种隔离天然存在。然而,将此类安全保证扩展到网络代理面临根本挑战:为感知和交互环境,网络代理必须先观察渲染后的页面,而页面内容同时包含可信与不可信信息。这种结构上的纠缠破坏了信任边界,使可证明的安全防御失效。本文提出不可信内容遮蔽(Untrusted Content Masking, UCM),一种简单有效的解决方案,重新建立网络环境中的信任边界。我们基于一个关键结构洞察:网页的文档对象模型(DOM)编码了足够信息,可在不读取内容的前提下区分可信与不可信区域。本框架通过在内容到达代理前进行遮蔽,并通过具有严格权限分离的沙箱接口路由交互,使代理能在保持与环境互动能力的同时,完全隔离恶意内容。代码已公开。

原文摘要 · Abstract (English)

Defenses that provide security guarantees against prompt injection attacks rely on strict isolation between trusted instructions and untrusted data. In text-based environments such as tool-use APIs, this separation arises naturally: agents can reason from interface definitions without ever processing untrusted content. Extending these guarantees to web agents faces a fundamental challenge: to perceive and interact with their environment, web agents must first observe the rendered page, which intermingles trusted content with untrusted content. This structural entanglement removes the trust boundary on which security guarantees depend, undermining provable defenses for web agents. In this paper, we present Untrusted Content Masking (UCM), a simple and effective approach that restores this boundary in web environments. We leverage a key structural insight: a webpage's Document Object Model (DOM) encodes sufficient information to distinguish trusted from untrusted regions without reading their content. Our framework exploits this by redacting untrusted regions before they reach the agent and routing interaction through a sandboxed interface with strict privilege separation, thereby enabling agents to observe and interact with their environment while remaining isolated from adversarial content. The code is publicly available.

安全防护网络代理提示注入

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