Skip to content
Nand-RPublic

About

Signed-in, bot-check-passing Chrome for AI coding agents on a Linux server

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

browserd (bx)

Signed-in browsers for AI coding agents (Claude Code, Codex, T3 Code) on a Linux server. Real Google Chrome, headful on its own virtual display, on persistent profiles that stay signed in and pass bot checks (Cloudflare, Meta, LinkedIn, Google). Agents drive it with agent-browser through bx ab. They sign in themselves and ask you for logins and 2FA codes in the chat (T3 Code's request_secret). When a page needs a human (a CAPTCHA), bx handoff gives you a tailnet-only live view (noVNC) and the agent continues when you press Done.

How agents use it: skill/browser/SKILL.md, installed as the browser skill for Claude Code and Codex.

Install

Debian or Ubuntu on x86_64, an always-on server, Node.js 22+, and Tailscale for live views:

curl -fsSL https://github.com/Nand-R/browserd/releases/latest/download/install.sh | bash

It installs the apt packages it needs (Xvfb, x11vnc, noVNC, Chrome's libraries; asks for sudo once), Google Chrome under ~/.local/opt, agent-browser, bx in ~/.local/bin, the skill, and user services. It ends with the one-time Tailscale step for live views.

Several users on one server: each installs their own (one browserd can't share profiles between people). A later install needs no sudo for packages the first one installed, picks the next free live-view ports, and prints its own tailscale serve line for someone with sudo to run. Each sets BX_LIVE_USER to their own tailnet login; otherwise live views only open for the machine's owner.

Updates: a daily timer runs bx update, which installs the latest release when no browser is open (it restarts the service). Run bx update yourself any time. Chrome updates weekly, after the new build passes the bench.

Why it passes bot checks

Measured here, not assumed (bench/RESULTS.md). What decides it is how Chrome is launched, and one CDP command:

  1. Headful (Xvfb), never headless.
  2. No --enable-automation; --disable-blink-features=AutomationControlled.
  3. Timezone matching the exit IP (BX_TZ, default Europe/Amsterdam; a server's UTC fails Cloudflare).
  4. No Runtime.enable: Kasada (and open detectors) catch it, though Cloudflare doesn't. The relay answers agents' Runtime.enable itself, so agent-browser's console, errors and eval inside a selected frame don't work.

Parts

Path What
src/browser.rs Launch: Xvfb (-displayfd) + Chrome flags + TZ, stable CDP port per profile, x11vnc for handoffs, the challenge detector
src/daemon.rs bx serve: control API on a 0600 unix socket, live view on 127.0.0.1:7651, idle reaper, handoffs (30 min TTL)
src/bench.rs bx bench: runs sites/*.toml through the same launch; signed-in cases run in the service's browser
src/recipe.rs bx run: replays a saved recipe (an agent's steps for a repeat task) and returns items checked against its JSON Schema; fails at the step the page no longer matches
src/secrets.rs bx secret, bx totp: 0600 TOML files in ~/.config/browserd/secrets
sites/ One file per site case
bench/recipes/ The recipes from the real test (Meta and LinkedIn Ad Library); examples for the skill
bench/probe/ Python engine-comparison matrix (Patchright, Camoufox, nodriver, Playwright); diagnostics only
ops/ systemd units: the service, the Chrome updater (weekly), bx update (daily)
install.sh Install and update from a release (also what bx update runs)

Develop

The maintainer's setup runs from a checkout (agents working on it: AGENTS.md):

cargo install --path . --root ~/.local          # -> ~/.local/bin/bx
ln -sf ~/browserd/ops/browserd.service ~/.config/systemd/user/
# Who may open live views. Required on a tagged node (it has no owner login):
mkdir -p ~/.config/systemd/user/browserd.service.d
printf '[Service]\nEnvironment=BX_LIVE_USER=<you>@github\n' > ~/.config/systemd/user/browserd.service.d/live-user.conf
systemctl --user enable --now browserd
tailscale serve --bg --https=8446 http://127.0.0.1:7651   # live view, tailnet only
ln -sfn ~/browserd/skill/browser ~/.agents/skills/browser
ln -sfn ~/browserd/skill/browser ~/.claude/skills/browser
ln -sf ~/browserd/ops/update-chrome.{service,timer} ~/.config/systemd/user/
systemctl --user enable --now update-chrome.timer  # weekly; benches the new Chrome, then swaps the symlink (no restart)

Needs: Xvfb, x11vnc, novnc (apt), Google Chrome unpacked in ~/.local/opt/chrome-versions/<ver>, with ~/.local/opt/google-chrome a symlink to the current one (or BX_CHROME). Browsers pick up a new Chrome when they next launch.

Settings: env on the service, in a drop-in like ~/.config/systemd/user/browserd.service.d/*.conf: BX_TZ (Europe/Amsterdam), BX_MAX (4 browsers), BX_IDLE_MIN (30), BX_HANDOFF_MIN (30), BX_LIVE_PORT (7651), BX_LIVE_HTTPS_PORT (8446), BX_LIVE_URL, BX_LIVE_USER, BX_CHROME, BX_GPU (0 forces software WebGL).

Data: profiles in ~/.local/share/browserd/profiles/<name> (0700), Chrome logs in …/browserd/logs, bench rows in …/browserd/bench.jsonl, recipes in …/browserd/recipes, secrets in ~/.config/browserd/secrets (0600).

Known limits

  • Stored logins filled with "$(bx secret get …)" pass through bx's and agent-browser's arguments, which other local users can read in /proc (agents may read stored logins by design).
  • Chrome's CDP port, the X displays and 127.0.0.1:7651 are reachable by other local users on this host. Fine while only trusted users have shells here. x11vnc listens only on a unix socket during a handoff. Over the tailnet, a live view needs Tailscale's login header matching the machine owner (BX_LIVE_USER); proxied requests without it (tagged devices, the node itself) are refused.
  • WebGL runs on the GPU when the service's user can open /dev/dri/renderD* and a hardware Vulkan driver is installed (bx list shows "gpu": true); otherwise in software (SwiftShader), which takes ~13 cores for what the GPU does with 0.7 on WebGL-heavy pages. Ordinary pages cost the same either way. To enable, once with sudo: apt install mesa-vulkan-drivers, then either add the user to render (takes effect after their systemd user session restarts) or grant it directly: setfacl -m u:<user>:rw /dev/dri/renderD128 plus a udev rule to keep it (SUBSYSTEM=="drm", KERNEL=="renderD*", RUN+="/usr/bin/setfacl -m u:<user>:rw /dev/%k").
  • One rule keeps the user's screen and keystrokes theirs during a handoff: while their live view is connected, every agent's command on that profile gets "Your user is in a live view ...; retry in a minute" (agent-browser can't wait longer than 5-8 s, so the relay refuses instead of holding). The live page pauses while hidden or after 2 min without their input, and the service drops a viewer silent for 60 s, so a forgotten one doesn't block agents. Agents run while no view is connected and may cover their window; when their view connects, the window they last had (the handoff tab, its sign-in popup or file picker at first) goes back on top. Pages that take focus by themselves while they watch (a timer's alert) are not stopped.
  • No window manager. bx ab reaches Chrome through a relay in the service that opens every tab an agent creates in its own window (Chrome only draws each window's front tab); The user's ctrl+T and pages' popups stay in their window. OAuth popups open as separate windows; add a bench case when one breaks.

License

AGPL-3.0. Use and change it freely; if you distribute it or offer it as a service, publish your source under the same license.

About

Signed-in, bot-check-passing Chrome for AI coding agents on a Linux server

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages