An agentic browser harness: an AI side panel & orb in your own logged-in Chrome, Edge, Arc, Brave or even Firefox run by the agent/subscription you already use (Claude Code, Codex, Antigravity). Free, open source, no API key. Also an MCP server.
TypeScript agentic-browseragentic-browsingagy-cliaiai-agentai-browser-extensionai-toolsbrave-extensionbrowser-agentbrowser-automationbrowser-extensionbrowser-usebrowserskillchrome-extensionclaude-codecodexfirefox-addonmcp-servernanobrowserweb-automation
docs: say Windows is experimental — what an npm-installed agent runs as there, the 32,767-character command line, the containment not yet measured there, and the two errors a Windows user can meet
Shahriarec33543c5011
diff --git a/README.md b/README.mdindex 2971786..b582338 100644--- a/README.md+++ b/README.md@@ -46,7 +46,7 @@ Also an optional [MCP server](docs/guide/mcp-clients.md), so any MCP client can## Quick Start-**Any platform** — with [Node.js](https://nodejs.org) 20 or newer:+**Any platform** — with [Node.js](https://nodejs.org) 20 or newer (Windows is [experimental](docs/guide/limits.md#windows-is-experimental)):```shnpx browsentic setupdiff --git a/docs/guide/agents.md b/docs/guide/agents.mdindex 6caef78..3f58a3a 100644--- a/docs/guide/agents.md+++ b/docs/guide/agents.md@@ -307,7 +307,7 @@ In `~/.browsentic/config.json`:| Key | Default | Effect || --- | --- | --- || `agent` | `claude` | Which CLI the side panel runs on. The agent picker writes this. |-| `agents.<name>.bin` | the CLI's own command name | Absolute path to the binary. Set this when the daemon's `PATH` differs from your shell's — the usual cause of `AGENT_MISSING`. |+| `agents.<name>.bin` | the CLI's own command name | Absolute path to the binary. Set this when the daemon's `PATH` differs from your shell's — the usual cause of `AGENT_MISSING`. On Windows it may name the `.cmd` npm installed, or the `.exe` itself. || `agents.<name>.model` | `sonnet` for Claude, otherwise the CLI's own default | Passed as `--model`. The picker's model select writes this. A value that starts with a dash or holds a space is ignored, so a typo cannot pass the CLI a flag. || `agents.<name>.effort` | unset | Passed as that CLI's reasoning-effort flag. A value the CLI does not accept is dropped rather than failing the run. |@@ -333,6 +333,8 @@ Claude runner's settings.| Grok Build sits silent for minutes, then *xAI did not answer* | The Grok account is rate-limited — a free one usually is. Wait, or upgrade the account. || Cursor CLI: *Authentication required* | The daemon inherits no session. Run `cursor-agent login`, or set `CURSOR_API_KEY`, then retry. || Cursor CLI on Windows | Cursor's sandbox has no Windows backend, so only the deny rules apply there. The browser still works; the machine is less fenced off than on macOS or Linux. |+| Windows: `AGENT_UNUSABLE`, *a batch file Browsentic cannot see through* | The agent's command is a batch file that is not an npm or pnpm shim. Set `agents.<name>.bin` to the `.exe` it runs. |+| Windows: *This turn is too long for Windows to start* | Codex's `exec` fallback, Qwen Code and Grok Build pass the prompt as an argument, which Windows caps at 32,767 characters. Start a new conversation, or leave out long site notes and attachments. See [Limits](limits.md#windows-is-experimental). || `AGENT_UNSAFE`: *Grok Build offered this run …* | Grok offered tools Browsentic never asks for, so the run was stopped before the model saw them. Update Grok Build and Browsentic, and report it if it persists. || Qwen Code: *No auth type is selected* | Qwen has no provider configured, and its OAuth free tier has ended. Run `qwen` and use `/auth`, or export `OPENAI_API_KEY` with `OPENAI_BASE_URL`. || Qwen Code cannot find a key you have exported | Only `QWEN_*`, `DASHSCOPE_*`, `BAILIAN_*` and `OPENAI_*` reach a run; `ANTHROPIC_*` and `GEMINI_*` are sealed away. Point Qwen at one of the first four. |diff --git a/docs/guide/install.md b/docs/guide/install.mdindex 351a61b..1fe8b78 100644--- a/docs/guide/install.md+++ b/docs/guide/install.md@@ -14,7 +14,7 @@ AI agent you already run locally.| --- | --- | --- || **Node** | 20 or newer | `node --version` || **Browser** | Chrome or another Chromium browser (Edge, Brave, Arc), or Firefox 140 or newer | — |-| **System** | macOS, Windows or Linux. macOS also has an [app](mac-app.md) | — |+| **System** | macOS or Linux; Windows 10 or 11 is [experimental](limits.md#windows-is-experimental). macOS also has an [app](mac-app.md) | — || **Agent** | One of [Claude Code](https://claude.com/claude-code), [Codex](https://developers.openai.com/codex/cli), [Antigravity](https://antigravity.google/docs/cli/install), [Mistral Vibe](https://github.com/mistralai/mistral-vibe) (beta), [Grok Build](https://docs.x.ai/build/overview) (beta), [Cursor CLI](https://cursor.com/docs/cli/overview) (beta), [Qwen Code](https://qwenlm.github.io/qwen-code-docs/en/) (beta) or [OpenCode](https://opencode.ai/docs/cli/) (beta) on your `PATH`, logged in | `claude --version`, `codex --version`, `agy --version`, `vibe --version`, `grok --version`, `cursor-agent --version`, `qwen --version`, `opencode --version` |Two things worth knowing before you start:diff --git a/docs/guide/limits.md b/docs/guide/limits.mdindex 7d0d47c..4029660 100644--- a/docs/guide/limits.md+++ b/docs/guide/limits.md@@ -95,6 +95,27 @@ yet, so the popup, the docs and the release notes say *beta*. What that means in[Choosing an agent](agents.md) has the per-agent detail. Please report what you find.+## Windows is experimental++The daemon runs on Windows and its tests run there on every change, but nobody has yet taken the+whole of it — setup, pairing, a side-panel run, a cancelled one — through a Windows desktop. Until+someone has:++- **An agent installed with npm is started through the program its `.cmd` names**, never through+ `cmd.exe`, which can pass neither a prompt's many lines nor page text intact. A batch file that is+ not an npm or pnpm shim is reported as *unusable*: set that agent's `bin` to the `.exe` it runs.+- **A command line holds at most 32,767 characters.** Claude Code takes its message on stdin and its+ prompt from a file, so it never meets the limit. Codex's `exec` fallback, Qwen Code and Grok Build+ pass the prompt as an argument, and a turn with long site notes, attached files or fetched data can+ pass it; that run fails saying so, before anything starts.+- **Containment is less proven.** Cursor's kernel sandbox has no Windows backend, so only its deny+ rules apply. Codex's read-only sandbox and Grok's workspace sandbox have not been measured on+ Windows; treat either as less fenced off there than on macOS or Linux.+- **Stopping a run ends the agent and everything it started at once**, because Windows has no signal+ a CLI could clean up on.++Please report what you find.+## MCP clients cannot answer a promptAnything the policy would confirm resolves to **deny** for an external MCP client, because there isdiff --git a/docs/guide/troubleshooting.md b/docs/guide/troubleshooting.mdindex 72dfc6b..6770ac2 100644--- a/docs/guide/troubleshooting.md+++ b/docs/guide/troubleshooting.md@@ -37,7 +37,7 @@ Those three answer most questions. The daemon log also lives at `~/.browsentic/d| The panel stays offline after `browsentic stop` | A stop holds the browser's wake-up, so the daemon stays down as asked | `browsentic start`. `browsentic status` says `held` while it lasts || A scheduled task shows **Missed** | The browser was closed, the computer asleep, or no daemon was running at that time | Nothing to fix — it runs once when things are back unless the task says **Skip it**. `browsentic status` shows whether the browser can start the daemon itself || "Load unpacked" cannot see `~/browsentic` | A Flatpak or Snap browser, sandboxed away from your home directory. Snap Chromium is the Ubuntu default | Grant it: `flatpak override --user --filesystem=~/browsentic com.google.Chrome`. Or install somewhere the sandbox can read: `browsentic setup --dir ~/snap/chromium/common/browsentic-extension` |-| The folder picker does not show `~/browsentic` | It is there; some pickers open elsewhere by default | macOS: press ⇧⌘G and paste the path. Linux: Ctrl+L |+| The folder picker does not show `~/browsentic` | It is there; some pickers open elsewhere by default | macOS: press ⇧⌘G and paste the path. Linux: Ctrl+L. Windows: paste `%USERPROFILE%\browsentic\extension\chrome-mv3` into the picker's address bar || Updated with `npx`, but the browser still runs the old build | Chrome never auto-reloads an unpacked extension | `browsentic status` names both versions. Press ↻ on the Browsentic card || `browsentic update` says "already current" forever, and reinstalling still lands on an old build | npm's `npx` cache serves the version it first resolved and never asks the registry again | `browsentic update` now replaces the cached command before installing. To clear it by hand, delete every `~/.npm/_npx/*` directory containing `node_modules/browsentic` || Deleted `~/.browsentic`, but a daemon is still holding port 8765 | The lockfile went with it; the process did not notice | `browsentic stop` probes the ports rather than the lockfile, so it finds that one. `browsentic uninstall` does it as part of the sweep |@@ -78,6 +78,8 @@ Those three answer most questions. The daemon log also lives at `~/.browsentic/d| Cursor CLI fails with *Authentication required* | The daemon inherits no session | `cursor-agent login`, or set `CURSOR_API_KEY` || Cursor CLI reaches an MCP server you did not expect | A project `.cursor/mcp.json` does not replace your global one, so every server you gave Cursor loads too | Browsentic denies each by name for the run; if one still answers, update Browsentic and report it || Cursor CLI is less fenced off on Windows | Cursor's kernel sandbox has no Windows backend | Nothing to do — the deny rules still apply; treat a Windows run as `host`-class |+| Windows: `AGENT_UNUSABLE`, *a batch file Browsentic cannot see through* | The agent's command is a batch file that is not an npm or pnpm shim, and Browsentic never runs one through `cmd.exe` | Set `agents.<name>.bin` to the `.exe` it runs |+| Windows: *This turn is too long for Windows to start* | Codex's `exec` fallback, Qwen Code and Grok Build pass the prompt as an argument, and Windows caps a command line at 32,767 characters | Start a new conversation, or leave out long site notes, attached files or fetched data. Claude Code is not affected || `AGENT_UNSAFE`: *Grok Build offered this run …* | Grok offered tools Browsentic never asks for, so the run was stopped before the model saw them | Update Grok Build and Browsentic; report it if it persists || Qwen Code fails with *No auth type is selected* | Qwen has no provider configured, and its OAuth free tier ended on 2026-04-15 | Run `qwen` and use `/auth`, or export `OPENAI_API_KEY` with `OPENAI_BASE_URL` || Qwen Code cannot see an API key you exported | Only `QWEN_*`, `DASHSCOPE_*`, `BAILIAN_*` and `OPENAI_*` reach a run; the rest are sealed away | Point Qwen at one of those four providers |diff --git a/docs/internals/agent-runs.md b/docs/internals/agent-runs.mdindex f91d792..00d66a3 100644--- a/docs/internals/agent-runs.md+++ b/docs/internals/agent-runs.md@@ -87,7 +87,8 @@ and shown the same way, and its result is sealed, fenced and turned into a pictu[`src/daemon/agent/runners/`](../../src/daemon/agent/runners/) — which turns it into an argv, a workingdirectory and any files that CLI reads from disk. A shared driver (`runners/drive.ts`) does thespawning, the abort wiring and the line reading; the runner only decides *what to say* and *how to-read the answer back*.+read the answer back*. The driver starts every CLI through `runners/command.ts`, the only place an+agent CLI is spawned or stopped — see [Windows](#windows).**Adding an agent is one file plus one line in `runners/index.ts`.**@@ -95,9 +96,9 @@ Every runner is given the same five things, by whichever mechanism its CLI suppo| | Claude Code | Codex | Antigravity | Mistral Vibe | Grok Build | Cursor CLI | Qwen Code | OpenCode || --- | --- | --- | --- | --- | --- | --- | --- | --- |-| Run | `claude -p --output-format stream-json` | `codex app-server`, held over stdin for the turn; `codex exec --json` when it is refused, when `agents.codex.transport` is `"exec"`, and for one-shots | `agy -p --output-format stream-json` | `vibe --prompt … --output streaming --trust --agent ask` | `grok -p --output-format streaming-json` | `cursor-agent -p --output-format stream-json --stream-partial-output` | `qwen -p --output-format stream-json --include-partial-messages` | `opencode run --format json --pure --agent browsentic-contained` |+| Run | `claude -p --output-format stream-json`, the message on stdin | `codex app-server`, held over stdin for the turn; `codex exec --json` when it is refused, when `agents.codex.transport` is `"exec"`, and for one-shots | `agy -p --output-format stream-json` | `vibe --prompt … --output streaming --trust --agent ask` | `grok -p --output-format streaming-json` | `cursor-agent -p --output-format stream-json --stream-partial-output` | `qwen -p --output-format stream-json --include-partial-messages` | `opencode run --format json --pure --agent browsentic-contained` || MCP server | `--mcp-config` + `--strict-mcp-config` | none: the tools go to `thread/start` as `dynamicTools`, and each of the user's servers is switched off in the thread's config. `exec`: `-c mcp_servers.browsentic.*` under `--ignore-user-config`, with `default_tools_approval_mode="approve"` — headless Codex refuses any MCP call it would have prompted for | `.agents/mcp_config.json` in its cwd | `.vibe/config.toml` in a folder per conversation, every tool granted by name | `.grok/config.toml` in its cwd, loaded with `GROK_FOLDER_TRUST=0`, and approved with `--allow MCPTool(browsentic__*)` | `.cursor/mcp.json` in a folder per conversation, allowed as `Mcp(browsentic:*)` with every other server denied by name | `--mcp-config` + `--allowed-mcp-server-names`, under `--safe-mode`, which drops the ones on disk | `mcp.browsentic` in `OPENCODE_CONFIG_CONTENT`, each tool allowed by name on the run's own agent |-| System prompt | `--append-system-prompt`, kept from the first turn ([below](#a-prompt-the-session-keeps)) | `developerInstructions` on `thread/start` (`-c developer_instructions` on `exec`), kept from the first turn | `AGENTS.md` in its cwd | `AGENTS.md` beside its config | `--rules` | `AGENTS.md` in its cwd | `--append-system-prompt` | a file in a folder per conversation, named in the config's `instructions` — never the config itself, which OpenCode expands `{file:…}` in |+| System prompt | `--append-system-prompt-file`, a file per run, kept from the first turn ([below](#a-prompt-the-session-keeps)) | `developerInstructions` on `thread/start` (`-c developer_instructions` on `exec`), kept from the first turn | `AGENTS.md` in its cwd | `AGENTS.md` beside its config | `--rules` | `AGENTS.md` in its cwd | `--append-system-prompt` | a file in a folder per conversation, named in the config's `instructions` — never the config itself, which OpenCode expands `{file:…}` in || Follow-up turns | `--resume <session>` | `thread/resume` (`exec resume <thread>`); either resumes a thread the other began | `--conversation <id>` | `--resume <session>`, re-read from the folder the session began in | `--session-id <uuid>` names it, `--resume <uuid>` continues it, in a folder named after it | `--resume <session>` | `--session-id <uuid>` names it, `--resume <uuid>` continues it | `--session <id>`, from a session store of Browsentic's own (`OPENCODE_DB`) || Kept off the machine by | `--allowedTools` + `--disallowedTools` | the user's MCP servers off (`--ignore-user-config` on `exec`), `-c sandbox_mode="read-only"`, `-c approval_policy="never"`, `-c features.shell_tool=false`, `-c features.view_image=false`, `-c features.multi_agent=false` | its own permission rules | `--enabled-tools`, which is an allowlist | `--tools`, `--permission-mode dontAsk`, `--deny`, `--sandbox workspace` | deny rules in `.cursor/cli.json`, plus `--sandbox enabled` | `--safe-mode`, `--exclude-tools`, `--approval-mode default` | an agent whose permission opens on `"*": "deny"`, `--pure`, `OPENCODE_DISABLE_PROJECT_CONFIG`, `OPENCODE_DISABLE_SHARE` |@@ -217,6 +218,27 @@ What the spawned process may touch on the machine is a separate concern with itspoint — see [Guardrails § Spawn containment](guardrails.md#spawn-containment). It is vetted at`launch()`, before `spawn()`, and a plan that has lost its containment does not start.+### Windows++`spawnCli()` and `stopTree()` in `runners/command.ts` start and stop every agent CLI — a run, a+one-shot, the readiness probe, a model list — and are where Windows differs:++- **An npm install is a batch file.** `codex` is `codex.cmd`, which `spawn()` does not find on+ `PATH` and refuses to run without a shell. A shell is no answer: a prompt runs to many lines,+ which `cmd.exe` cannot pass as one argument, and it carries page text, which `cmd.exe` would+ interpret. `resolveCommand()` looks the command up by `PATHEXT`, reads an npm or pnpm shim, and+ starts what it names — the `.exe`, or the script under the daemon's own Node. Any other batch file+ is `AGENT_UNUSABLE`, naming the `bin` setting to change.+- **A command line is capped at 32,767 characters**, and one past it fails `AGENT_FAILED` before+ anything starts. Claude Code takes its message on stdin (`Plan.input`) and its prompt from a file,+ so no turn reaches the cap; Codex's `exec` fallback, Qwen Code and Grok Build still pass the+ prompt in argv.+- **No console window.** The daemon has none, so every spawn passes `windowsHide`.+- **No signals.** A kill ends one process and leaves what it started running, so `stopTree()` ends+ the whole tree with `taskkill /T /F`, at once, and `browsentic stop` does the same to the daemon.+ `browsentic mcp` exits when its stdin closes, on every platform, so a server whose client was+ killed does not hold its socket to the daemon.+---## Prompt assembly@@ -306,7 +328,7 @@ panel ──attach────► background ──indexFile sessioutline, facts, notes, coverage — or a `rejected` verdict when the file will not open.`validateFileReport()` clamps every field, and an answer that does not parse is `failed`.3. **Ending it.** `runJson()` takes an `accept` callback: the moment stdout holds an answer it- accepts, the task settles and the CLI is stopped (SIGTERM, then SIGKILL after 5 s) rather than+ accepts, the task settles and the CLI is stopped (SIGTERM, then SIGKILL after 5 s; on Windows, its whole tree at once) rather thanwaited out. `finally` deletes the scratch copy and drops the registry entry; the report alone iskept for up to two minutes, for a turn sent while it was still being written. Claude Code is runwith `--no-session-persistence` and Codex with `--ephemeral`, so neither keeps the session; thediff --git a/docs/internals/guardrails.md b/docs/internals/guardrails.mdindex 4f41a6d..55c0df4 100644--- a/docs/internals/guardrails.md+++ b/docs/internals/guardrails.md@@ -327,7 +327,9 @@ and no argument matching `FORBIDDEN` — `--dangerously*`, `--yolo`, `--always-a`sandbox_mode=` or `approval_policy=` override that is not `"read-only"` / `"never"`,`--permission-mode=bypassPermissions`, and friends. Every pattern ischecked against every runner, not just the one that owns the flag: the cost is nothing and it covers-the runner nobody has written yet.+the runner nobody has written yet. Last, the working directory has to lie inside `~/.browsentic`, by+the platform's own path rules — Windows spells a path with backslashes and compares it case-blind,+and a `..` climbs out whatever the prefix says.`NEVER = ['Bash', 'Edit', 'Write', 'NotebookEdit', 'Glob', 'Grep', 'Task']` — local tools no run mayhave, whatever else it is allowed.@@ -349,6 +351,12 @@ type LocalTools = 'allowlist' | 'sandbox' | 'host'| **Cursor CLI** | `allowlist` | Deny rules in a project `.cursor/cli.json`, where **a deny beats every allow** — including the user's own. Measured against 2026.09.18: a headless run asked to `echo` a marker got `permissionDenied`, twice, and gave up. `--sandbox enabled` is asked for as well but not depended on, and it has no Windows backend. This is the first runner whose containment lives in a file rather than in argv, which is why `vetPlan` checks file *content* and not only that the file was written. `--trust` is **required**, not forbidden: headless Cursor refuses to start in a folder nobody trusted, and the folder is one Browsentic created and wrote every file in — it grants no tool permission of its own || **OpenCode** | `allowlist` | The run is an agent the config defines, whose permission ruleset opens on `"*": "deny"` and then allows each browser tool by name. OpenCode applies the last rule that matches and puts an agent's rules after the user's, so every other tool — built-in, custom, another MCP server's, or one a later release adds — is denied, and a tool denied outright is never offered to the model. `--pure` keeps plugins out, which run inside OpenCode and can answer its permission prompts. MCP servers the user set up in OpenCode itself still start, with their tools hidden |+**Windows is less measured.** Cursor's kernel sandbox has no Windows backend, so only its deny rules+apply there. Codex's `sandbox_mode="read-only"` and Grok's `--sandbox workspace` are asked for as on+macOS and Linux, but neither has been measured on Windows; treat a Windows run of either as+`host`-class until it has. The spawn itself is covered in+[Agent runs § Windows](agent-runs.md#windows).+#### Grok Build, and why not always-approveHeadless Grok is usually run with `--always-approve`, which hands it the machine. Browsentic usesdiff --git a/docs/reference/errors.md b/docs/reference/errors.mdindex 774f20b..9c9c808 100644--- a/docs/reference/errors.md+++ b/docs/reference/errors.md@@ -76,7 +76,7 @@ repeatedly: failures carry the *fix* in the message, and a failed tool call neve| --- | --- | --- || `AGENT_MISSING` | Runner | The chosen agent's binary is not on the *daemon's* `PATH`. Set `agents.<name>.bin` to an absolute path || `AGENT_NEEDS_PERMISSION` | Runner | Antigravity has no rule allowing Browsentic's MCP tools (`browsentic agent fix antigravity`), Grok Build or Cursor CLI is not signed in (`grok login`, `cursor-agent login`), Qwen Code has no model provider configured (`qwen`, then `/auth`), or OpenCode is signed in to no provider (`opencode auth login`) |-| `AGENT_UNUSABLE` | Runner | The CLI is present but cannot run — usually too old for the flags Browsentic passes |+| `AGENT_UNUSABLE` | Runner | The CLI is present but cannot run — usually too old for the flags Browsentic passes. On Windows, also a batch file that is not an npm or pnpm shim: set `agents.<name>.bin` to the program it runs || `AGENT_UNSAFE` | Runner | The run was stopped before the agent could act on the machine: its plan had lost its containment, which is a bug in Browsentic, or the CLI itself said it had not applied it — Grok Build offering tools Browsentic never asks for, Qwen Code reporting a denied tool or a second MCP server as registered, OpenCode reporting that a tool outside the browser ran, or Codex running a shell command or changing a file with both switched off. Update both, and report it |## Guardrails