Skip to content

About

Owner-isolated real-browser lifecycle for AI agents

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

agent-browser-launch

Owner-isolated lifecycle management for real automated browsers.

It launches Chromium or Camoufox on a local display, headless backend, or an optional SSH execution plane; allocates ports and Xvfb displays; records ownership; opens loopback-only tunnels; and emits the WebSocket endpoint an agent should connect to.

Why it exists

Raw browser commands make shared AI workstations unsafe: one agent can discover, reuse, or close another agent's browser, and crashed launches leave ports, profiles, displays, and tunnels behind. agent-browser-launch gives every native agent session a lifecycle boundary:

  • records are stamped with a stable owner ID;
  • --list, --wait, --reuse, --kill, and --gc see only that owner by default;
  • --global is required for explicit cross-agent administration;
  • the optional bin/agent-browser guard namespaces upstream CLI sessions and authorizes local CDP endpoints against those records;
  • CDP on a remote execution plane stays bound to loopback and returns through a dedicated SSH tunnel.

Requirements

Core: Bash, curl, jq, iproute2, procps-ng, coreutils and a Chromium-family browser.

Optional:

  • Hyprland for silent workspace placement;
  • Xvfb for a virtual display;
  • OpenSSH for a remote execution plane;
  • Camoufox, Playwright and Python for the Camoufox backend;
  • the upstream agent-browser CLI when using the guard wrapper.

Install

install -Dm755 bin/agent-browser-launch ~/.local/bin/agent-browser-launch
install -Dm755 bin/camoufox-launcher ~/.local/bin/camoufox-launcher
install -Dm644 config.example.sh ~/.config/agent-browser/config.sh

Install bin/agent-browser ahead of the upstream executable on PATH if you want the CLI guard. Keep the real upstream executable available later on PATH.

Native runtimes are detected from their session environment. Other callers must supply a stable owner:

export ABL_OWNER_ID='my-runtime:task-42'

Quick start

ws=$(agent-browser-launch https://example.com)
agent-browser-launch --list
agent-browser-launch --wait PORT
agent-browser-launch --kill

Connect Chromium with Playwright:

import subprocess
from playwright.sync_api import sync_playwright

ws = subprocess.check_output(
    ["agent-browser-launch", "https://example.com"],
    text=True,
).strip()

with sync_playwright() as playwright:
    browser = playwright.chromium.connect_over_cdp(ws)
    page = browser.contexts[0].pages[0]
    print(page.title())

For Camoufox, use --camoufox and playwright.firefox.connect(ws).

Optional SSH execution plane

Copy the example config and set at least:

ABL_REMOTE=my-browser-host
ABL_DEFAULT_HOST=remote

The SSH alias must be reachable non-interactively. The launcher deploys its executable and Camoufox sibling to ABL_REMOTE_BIN, starts the browser on the remote loopback, and creates a dedicated local tunnel.

All topology is configuration: host alias, default plane, workspace, monitor, port/display ranges, protected resources, proxy candidates and state paths. The public defaults contain no machine-specific host, monitor, port reservation, or proxy pool.

Persistent identities

ws=$(agent-browser-launch --session research-de --egress de)
agent-browser-launch --identity show research-de
agent-browser-launch --identity rotate-egress research-de
agent-browser-launch --identity pull-profile research-de

An identity pins fingerprint metadata, measured egress and cookie-jar location to one plane. --kill preserves the identity profile; --identity rm NAME removes it.

Proxy candidates are measured through their real exit rather than trusted from a port table. Configure ABL_EGRESS_CANDIDATES, then run:

agent-browser-launch --egress-scan --force

Shared-host policy

Ordinary agent calls must not use --global. Reserve it for an explicitly authorized administrator:

agent-browser-launch --global --list
agent-browser-launch --global --kill 9301

Do not expose browser control ports on 0.0.0.0. A CDP endpoint grants full control over the browser and its authenticated state.

Verification

bash -n bin/agent-browser-launch bin/agent-browser
tests/test-owner-isolation.sh
tests/test-agent-browser-guard.sh

License

MIT. See LICENSE.

About

Owner-isolated real-browser lifecycle for AI agents

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages