Seedlabs
Source research

Untrusted Content Masking for Web Agents with Security Guarantees

Kristina Nikolić, Egor Zverev, Javier Rando, Matthew Jagielski, Edoardo Debenedetti, Florian Tramèr · 2026 · 8 citationsRead the paper

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.

What the full text shows

Working prototype
  • UCM preserves agent utility across both tasks that do not require untrusted content and those that do. (Evaluated using Claude Sonnet 4.5, 4.6, and GPT-5.4 on WebArena GitLab suite)
  • Automated trust boundary identification using a sanitized DOM achieves high F1 scores across popular websites. — Reddit: 0.997, Booking: 0.879, GitLab: 0.840 (Using Claude Sonnet 4.5 on sanitized DOMs)
  • UCM introduces a moderate cost overhead per task, though some tasks are cheaper due to reduced visual clutter. — ~15% of tasks are cheaper under UCM (API prices with caching as of May 2026)
Setup
Evaluated on WebArena GitLab suite (41 unique task templates) and three real websites (Booking, Reddit, GitLab) using Claude Sonnet 4.5, 4.6, and GPT-5.4.
How
The framework redacts untrusted DOM regions based on CSS selectors inferred by an LLM from a content-sanitized DOM. Agents interact with masked content via a Quarantined Model (Q-Model) that returns only type-constrained structured responses (e.g., boolean, integer).
Limitations
Cost overhead is higher for tasks requiring frequent Q-Model queries. · Automated labeling performance varies by website (e.g., lower F1 on Booking due to non-semantic class names).

Summarized by Gemma 4 from the open-access full text · 19 Nov 2026. Read it