Autonomous Browser Tool Execution and Resiliency Framework
Structure robust browser action tools, resilient selectors, and sandboxing rules for autonomous web agents.
Use this template when developing browser automation tools for agents navigating dynamic web pages. It guarantees resilient DOM interaction, safe execution limits, and anti-fragile recovery.
Role: Principal Web Automation Engineer specializing in autonomous browser agents, resilient DOM interaction, and anti-fragile web tooling.
Context
- Browser Automation Driver Stack: {{browser_driver_stack}}
- Target Site Archetypes: {{target_site_archetypes}}
- DOM Selector Strategy: {{dom_selector_strategy}}
- Session Concurrency Limit: {{session_concurrency_limit}}
- Execution Sandbox Level: {{safety_sandbox_level}}
- Execution Timeout Budget: {{execution_timeout_budget}}
Task
Develop an autonomous browser tool execution framework that empowers LLM agents to reliably navigate, query, interact with, and extract data from dynamic web applications with resilient self-healing selectors and strict sandbox isolation.
Method
- Define atomic browser action tools (navigate, click, type, scroll, extract, wait) configured for {{browser_driver_stack}}.
- Build resilient locator resolvers implementing {{dom_selector_strategy}} using semantic attributes, accessibility trees, and visual anchor points.
- Configure session isolation, ephemeral storage, and script-blocking rules according to {{safety_sandbox_level}}.
- Implement adaptive DOM snapshotting that prunes non-interactive nodes to fit within the agent observation window.
- Design step-level verification checks that validate state changes before confirming action completion to the agent.
- Embed exponential backoff, mutation observer hooks, and retry logic bounded strictly by {{execution_timeout_budget}}.
- Structure resource pooling and memory disposal pipelines honoring {{session_concurrency_limit}}.
- Define telemetry capture for screenshot diffing, DOM mutations, and action trace logging for auditability.
Constraints
- MUST enforce strict sandboxing preventing arbitrary remote code execution outside authorized domains in {{target_site_archetypes}}.
- MUST NOT proceed to sequential browser actions without verifying DOM mutation or network idle states.
- Tool responses must summarize extracted data concisely rather than returning full raw HTML trees.
- All automated sessions must automatically terminate when reaching {{execution_timeout_budget}}.
Output format
- Browser Tool Definition Catalog (Actions and Signatures)
- Resilient DOM Resolution and Tree Pruning Engine
- Action Verification and Mutation Handling Matrix
- Isolation, Sandboxing, and Resource Governance Rules
- Anomaly Detection and Self-Healing Execution Flow
Self-review
- Verify that selector strategies provide multi-tiered fallbacks (e.g., text, aria, CSS, XPath).
- Confirm timeout and concurrency controls prevent browser zombie processes.
- Ensure DOM pruning preserves semantic interaction metadata for accurate LLM reasoning.
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.