Installation
browser-use has separate packages for TypeScript (
browser-use-node) and Python (browser-use). Veto supports both.Quick Start
TypeScript (browser-use-node)
Python (browser-use)
How It Works
TypeScript Implementation
wrapBrowserUse() returns a custom Controller subclass that intercepts the act() method:
- Agent decides to perform a browser action (click, navigate, input, etc.)
- Controller’s
act()method intercepts the call - Veto validates the action and parameters
- If allowed, original implementation executes
- If denied, returns
ActionResult({ error: "Action blocked by Veto: ..." })
Python Implementation
wrap_browser_use() returns a custom Tools subclass that intercepts the act() method:
- Agent decides to perform a browser action
- Tools’
act()method intercepts the call - Veto validates the action and parameters through Veto Cloud
- If allowed, original implementation executes
- If denied, returns
ActionResult(error="Action blocked by Veto: ...")
Validated Actions
By default, Veto validates these browser actions: TypeScript (browser-use-node):go_to_urlclick_elementinput_textextract_page_contentscrolldonetab
navigatesearchclickinputextractscrolldone
Configuration
Customize Validated Actions
You can specify which actions to validate:Callbacks
Both implementations support callbacks:onAllow/on_allow: Called when an action is allowedonDeny/on_deny: Called when an action is denied
Validation Rules
Configure rules for browser actions in yourveto/rules/ directory:
Block Dangerous URLs
Limit Input Actions
Validate Click Targets
Block Data Extraction
Complete Example
Here’s a complete example with rules and callbacks:Tool Schema Registration
Both implementations automatically register browser action schemas with Veto Cloud (if enabled):- TypeScript: Extracts action schemas from the controller’s registry
- Python: Extracts action schemas from the tools’ registry
TypeScript API Reference
wrapBrowserUse(veto, options?)
Create a browser-use-node Controller with Veto validation.
Parameters:
veto: Veto- Initialized Veto instanceoptions?: WrapBrowserUseOptionsvalidatedActions?: Set<string>- Actions to validate (default: all standard actions)onAllow?: (actionName: string, params: Record<string, unknown>) => void | Promise<void>onDeny?: (actionName: string, params: Record<string, unknown>, reason: string) => void | Promise<void>
Promise<Controller> - Drop-in replacement for browser-use-node Controller
Default validated actions:
Python API Reference
wrap_browser_use(veto, *, validated_actions, on_allow, on_deny)
Create a browser-use Tools instance with Veto validation.
Parameters:
veto: Veto- Initialized Veto instancevalidated_actions: set[str] | None- Actions to validate (default: all standard actions)on_allow: Callable | None- Callback for allowed actionson_deny: Callable | None- Callback for denied actions
Tools - Drop-in replacement for browser-use Tools
Default validated actions:
Security Best Practices
- Always validate navigation: Block access to unauthorized domains
- Limit input actions: Prevent input on sensitive fields (passwords, payment info)
- Validate extraction: Ensure agents don’t extract PII or sensitive data
- Use LLM rules: For semantic validation (e.g., “is this action destructive?”)
- Enable callbacks: Log all browser actions for audit trails
- Test in headless: false: Watch the browser during development to verify guardrails
Next Steps
Configure Rules
Define validation rules for browser actions
Browser Safety
Best practices for securing browser automation
Veto Cloud
Use Veto Cloud for centralized policy management
API Reference
Full Veto API documentation

