Blog Post

Apps on Azure Blog
4 MIN READ

Give Your AI Agent Eyes: Browser-Harness Meets Playwright Workspaces Remote Browsers

NandiniMuralidharan's avatar
May 12, 2026

What happens when you hand a coding agent a real browser — not a mock, not an API wrapper, but a full Chromium instance running in the cloud?

It fills form for you. It does research for you. It navigates JavaScript-heavy SPAs that would make any REST-based scraper weep. And it does it across 10+ parallel sessions without touching your local machine.

This is the story of combining two tools that were built for different worlds — and discovering they're a perfect fit.

The Problem

Today's coding agents — Codex, Claude Code, Copilot — are extraordinary at reading and writing code. But ask one to product availability on an web site, and it hits a wall. Modern websites are JavaScript-rendered, authentication-gated, geolocation-aware, and hostile to simple HTTP requests.

The agent needs a real browser. Not requests.get(). Not a headless puppeteer script you wrote last Tuesday. A browser that renders CSS, executes JavaScript, handles cookies, and lets the agent see what a human would see.

Enter Browser-Harness

Browser-harness is an open-source tool that gives AI agents direct control over a Chrome browser via the Chrome DevTools Protocol (CDP). It exposes a clean Python API:

  ● agent: wants to upload a file
  │
  ● agent-workspace/agent_helpers.py → helper missing
  │
  ● agent writes it                         agent_helpers.py
  │                                                       + custom helper
  ✓ file uploaded

One websocket to Chrome, nothing between. The agent writes what's missing during execution. The harness improves itself every run.

But there's a catch. Where does this browser run?

The Infrastructure Gap

If the browser runs locally, you've got problems:

  • Your machine is busy. Running Chrome while the agent works eats RAM and CPU.
  • No parallelism. One browser per machine. Want to scrape 10 sites simultaneously? Buy 10 machines.
  • No consistency. Different OS, different Chrome versions, different results.
  • No isolation. Letting the agent run amock on autopilot with your local browser can be risky, it can reuse your creds, stored cookies and sessions
  • No observability. The agent is clicking around in a browser you can't see.

What you really want is a browser that runs somewhere else — managed, scalable, observable — and your agent just connects to it over a WebSocket.

Enter Playwright Workspaces

Playwright Workspaces provides exactly this: remote browser endpoints on Azure. You make an HTTP request, a Chromium instance spins up in the cloud, and you get back a WebSocket URL (wss://...) to connect via CDP.

The key insight: browser-harness speaks CDP. Playwright Workspaces serves CDP. They snap together like LEGO.

Your Agent → browser-harness → CDP WebSocket → Playwright Workspaces → Cloud Chromium

No local Chrome needed. No browser installation. No display server. Just a WebSocket connection to a fully managed browser.

The Two-Step Connection Flow

Connecting them is surprisingly simple:

Step 1: Provision a remote browser

def get_connect_options(os_name="linux", run_id=str(uuid.uuid4())) -> tuple[str, dict[str, str]]:

    service_url = os.getenv("PLAYWRIGHT_SERVICE_URL")
    service_access_token = os.getenv("PLAYWRIGHT_SERVICE_ACCESS_TOKEN")

    headers = {"Authorization": f"Bearer {service_access_token}"}
    service_run_id = os.getenv("PLAYWRIGHT_SERVICE_RUN_ID")
    ws_endpoint = f"{service_url}?os={os_name}&runId={service_run_id}&api-version=2025-09-01"

    return ws_endpoint, headers

Step 2: Point browser-harness at it

export BU_CDP_WS="${session_url}" browser-harness -c "print(page_info())" # → {'url': 'about:blank', 'title': '', 'w': 780, 'h': 441}

That's it. Your agent now controls a cloud browser.

What This Unlocks: A Real-World Demo

We gave a coding agent this prompt:

"Go to Website1, search for gifts under ₹500 for 10-year-old kids. Must be useful, reusable (not single-use). Delivery in Bengaluru within 3 days. Must have 5 pieces available."

Here's what the agent did — autonomously, with no human intervention:

  1. Provisioned a remote Chromium browser via Playwright Workspaces
  2. Connected browser-harness to the cloud browser over WebSocket
  3. Navigated to FirstCry.com
  4. Set delivery location to Bengaluru (pincode 560001)
  5. Searched for kids' gifts
  6. Applied filters — price ₹0–250 and ₹250–500 via JavaScript DOM interaction
  7. Browsed products, rejecting single-use items (greeting cards) in favor of reusable ones (stainless steel water bottles)
  8. Checked delivery dates — rejected items with 6-day delivery, found ones with Next Day Delivery
  9. Verified stock availability — confirmed ADD TO CART was active with no stock warnings
  10. Took screenshots at every step for audit and debugging

Result: Found the Brand A 600 Stainless Steel Water Bottle at ₹444.69 with next-day delivery to Bengaluru. All criteria met.

The entire workflow ran on a remote browser in Azure — the local machine never launched Chrome. 

The Power of Remote Endpoints

Why does running browsers remotely change everything?

1. Massive Parallelism

 Spin up multiple remote browsers and work in parallel. Each gets its own isolated Chromium instance. No resource contention, no port conflicts.

2. Zero Local Dependencies

No Chrome installation. No chromedriver version mismatches. No --no-sandbox hacks. The browser is a managed service — you just connect to it.

3. Geographic Flexibility

Remote browsers run in Azure data centers. Need to see what a website looks like from East US? Or Southeast Asia? Pick your region. The browser's IP and geolocation are in the cloud, not on your laptop.

4. Ephemeral & Secure

Each browser session is isolated and destroyed when the WebSocket closes. No leftover cookies, no persistent state leaking between runs. Every session starts clean.

The Bigger Picture

We're at an inflection point. AI agents are moving from code generation to code execution — and execution means interacting with the real world. Browsers are the universal interface to that world.

The combination of browser-harness (agent-to-browser control) and Playwright Workspaces (managed remote browsers) creates a powerful primitive: give any AI agent a browser, anywhere, on demand.

Get Started

The full sample — including the playwright_service_client.py helper, setup prompts, and environment templates — is available here:

📦 playwright-workspaces/samples/browser-harness

Resources:

Updated May 13, 2026
Version 2.0
No CommentsBe the first to comment