Setup Guide
OpenClaw Browser Harness
A browser harness gives your AI agent direct control of a real Chrome browser — opening pages, clicking, filling forms, and recovering when something goes wrong. This guide shows how to use the browser-use browser-harness with your OpenClaw agent for tasks that plain web scraping can't handle.
What Is a Browser Harness?
A browser harness is a thin layer between a large language model and a real browser. The model sees the page (as a snapshot or screenshot), decides on the next action (click, type, scroll, navigate), and the harness carries it out through the Chrome DevTools Protocol (CDP). When the page changes, the model sees the new state and decides again.
The open-source browser-use/browser-harness project takes this idea to its logical minimum: no framework, no pre-written recipes, no fixed selectors. The agent writes whatever it needs to get the task done, and the harness self-heals when a step fails. That makes it a good fit for OpenClaw agents that need to handle unpredictable sites — dashboards behind logins, JavaScript-heavy single-page apps, or pages with anti-bot protection.
Browser Harness vs Firecrawl vs Tavily
OpenClaw already supports several web tools. They serve different jobs:
- Tavily — a search API. Use when the agent needs to find pages about a topic.
- Firecrawl — a scraping API. Use when the agent knows which URL and needs to extract the text cleanly.
- Browser harness — a real browser. Use when the agent needs to interact: log in, click through a wizard, fill a form, download a file, or work with a site that scrapers cannot reach.
How It Works with OpenClaw
OpenClaw exposes a browser relay that lets your agent reach a browser running outside the container — either on your own machine or on a dedicated sidecar. The browser-use harness plugs into the same relay over CDP, so no special networking work is required.
The flow is:
- User asks the agent to do something that needs a browser (“log into my dashboard and download this month's invoice”).
- The agent calls the harness skill with a task description.
- The harness opens a page, takes a snapshot, and asks the model “what should I do next?”
- The model replies with an action (click, type, scroll). The harness runs it.
- Loop until the task is done, then return the result.
Setup
Step 1: Enable browser automation on your OpenClaw agent
Open your configuration on the OpenClaw Launch dashboard. In the skills section, enable the browser automation skill — this provisions the relay endpoint the harness will connect to. If you prefer a dedicated browser, see the browser automation guide.
Step 2: Install the browser-use harness
From a shell (either locally or on a sidecar):
pip install browser-useThe browser-use project ships both a Python and a JavaScript version. Pick whichever matches where you want the harness process to run.
Step 3: Point the harness at your agent's model
The harness needs an LLM to choose actions. Reuse the same OpenRouter key your OpenClaw agent uses — set OPENAI_API_KEY (or the provider equivalent) in the harness environment and pick a strong vision model like Claude Sonnet 4.6 or Gemini 2.5 Pro. Smaller models often misread crowded pages.
Step 4: Register the harness as a tool
Expose the harness as a tool your OpenClaw agent can call. The simplest option is to wrap it as an MCP server — see the OpenClaw MCP guide for the general pattern. The agent now has a run_browser_task(instructions) tool it can invoke whenever a chat request needs hands-on browsing.
Example Tasks
- “Log into my admin panel and export today's orders as CSV.”
- “Open LinkedIn, search for Python developers in Berlin, and list the top 10.”
- “Go to the airline site and find the cheapest flight from SFO to NRT next week.”
- “Fill out this Google Form with the data in my last message.”
- “Take a screenshot of our pricing page every morning and send it to Telegram.”
Performance Notes
A browser harness is slower than a scraping API — a single task can run for 30–120 seconds because the model is taking multiple turns. Budget accordingly:
- Use Tavily/Firecrawl first for read-only tasks. Only reach for the harness when interaction is actually needed.
- Cap the harness at a sensible step budget (20–40 actions) so it never loops forever.
- Run the harness on a sidecar when latency matters — colocating it with Chrome avoids the CDP round trips over the public internet.
Security Considerations
A browser that can log in is a browser that can leak credentials. Never bake a password into the task text — use a secrets manager or per-session cookies. Restrict the harness to a sandboxed user profile, and review the agent's action log after each run while you're still tuning.
Bottom Line
Browser harnesses fill the gap between “my agent can search the web” and “my agent can actually do the thing”. If your OpenClaw use case involves sites that scrapers can't reach — dashboards, forms, vendor portals, anything behind a login — wiring up browser-use's browser-harness is the shortest path to making the agent genuinely useful.
Next Steps
- Browser automation guide — Enable the OpenClaw browser sidecar.
- Browser relay — Connect your local browser to a remote agent.
- MCP guide — Wrap any tool as an MCP server for your agent.
- Deploy on OpenClaw Launch — Spin up an agent with browser skills in under a minute.