AgentLane

Documentation

Everything needed to install AgentLane, connect an agent and recover when something goes wrong. Status labels used below: Supported tested in this repository, Experimental works but is not certified, Unsupported / Untested.

Overview

AgentLane is a Chrome extension plus a local MCP (Model Context Protocol) server. It gives an agent its own lane: a separate Chrome window inside your existing profile, where the agent gets real screenshots and sends clicks, typing and scrolling to a tab it owns. Your keyboard and pointer keep driving your own window.

It solves a specific conflict: an agent that controls the desktop browser competes with you for focus and input. AgentLane separates the input surface from the authentication store: the agent shares your logins (the Chrome profile) but not your keyboard, pointer or tabs.

Diagram: your keyboard and mouse control your usual Chrome window; the agent uses screenshots and tab-targeted input in a separate restored window; both share the existing Chrome profile.
Overview diagram. This is a diagram, not a screenshot.

Status: Experimental. A tested path exists on normal Chrome 157 (see the evidence log), but native dialogs, popups, individual Space transitions and arbitrary sites are not universally isolated.

Requirements & support

SurfaceStatusNotes
macOS + Google ChromeSupportedTested on Chrome 157 (normal profile) and Chrome for Testing 159 (disposable).
Node.jsSupported22 or newer.
Codex (MCP, stdio)SupportedFull protocol path tested. Does not replace Codex's native computer use.
Claude Code (MCP, stdio)SupportedVerified on 2.1.326: registration, tool discovery and an open → screenshot → close run.
Other stdio MCP clientsUntestedExpected to work: standard tool and image content. Coordinate reading depends on the model.
Standard HTML selectsSupportedRendered in-page; requires Chrome 134+ (appearance: base-select).
Linux ChromiumUntestedNeeds a custom manifest directory and a short owner-only AGENTLANE_STATE_DIR.
WindowsUnsupportedUnix socket and installer need a Windows transport.
Other Chromium browsers, Firefox, SafariUnsupportedUnverified or would need a different input backend.
Native menus, file pickers, permission sheets, passkeys, popupsNot isolatedStop the workflow at these boundaries.

What an MCP client needs

  • stdio MCP servers: it must be able to launch node /absolute/path/to/AgentLane/src/mcp.js.
  • Image tool results: it must pass lane_screenshot's image to the model without dropping it.
  • A vision model that can read click coordinates from a 1100 × 760 screenshot.
  • The same Mac that runs Chrome and the extension: the bridge is a local Unix socket, so remote or cloud-hosted agents cannot reach it.

Full matrix: docs/COMPATIBILITY.md.

0.2.0 source is unreleased. The verified store build is still 0.1.1. See the multi-agent scheduling, logical recovery, operation semantics and human takeover guide. Updating this checkout does not update an installed extension.

Install

Required setup. Allow roughly ten minutes. Keep the checkout in place afterward: the native launcher and the MCP configuration refer to its files.

1. Get the code and verify it

git clone https://github.com/orkunkinay/AgentLane.git
cd AgentLane
npm ci
npm test

npm test runs syntax checks and the test suite (policy, framing, native transport, MCP over stdio, recovery). It does not open your Chrome profile.

2. Choose your extension installation

Chrome Web Store — recommended. Chrome delivers store updates automatically.

  1. In your usual signed-in Chrome profile, open AgentLane in the Chrome Web Store.
  2. Click Add to Chrome and review the permission prompt. Remove from Chrome means it is already installed.
  3. Open Chrome's puzzle-piece menu and pin AgentLane. Developer mode is not required.

The store extension ID is mpiigaljakpfmmihkahppdaaccmpgmmk. The extension still needs the local bridge and MCP server below. See the illustrated store setup and migration guide.

Manual download — latest repository changes before store release

Use this option to try repository updates before they reach the store. Changes may not have completed store review and can be less stable. Manual installations do not update automatically.

  1. Download the latest main-branch ZIP, extract it to a permanent folder, and run npm ci and npm test from its root. You can also use the Git checkout from step 1.
  2. Open chrome://extensions, enable Developer mode, click Load unpacked, and select that folder's extension/ subfolder.
  3. Copy that card's own ID and use it in step 3 instead of the store ID. Both routes require the local bridge and MCP server.
Manual installation in a disposable profile: Developer mode, Load unpacked and an example AgentLane extension ID.
Copy your own manual extension ID, not this example or the store ID.

To update, finish active sessions, update the files in the same permanent folder, run npm ci and npm test, then click Reload on the extension card. Restart MCP and reconnect the bridge to load updated local code. See the manual setup guide for updates and safe switching between store and manual copies. Keep exactly one registered origin; do not delete a live socket.

Chrome grants the extension broad debugger access, although AgentLane exposes only a narrow toolset. Review the extension before using it on a real profile. Screenshots may contain private information and reach your configured AI provider.

3. Register the native messaging host

node scripts/install-host.mjs mpiigaljakpfmmihkahppdaaccmpgmmk

The ID must be 32 letters from a to p. The script writes org.agentlane.browser.json into Chrome's NativeMessagingHosts directory (default: ~/Library/Application Support/Google/Chrome/NativeMessagingHosts, overridable as the second argument) and a launcher at ~/.agentlane/native-host that pins your absolute Node path. It refuses to overwrite existing files; finish any active sessions and follow the unpacked-to-store migration instructions. Removing the old extension does not update this registration. Chrome's manifest allows only your exact extension origin.

Already installed the old unpacked extension? Run npm run doctor. Its allowed extension origin must match the copy you chose: the store ID above or your manual copy’s own ID. An old ID can prevent connection even when the workspace window opens. Preserve an active host or another profile's registration.

4. Create the agent window

Click AgentLane in Chrome's toolbar (or the puzzle-piece menu), choose where the agent may start browsing (see Starting websites) review and affirm the screenshot/input disclosure (see privacy), and click Create agent window. A separate window titled AgentLane workspace appears. Keep it restored and unfocused; switch back to your own window. Connected only appears once the local connection is confirmed; otherwise the popup shows Not connected with a retry.

AgentLane setup popup with Selected websites chosen. The empty AgentLane workspace window.

5. Connect your agent

See Connect an agent, then start a fresh conversation so the tools are discovered.

6. First task

Use the agentlane-browser skill. Open https://www.google.com and search for
“Chrome DevTools Protocol”. Use AgentLane lane tools and screenshots only.
Show me the result, then close your owned tab.
AgentLane screenshot showing a recognized synthetic session and Saved: Store installation connected.
Captured through AgentLane with store version 0.1.1 after bridge repair. Synthetic local demo data only; this verifies a visual task, not physical input isolation. Reproduce it with the store setup guide.

Keep typing and clicking in your own window while the agent works. If anything steals focus or switches a Space, treat it as a failed isolation test and stop.

Starting websites Supported

Optional configuration, set in the AgentLane popup under Where can your agent start browsing?

ModeBehavior
Selected websites (default)lane_open and lane_navigate must match a listed website by protocol, hostname and port. Enter one HTTP(S) address per line; a bare domain gets https://. Fresh installs prefill https://www.google.com. localhost and 127.0.0.1 differ.
Any websiteDirect opening and navigation accept any HTTP(S) address without embedded credentials. Tab ownership and focus protections still apply.
https://www.google.com
http://127.0.0.1:8741

Settings persist across popup reopening and browser restarts and can only be changed when no agent sessions are active. Empty or invalid older settings stay in Selected websites mode and never enable Any website. This setting restricts direct opening and navigation only. Links, redirects, iframes and other page requests are not filtered.

AgentLane setup with Any website chosen.

Connect an agent

AgentLane's MCP server is a stdio process: node /absolute/path/to/AgentLane/src/mcp.js. Use absolute paths so the configuration does not depend on your shell's working directory or PATH.

Codex Supported

AGENTLANE_NODE="$(node -p 'process.execPath')"
AGENTLANE_PROJECT="$(pwd)"
codex mcp add agentlane -- "$AGENTLANE_NODE" "$AGENTLANE_PROJECT/src/mcp.js"
codex mcp get agentlane

The last command should report an enabled stdio server named agentlane whose arguments end in src/mcp.js. Install the bundled skill, which teaches the agent the operating rules (it refuses to overwrite an existing skill):

node scripts/install-skill.mjs

This copies skills/agentlane-browser to ~/.codex/skills/agentlane-browser (or under $CODEX_HOME); invoke it as $agentlane-browser. The skill does not create a browser connection by itself. For another skills-compatible agent, pass a destination directory as the last argument.

Claude Code Supported

AGENTLANE_NODE="$(node -p 'process.execPath')"
AGENTLANE_PROJECT="$(pwd)"
claude mcp add agentlane -- "$AGENTLANE_NODE" "$AGENTLANE_PROJECT/src/mcp.js"

Check it with claude mcp get agentlane; it should report Connected. Verified with Claude Code 2.1.326: the eight lane_* tools (shown as mcp__agentlane__lane_*) are discovered, and lane_open → lane_screenshot → lane_close completed against a real lane. Install the bundled skill with node scripts/install-skill.mjs --target claude (copies it to ~/.claude/skills/agentlane-browser); Claude Code lists it and exposes it as /agentlane-browser. The lane tools also work without the skill: just ask for them by name.

Other MCP clients Untested

{
  "mcpServers": {
    "agentlane": {
      "command": "/absolute/path/to/node",
      "args": ["/absolute/path/to/AgentLane/src/mcp.js"]
    }
  }
}

Or, for TOML-configured clients:

[mcp_servers.agentlane]
command = "/absolute/path/to/node"
args = ["/absolute/path/to/AgentLane/src/mcp.js"]

If the agent cannot see lane_* tools, the current conversation does not have AgentLane enabled. Start a fresh conversation with the server enabled. Do not fall back to native desktop control for this workflow.

Using AgentLane

Keep the AgentLane workspace window open, unminimized and unfocused; work in your usual window. Ask the agent for the skill by name and describe the task. The agent loop is: lane_open → lane_screenshot → one input → lane_screenshot → … → lane_close.

SituationWhat to do
Starting a taskAsk for $agentlane-browser in a conversation with the tools available.
FinishingThe agent calls lane_close. The empty lane window stays available.
Lane focused or minimizedSwitch to your own window or restore the lane yourself. The agent must not activate it.
Changing browsing policyClose agent sessions, open AgentLane, change mode or list, click Save starting websites. No reload needed.
Lane window closedClick Create agent window, leave it unfocused, then lane_open again in the same conversation. Old tabs and tokens are gone.
Browser bridge disconnectedClick Connect browser. The existing MCP process reconnects on its next call; use lane_open for a fresh tab. Interrupted actions are never replayed.
Stale frame reportedTake a fresh screenshot before the next input.
Native auth, permission sheet or popupStop at that unsupported boundary and hand off.

Repeatable local demo

A synthetic demo server and a scripted two-minute run exist for verifying your setup without touching real accounts:

node scripts/demo-server.mjs
# in your own Chrome window, visit http://127.0.0.1:8741/seed
# add http://127.0.0.1:8741 under Selected websites, then in another terminal:
node scripts/concurrency-demo.mjs http://127.0.0.1:8741 120

The script reports completed tool calls and saves a final screenshot; whether you were interfered with still needs your own observation. Stop the server with Ctrl+C. See the seven-test acceptance protocol.

Tool reference

Eight tools, defined in src/mcp.js. Coordinates are CSS pixels in a fixed 1100 × 760 viewport at scale 1 (x 0–1099, y 0–759). Tool names may carry a client-specific prefix.

ToolArgumentsBehavior
lane_openurlCreates the connection's one owned tab in the lane and navigates it. URL must pass the starting-website policy.
lane_screenshotnoneReturns a real PNG of the tab's rendered pixels plus a single-use frame token and metadata.
lane_clickframe, x, yLeft-click at a coordinate seen in the latest screenshot.
lane_typeframe, text (≤ 10,000 chars)Inserts text into the already-focused field. No clipboard access.
lane_keyframe, keyEnter, Escape, Backspace, ArrowUp, ArrowDown, ArrowLeft or ArrowRight. Tab is intentionally absent.
lane_scrollframe, x, y, deltaX, deltaYMouse-wheel scroll at a point; each delta from −3000 to 3000.
lane_navigateurlNavigates the owned tab to an HTTP(S) URL permitted by setup.
lane_closenoneCloses only the owned tab. Call when finished.

Not exposed, by design: arbitrary JavaScript, raw CDP, DOM selectors, cookie/storage access, file upload, clipboard, browser shortcuts, and any way to list or select your own tabs.

Concepts

Lane
A dedicated normal Chrome window ("AgentLane workspace") in your existing profile. It must stay restored and unfocused while the agent works; a focused or minimized lane is refused.
Owned tab
Each connected MCP process gets one host-assigned session and one tab created inside the lane. Only that tab can be driven. If it moves to another window, ownership is lost and it is detached, never closed.
Frame token
Every screenshot returns a random single-use token. Each input consumes it, and observed navigation invalidates it. The sequence is screenshot → click → new screenshot → type. Tokens detect reuse and observed navigation; they do not freeze a dynamic page.
Capability gate
The extension worker queues commands, checks window state and tab membership, and applies the starting-website policy before any input reaches the page.
Native host & socket
Chrome starts src/native-host.js as a native messaging host. It listens on an owner-only Unix socket (~/.agentlane/browser.sock, directory 0700, socket 0600). The MCP process connects there. No TCP port is opened.

Deeper reference: docs/ARCHITECTURE.md.

Security considerations

  • AgentLane is a local trusted browser controller, not a sandbox against other processes running as your user, a malicious extension, a compromised Chrome, or an agent that also has shell or desktop tools.
  • No cookie, password or token extraction; no TCP listener; the host's extension-origin allowlist and owner-only socket restrict who can connect.
  • The manifest requests exactly three permissions: debugger (drive the owned tab), nativeMessaging (talk to the local host) and storage (remember starting-website settings and your consent). It requests no host permissions.
  • The extension itself holds broad debugger authority. Review it before use on a real profile.
  • Sharing authentication also shares authority: an agent can perform account actions through visible page UI. Confirm consequential actions under your agent's normal policy.
  • Screenshots and typed text go through your MCP client and may reach its model provider. Page content is untrusted and can attempt prompt injection.
  • Do not use AgentLane for hostile sites or security-critical workflows until remaining browser-UI escape paths are closed.

Full threat table: SECURITY.md. This repository has no hosted security-reporting service yet; when filing bugs provide versions, a synthetic reproduction and redacted logs, never real account screenshots or profiles.

Known limitations

  • Not a general zero-interruption guarantee. Popups, native dialogs, permission sheets, passkeys, file pickers and security interstitials can still activate windows. Popups are neither controlled nor adopted.
  • Individual Space transitions and a fully occluded lane are not certified; blank or stale screenshots count as failures.
  • Profile storage, cookies, service workers and server-side account state are shared between lanes and your tabs.
  • Some sites use tab-local or device-bound authentication that a new lane tab cannot inherit.
  • Tab and browser shortcuts are unavailable; file uploads are not implemented; downloads are not suppressed.
  • A worker restart does not adopt old tabs. Orphaned windows may need manual cleanup.
  • A hung command poisons the lane; recovery needs a new lane window or an extension reload.
  • ChatGPT navigation was blocked in the tested profile (Chrome refuses access to another extension's URL; not bypassed).
  • Redirects are not blocked. Selected websites checks the address the agent asks to open; links and redirects on those pages can lead elsewhere, and Any website allows every HTTP(S) address. Neither is a network policy.
  • The viewport is fixed at 1100×760, so responsive sites render their desktop layout and an element hidden by a sticky banner stays hidden until the agent scrolls.
  • Screenshots reach the model as MCP image results. A client or model that drops images makes the tools unusable, and very large images may hit a client's size limit.
  • The store extension updates through Chrome. Updating local bridge/MCP source requires restarting its running processes after active tasks finish; editing the checkout does not update the installed extension.

Planned work and gates: docs/ROADMAP.md. Measured results and failures: docs/EVIDENCE.md.

Troubleshooting

Start with npm run doctor. It changes nothing and checks Node.js, the host manifest and its extension ID, the launcher and the socket, and prints a fix for each failure. Condensed from the full guide. Never recover by copying cookies, switching to desktop input, or having the agent focus the lane.

“Not connected”, ENOENT, or “Browser bridge unavailable”

The lane window and the browser bridge are separate. Confirm the store extension is installed in the intended profile, that you registered its exact ID with scripts/install-host.mjs, and that ~/.agentlane/browser.sock exists. Then click Connect browser or Create agent window in the popup. Retry lane_open in the same conversation; the MCP client reconnects. Moving the checkout requires re-registering the host after removing the old manifest. Opening anchor.html alone does not connect anything.

Native host not found / forbidden

The manifest must be named org.agentlane.browser, have an absolute launcher path and list exactly your extension origin (no wildcards). The installer targets macOS Google Chrome by default; use --browser=chrome-beta|chrome-canary|chromium|brave|edge for a variant, or pass any manifest directory as the second argument. For the store installation, the single allowed origin must be chrome-extension://mpiigaljakpfmmihkahppdaaccmpgmmk/. Deleting a former unpacked copy does not update its old host registration; follow the migration instructions above.

Node.js not found by Chrome (nvm, asdf, Homebrew)

Chrome starts the host without your shell profile, so version-manager shims are not on its PATH. The installer records the exact Node that ran it, and the launcher falls back to Homebrew locations and then PATH if that file disappears after an upgrade. If both fail it prints a one-line message and exits; re-run scripts/install-host.mjs after changing Node versions. Node.js 22.13 or newer is required.

EADDRINUSE on the socket

Another profile or host may own it. Do not delete a live socket: check ps -axo pid,command for native-host.js. A socket left by a crashed host is detected and reclaimed automatically on the next connect; a live one is never taken over, and the new host then exits with an explanation. If the problem persists, reload the extension and create a fresh lane. A second profile needs a different short AGENTLANE_STATE_DIR set in both the launcher and the MCP environment.

Several Chrome profiles or two agents

One host owns the socket, so a second profile that also enables the extension is refused until you give it its own short AGENTLANE_STATE_DIR. Several agents on one lane each get their own tab and cannot see or close each other's; if an agent disconnects without calling lane_close, the host tells the extension and that tab is closed.

Login walls, CAPTCHAs and two-factor prompts

AgentLane uses your profile's existing sign-in. It does not solve CAPTCHAs or approve second factors, and the agent is told to stop and ask you. Complete those steps in your own window, then ask the agent to continue.

Agent obeys text on a web page

The MCP server instructs the agent to treat page content as untrusted data and to ask before purchases, messages, deletions, account changes or entering credentials. That reduces prompt-injection risk but cannot remove it. Use Selected websites, and keep sensitive accounts out of the profile you share.

Lane focused or minimized

Switch back to your own window or restore the lane manually, then retry. The agent must not fix this itself.

Blank or stale screenshot

Report it as a rendering failure and keep the lane restored and visible: a window that is covered, on another Space or minimized can stop rendering, and the command then times out. The viewport is fixed at 1100×760 at scale 1, so coordinates match the screenshot on Retina displays too. Use the disposable harness (npm run test:browser) to tell Chrome rendering apart from the target site. Never substitute DOM snapshots or bring Chrome forward.

Renderer timeout

A command deadline detaches the debugger and poisons the lane. Close the identified AgentLane window, create a new one (or reload the extension) and call lane_open again. The hung command is not replayed.

Stale frame

The rejected input was not dispatched. Take a fresh screenshot before each click, type, key or scroll. Do not blindly replay an input that may have completed.

Unapproved starting origin

Add the exact origin, including port, under Selected websites (after closing active sessions) or choose Any website, then Save starting websites. No reload is needed.

Agent still uses native computer use

The MCP server is a separate toolset. Start a conversation with AgentLane enabled and explicitly ask for the lane tools.

Selecting an option switches windows

Older builds opened Chrome's native select menu. Finish active tasks, reload the extension, create a new lane and start a fresh MCP conversation. If a native picker is still blocked, stop that dropdown workflow.

Not authenticated on a site

Confirm the extension runs in the profile with the login. Persistent cookies usually apply to new tabs; tab-local sessionStorage, expired or device-bound sessions and fresh consent may not. Do not copy cookies or fall back to a fresh browser.

Uninstall

  1. Disable or remove the extension at chrome://extensions.
  2. Remove the agentlane entry from your agent's MCP configuration.
  3. Remove ~/Library/Application Support/Google/Chrome/NativeMessagingHosts/org.agentlane.browser.json.
  4. Close only windows you recognise as AgentLane lanes. Once the native host has exited, remove ~/.agentlane/native-host and any stale ~/.agentlane/browser.sock.

Do not delete Chrome profile files. Upgrading from the former Still installation: see the migration guide.

0.2.0 coordination preview

Unreleased source; the published 0.1.1 extension does not include these changes. The local native host now coordinates bounded per-agent queues, private session capabilities and an operation metadata journal. Independent tab input can overlap; screenshots share a staging mutex.

Multiple MCP adapters share the native broker and extension ownership gate; the human keeps a separate window in the same authenticated profile.

Opt in to reconnectable sessions with node scripts/create-session.mjs /private/path/session.json and set AGENTLANE_SESSION_FILE for that MCP process. Use a separate private file per agent. After reconnecting, lane_open recovers the exact surviving capability without navigating, then requires a fresh screenshot. Worker or Chrome capability loss fails closed; it does not adopt tabs from saved IDs.

The popup offers Take control, explicit Hand back to agent, Release tab to me and Observe only. Wait for HUMAN_CONTROL before acting. Return to your own window before handback. Delayed agent commands are fenced; already-dispatched effects cannot be undone.

Unknown mutation outcomes are never replayed automatically. Authentication and account effects remain shared. Native dialogs, popups, arbitrary-site isolation and full browser-restart restoration remain limitations. Read coordination and recovery and the implementation report before testing source in a disposable profile.

Develop & verify

npm test                  # syntax checks + unit/IPC/MCP tests
npm run format:check      # prettier
npx playwright install chromium
npm run test:browser      # real chrome.debugger in a disposable profile
node experiments/setup.mjs     # setup popup flows
node experiments/dropdown.mjs  # select dropdown isolation

Browser experiments use a disposable Chrome for Testing profile, never your own. Headed macOS observation (foreground app, pointer, Spaces) is described in docs/VALIDATION.md. This website itself is static: python3 -m http.server in the repository root serves it, and npm run check:site validates its links.

Contributing: CONTRIBUTING.md. Never commit profiles, cookies, tokens or screenshots of real accounts.

More reading