Integrations/Browser Use

Browser Use Agent Guardrails with Veto

Browser automation agents can navigate anywhere, fill any form, and access any URL. Veto adds authorization controls that prevent agents from visiting malicious sites, leaking credentials, or performing unauthorized actions.

What is Browser Use?

Browser Use is an open-source library that enables AI agents to control web browsers autonomously. Agents can navigate websites, fill forms, click buttons, and extract data. This power requires guardrails to prevent unauthorized access to sensitive URLs, forms, and actions.

Why browser agents need guardrails

Browser automation agents operate with full browser capabilities. Without authorization, they can access internal admin panels, submit forms with sensitive data, navigate to phishing sites, and leak credentials through form fields.

URL Access Control

Whitelist allowed domains, block internal admin URLs, prevent navigation to malicious sites.

Form Protection

Block credential entry, prevent auto-fill of sensitive fields, require approval for forms.

Credential Safety

Prevent agents from entering passwords, API keys, or credit card numbers without authorization.

Quick start with Browser Use

Wrap your Browser Use agent with Veto guardrails in two steps. The agent continues to work normally while Veto enforces authorization policies on every tool call.

from browser_use import Agent
from veto import Veto

# Initialize Veto with your API key
veto = Veto(api_key="veto_live_...")

# Wrap browser tools with authorization
@veto.guard(
  policy="browser_safety",
  tools=["go_to_url", "click_element", "input_text"]
)
async def safe_browser_task(task: str):
    agent = Agent(task=task)
    result = await agent.run()
    return result

# URL authorization example
veto.add_policy({
  "name": "url_whitelist",
  "rules": [
    {
      "match": {"tool": "go_to_url"},
      "allow": {"url": {"pattern": "https://*.mycompany.com/*"}}
    },
    {
      "match": {"tool": "go_to_url"},
      "deny": {"url": {"pattern": "*://admin.*"}}
    }
  ]
})

# Run with guardrails
await safe_browser_task("Book a meeting on the company calendar")

URL authorization patterns

Control which URLs your browser agent can visit. Use pattern matching to define allowed domains, block sensitive paths, and prevent access to internal resources.

1

Domain whitelisting

Only allow navigation to approved domains like your company's properties or trusted partners.

2

Path blocking

Block access to admin panels, internal dashboards, and sensitive endpoints within allowed domains.

3

Approval workflows

Route navigation to certain URLs to human approval before the agent proceeds.

Form protection

Prevent browser agents from filling sensitive form fields that could lead to credential leakage or unauthorized data submission.

# Form protection - prevent credential leakage
veto.add_policy({
  "name": "form_protection",
  "rules": [
    {
      "match": {"tool": "input_text"},
      "deny": {
        "or": [
          {"selector": {"pattern": "*password*"}},
          {"selector": {"pattern": "*credit_card*"}},
          {"selector": {"pattern": "*ssn*"}}
        ]
      },
      "message": "Blocked attempt to fill sensitive form field"
    },
    {
      "match": {"tool": "input_text"},
      "require_approval": {
        "selector": {"pattern": "*email*"}
      }
    }
  ]
})

Related integrations

Frequently asked questions

How do I restrict which URLs my Browser Use agent can visit?
Create a URL authorization policy with pattern matching rules. You can whitelist allowed domains using glob patterns like https://*.mycompany.com/*, block specific paths like *://admin.*, and require human approval for sensitive URLs. Veto intercepts the go_to_url tool call and evaluates it against your policies before the browser navigates.
Can I prevent agents from entering passwords or credit cards?
Yes. Veto monitors the input_text tool and can block form fills on sensitive field selectors. Create rules that deny input on fields matching patterns like *password* or*credit_card*. The agent receives a configurable error message and cannot bypass this protection.
Does Veto slow down browser automation?
Minimal impact. Policy evaluation runs locally in your Python process, typically completing in under 10ms. The SDK has no network dependency for basic authorization decisions. Cloud mode adds features like team approvals and audit logging without blocking the critical path.
What happens when a guardrail blocks a browser action?
The tool call is intercepted and the agent receives a configurable response. You can return an error message explaining why the action was blocked, provide a fallback value, or route to a human approval workflow. All decisions are logged with full context including the URL, selector, and input data for audit trails.

Secure your browser agents before they click the wrong button.