Implementation Guide

    Preventing Browser MCP Screenshots and Page Snapshots from Capturing Sensitive Data

    Treat every screenshot and page snapshot as a tool result that may contain sensitive data. No single control is enough. Scope browser sessions and origins, mask or exclude sensitive elements, restrict which snapshot tools are available, and enforce allow, redact or block policy on the result before it reaches model context. Then test the controls and keep evidence of each decision without storing the sensitive content itself.

    Where controls apply, and what each one cannot do

    1. 1

      Browser and session configuration

      Use isolated or ephemeral profiles and restrict which origins the agent can reach, so authenticated pages are not reachable by default. Limit: it does nothing about sensitive content on pages the agent is legitimately allowed to open.

    2. 2

      Page-level masking

      Mask or exclude known sensitive elements, such as credential fields, account numbers and record panels, before capture. Limit: it depends on knowing the elements in advance, and content outside the masked set is still captured.

    3. 3

      MCP server tool configuration

      Expose only the capture tools a task needs, and prefer narrower snapshot scope where the server allows it. Limit: it constrains what can be called, not what a permitted call returns.

    4. 4

      Runtime policy on tool results

      Inspect each result in the execution path and allow, redact or block it. Limit: detection can miss content, so it works as one layer beside least privilege, not as a replacement for it.

    Verify the controls and retain audit-ready evidence

    • Test each capture tool against pages seeded with synthetic sensitive data.
    • Confirm that out-of-scope origins are unreachable from the agent's profile.
    • Confirm masked elements are absent from both images and text snapshots.
    • Check that blocked and redacted results never appear in context, history or traces.
    • Retain tool, origin, policy and outcome for every decision, without sensitive content.
    • Re-run tests after server, tooling or policy changes.

    How screenshots and snapshots expose sensitive data

    A browser-automation MCP server lets an agent look at a page. It does this by returning either an image of what is rendered or structured content such as the DOM or accessibility tree. In an authenticated session, that can include credentials, personal data, session tokens, financial or health records and anything else the signed-in user can see. The tool call is legitimate, the server may be approved, and the result still carries data that was never meant to leave the browser.

    The exposure does not end at the model call. OWASP describes MCP context as working memory that holds prompts, retrieved data and intermediate outputs. When that context is shared, persistent or insufficiently scoped, sensitive information from one task, user or agent can reach another. Secrets can also end up in protocol logs and debug traces. Returned data can then be re-emitted through ordinary-looking tool calls, for example after a prompt injection encodes it into a search query, or passed as an argument to a different server with no regard for its data classification.

    For these reasons, screenshot and snapshot capture is best handled as a data-exposure path in the tool-call lifecycle, not as a model-behavior problem. OWASP guidance is to treat every tool response as untrusted data, including responses from approved servers. Instructions in a prompt telling the agent to avoid sensitive pages do not change what the capture tool returns, and an injected instruction can override them. Controls belong where the data is produced and where it is returned.

    Implement the layers in order

    Start with separation. OWASP recommends keeping sensitive servers (payment, auth, PII) apart from general-purpose ones. Apply the same reasoning here: a browser server that touches authenticated pages should not share a runtime, credentials or context with unrelated tools.

    Next, shrink what can be captured. Run the agent in a dedicated browser profile that starts empty and is discarded after the task, so saved logins and cookies from a human profile are not present. Allow only the origins the task requires. Where your tooling offers element masking, apply it to fields you can identify in advance, and treat the list as a baseline that you maintain.

    Then reduce the tool surface. Grant each tool only the data and operations it needs, and enforce permissions and parameters at the tool boundary. Disable screenshot capture where text snapshots are enough, or the reverse. Do not rely on a tool's read or write annotation to describe risk. Clients should treat annotations as untrusted unless they come from trusted servers, and a read-only snapshot can still be a sensitive read.

    Finally, enforce policy on the result. This is the only layer that sees what was actually captured, so it covers pages and fields the earlier layers did not anticipate.

    • Separate browser servers that reach authenticated pages from general-purpose servers.
    • Use isolated or ephemeral profiles and an origin allowlist per task.
    • Mask or exclude known sensitive elements before capture.
    • Expose only the capture tools the task needs, with permissions enforced at the tool boundary.
    • Require human confirmation for operations whose effects include sensitive reads.
    • Enforce allow, redact or block policy on every screenshot and snapshot result.

    Enforcing redact or block policy on results at runtime

    Image and text results need different handling. A text snapshot can be scanned for patterns such as credentials, tokens and personal identifiers, and matches can be replaced before the result is returned. An image has no text to scan until its content is interpreted, so detection is harder, and a redacted region has to be altered in the image itself. In both cases detection can miss content. Where a screenshot of a sensitive origin cannot be reliably cleaned, blocking the result is a safer outcome than passing a partial redaction. Policy can express this per tool and per origin: allow a snapshot from a public documentation site, redact one from an internal tool, block any capture from a payment or health portal.

    Enforcement has to hold when the client is bypassed or a prompt is injected. That means it sits in the execution path between the MCP server and the model, not in client settings or system prompts. Trussed enforces policy in the execution path on MCP servers and tool calls, with allow, redact, block, rate limit and escalation for human approval, applied to individual interactions and tool calls. Enforcement is at runtime, not reviewed after the fact, so a result is acted on before it enters context.

    Some limits remain. Screening does not stop an injection it fails to detect, and a captured value can reach other channels. Keep least privilege and tool scoping in place, and watch for cross-server flows, such as credentials captured from one server appearing in calls to another.

    Capture-and-return path for a browser MCP tool call

    Browser session

    Authenticated pages render sensitive content in the browser the agent controls.

    Capture tool

    A screenshot or DOM or accessibility-tree snapshot is produced by the MCP server.

    Result enforcement

    Policy inspects the result and allows, redacts or blocks it before it is returned.

    Model context and logs

    Whatever passes is held in context and can persist in history, traces and recorded traffic.

    Enforce policy on browser MCP tool results

    See how allow, redact and block policy runs in the execution path and how audit-ready evidence is produced for each decision.

    See How Evidence Is Produced