Web Agent DOM Action Grounding and Sandbox Security Assessment
Assess browser-based autonomous agent action primitives, DOM tree grounding accuracy, and isolation guardrails against web-based exploits.
Run this assessment when deploying web-grounded autonomous agents that interact with client-side DOM elements via headless browsers or accessibility trees. It validates action grounding reliability and defends against prompt injection via web page content.
Role: Lead Web Automation and Agent Interaction Security Engineer with 10+ years in browser automation, DOM accessibility trees, and client-side sandbox isolation.
Context
- Target Web Application: {{target_web_app}}
- Browser Driver Engine: {{browser_driver_type}}
- Action Primitives Catalog: {{action_primitive_set}}
- Authentication Architecture: {{authentication_flow}}
- DOM Parsing Strategy: {{dom_traversal_policy}}
- Sandbox Isolation Tier: {{sandbox_isolation_level}}
- Max Action Latency SLA: {{max_action_latency_ms}}
Task
Generate a rigorous DOM grounding and security assessment report analyzing the autonomous browser agent's ability to interpret web structures, execute UI actions reliably, and resist indirect injection attacks on {{target_web_app}}.
Method
- Analyze {{dom_traversal_policy}} (e.g., raw HTML, accessibility tree, visual bounding boxes) for semantic loss, selector instability, and dynamic shadow-DOM blind spots.
- Review the action primitives in {{action_primitive_set}} to verify that click, type, scroll, and select operations include pre-action validation and post-action verification checks.
- Evaluate the agent's vulnerability to indirect prompt injection embedded within DOM text, hidden CSS spans, image alt tags, and dynamic comment feeds on {{target_web_app}}.
- Assess session isolation under {{sandbox_isolation_level}} to guarantee credential boundary enforcement and prevent cross-origin state leakage via {{authentication_flow}}.
- Benchmark the execution overhead of DOM serialization and tool-call roundtrips against {{max_action_latency_ms}}.
- Inspect fallback and re-grounding routines when dynamic client-side rendering (CSR) invalidates assigned element coordinates or accessibility node IDs.
- Define hardened action validation wrappers that intercept dangerous browser events (e.g., file downloads, clipboard modifications, navigation to unapproved origins).
Constraints
- MUST identify specific DOM attack surfaces relevant to {{target_web_app}}'s tech stack.
- MUST NOT recommend exposing raw unrestricted JavaScript evaluation primitives (
evalor raw console execution) to the agent. - Action verification protocols MUST satisfy the {{max_action_latency_ms}} constraint without sacrificing safety.
- Recommendations MUST adhere to the security boundaries of {{sandbox_isolation_level}}.
Output format
Provide a detailed technical report formatted with:
- DOM Grounding Architecture Review (efficiency, token overhead, and selector stability table)
- Indirect Injection & Web Exploitation Threat Model (attack vectors, exploitation mechanics, risk rating)
- Action Primitive Hardening Blueprint (code/pseudocode wrappers for click, type, navigate)
- Sandbox Enforcement and Session Isolation Audit (specific browser configuration rules)
Self-review
- Ensure all 7 variables are directly integrated into the evaluation criteria.
- Confirm that the threat model specifically addresses indirect injection via web content rather than just system prompt attacks.
- Check that latency recommendations remain realistic within the {{max_action_latency_ms}} threshold.
Explicit role, a named task, and discrete steps the model can follow.
Background, inputs and variables the model needs before it starts.
Hard boundaries — what the model must and must not do.
A named, field-level shape for the response.
Ordered work items that force analysis before an answer.
Length and structure that travel across frontier models.
Signal density — instruction weight without padding.
Documented variables so the scaffold adapts to new inputs.
Quality bar, assumptions and behaviour when inputs are thin.
How much real usage the template has behind it.