Skip to main content

Browser Tools

NullClaw provides two browser tools for web interaction:
  • browser — Multi-action browser tool (open, read, screenshot)
  • browser_open — Allowlist-based URL opener
Both tools enforce HTTPS-only URLs and include security controls to prevent injection attacks.

browser

A flexible browser tool supporting multiple actions:
  • open — Launch URL in system browser
  • read — Fetch page content via curl
  • screenshot — Redirects to dedicated screenshot tool
  • click/type/scroll — Require CDP (not available)

Parameters

string
required
Browser action: open, read, screenshot, click, type, or scroll
string
URL to open or read (required for open and read actions)
string
CSS selector for click/type actions (not available)
string
Text to type (not available)

Configuration

No configuration required — tool is self-contained.

Action: open

Launch a URL in the system’s default browser. Usage:
Response:
Platform commands: Security:
  • Only https:// URLs accepted (no http://)
  • On Windows: blocks shell metacharacters (;, |, &, %, etc.) to prevent command injection
  • On Unix: URL passed as separate argv element (safe from injection)
Example: Blocked URL
Response:

Action: read

Fetch page content via curl and return body text (truncated to 8 KB). Usage:
Response:
Implementation:
Flags:
  • -sS — Silent but show errors
  • -L — Follow redirects
  • -m 10 — Timeout after 10 seconds
  • --max-filesize 65536 — Abort if body exceeds 64 KB
Truncation:
  • Fetches up to 64 KB raw
  • Returns up to 8 KB to LLM
  • Appends [Content truncated to 8 KB] if truncated
Example: Large page
Response:
Requirements:
  • curl must be installed and in PATH
  • Network access required

Action: screenshot

Redirects to the dedicated screenshot tool. Usage:
Response:

Actions: click, type, scroll

These actions require Chrome DevTools Protocol (CDP), which is not available in NullClaw. Usage:
Response:

browser_open

Open an allowlisted HTTPS URL in the default browser. Unlike the browser tool’s open action, browser_open enforces a domain allowlist configured at tool initialization.

Parameters

string
required
HTTPS URL to open in browser

Configuration

Usage

Allowed domain:
Response:
Subdomain matching:
Matches github.com in allowlist → allowed Blocked domain:
Response:

Domain Allowlist Rules

Exact match:
  • example.com in allowlist
  • https://example.com → allowed
Subdomain match:
  • example.com in allowlist
  • https://api.example.com → allowed
  • https://v2.api.example.com → allowed
No partial match:
  • example.com in allowlist
  • https://notexample.com → blocked
  • https://example.com.evil.com → blocked

Security Blocklist

The following hosts are always blocked, even if in the allowlist:
  • localhost
  • *.localhost
  • *.local
  • 127.*.*.*
  • 10.*.*.*
  • 192.168.*.*
  • 169.254.*.* (link-local)
  • ::1 (IPv6 localhost)
Example: Blocked localhost
Response:

Empty Allowlist

If allowed_domains is empty, all URLs are rejected:
Response:

Platform Support

Supported platforms:
  • macOS — open URL
  • Linux — xdg-open URL
Unsupported platforms:
  • Windows — Returns error (Windows support not implemented for browser_open)

Comparison: browser vs browser_open

When to use browser:
  • Interactive agent browsing
  • User-requested URLs
  • Trusted environment
When to use browser_open:
  • Production deployments
  • Multi-tenant agents
  • Restricted URL access

URL Security

HTTPS-Only

Both tools reject http:// URLs:
Response:

Shell Injection Prevention (Windows)

On Windows, the browser tool blocks shell metacharacters in URLs: Blocked characters:
  • & — Command chaining
  • | — Piping
  • ; — Command separator
  • " ' — Quote injection
  • < > — Redirection
  • ` — Backtick execution
  • ( ) — Subshell
  • ^ — Escape character
  • % — Variable expansion
  • ! — History expansion
  • \n \r — Newlines
Example: Blocked injection
Response (Windows only):
Safe on Unix:
On Unix systems (macOS, Linux), the URL is passed as a separate argv element to open/xdg-open, so query parameters like ?a=1&b=2 are safe.

Use Cases

Open Documentation

Fetch API Status

Restricted GitHub Access

Fetch HTML Content


Source

  • browsersrc/tools/browser.zig:16-150
  • browser_opensrc/tools/browser_open.zig:12-89

Testing

Run browser tool tests:
Tests cover:
  • Open action (test mode skips actual spawn)
  • Read action (requires curl)
  • URL validation (HTTPS-only)
  • Domain allowlist matching
  • Localhost blocking
  • Shell injection prevention (Windows)
  • Error cases