Skip to main content
Blitz
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage
Edit page

050 · The agent's browser in the app

With the desktop app open, the agent browses in a view of the app’s own, which you can watch, or silently; without it, headless Chrome as before (spec_050_agent_browser)

Status Built (v0.8.4, the owner’s request: “I like the idea of the agent driving the built-in browser, but it should offer to do it silently”)
Source pkg/engine/browser (Transport, AttachTransport, Options.KeepViewport), pkg/engine/agentbrowser.go (the windows and the relays), pkg/engine/tools/browser.go (show, the view or Chrome), AgentBrowserHost in pkg/engine/tools/registry.go, WorkspaceService.WatchAgentBrowser and AgentBrowserReply (pkg/service/server/workspace.go); the page’s agentBrowserRelay.ts, Workspace.tsx, files/WebPreview.tsx (the bar), files/useEditor.ts (openAgentWeb), BrowserSettings.tsx; the Electron app’s AgentBrowserOpen, AgentBrowserSend, AgentBrowserClose, AgentBrowserTakeOver (apps/electron/src/main.ts, logic.ts)
Tests pkg/engine/agentbrowser_test.go, pkg/engine/tools/browser_test.go (TestBrowserToolInTheApp), apps/desktop/web/src/agentBrowserRelay.test.ts, apps/electron/src/logic.test.ts (the agent’s view), pkg/service/server/browserprofiles_test.go (browser.show, browser.open), pkg/engine/tools/openpage_test.go (AB-10–AB-12), pkg/engine/agentbrowser_test.go (TestOpenPageInTheWindow)
Depends on spec_008_web (the browser tool, WEB-30–38), spec_038_electron (the window, EL-100 previews), spec_049_browser_profiles (profiles)

1. Purpose

The browser tool drove a headless Chrome of its own: nothing to see, and none of the app’s sign-ins. With the app open it should browse where the user can see it, or out of sight when they’d rather.

2. How it’s carried

  • AB-01 A window of the app, for each workspace it shows, watches WorkspaceService.WatchAgentBrowser (a stream: streams over polling, so it works with a service elsewhere) and is a host of the agent’s views; the newest window hosts new ones. When the browser tool needs a browser and a window is there, the engine asks it for a view (open: watched or silent, the workspace’s profile, local addresses allowed or not, web.deny_domains), waits up to 15 seconds for its first reply ({"blitz":"opened"}), and drives it with the DevTools Protocol over the relay (browser.AttachTransport): each command goes down the stream (message), and the window sends the view’s replies and events back, in order, with AgentBrowserReply. In the window, the page passes them to Electron, which runs them on the view’s webContents.debugger. A window that goes closes its views; no window, a refusal, or no answer: headless Chrome, as before.
  • No DevTools port is opened on the app (any local program could then drive its own page). The view refuses Browser.*, Target.*, Storage.*, SystemInfo.* and the like (EL-17), and Blitz never closes a browser it didn’t start.
  • The headless browser’s proxy filtering (WEB-32) is the view’s session’s request filter here: web, WebSocket and data addresses only, no denied domain, no link-local address, loopback and private ones (literal addresses, localhost, .local, .internal) only with browser.allow_local. Page loads still go through the engine’s navigation checks (WEB-34) and approvals.
  • 2026-11-05 (scan N26-apps-other#1, #2). As WEB-32’s proxy, the filter goes by the addresses dialled: a name is checked by every address it resolves to, an IPv6 address carrying an IPv4 one by that, and a worker’s requests by the strictest reach of the session’s views (spec_038 EL-17a).

3. Watching or not

  • AB-02 browser.show (your settings; Settings › Browser › How the agent browses): watch, silent, or ask (the default), which asks the first time the agent browses in a chat, Watch it in a tab or Run silently, and keeps the answer for the chat. Where no one can answer (a job’s run), silently.
  • AB-03 Watched: the view is a web tab (EL-100) in the workspace’s editor, the page’s own size (no viewport emulation, KeepViewport), with a bar saying Blitz is browsing: Take over lets the agent go (its browser closes, the tab stays yours) and Stop closes the view. Silent: the view is off screen (offscreen rendering), never shown.
  • AB-04 The view uses the workspace’s browser profile’s partition (persist:profile-<name>, BP-05), so the sign-ins made with Sign in… apply; none, a session of its own in memory, gone with the view.

3a. Pages you ask to see

v0.8.4, the owner’s request (2026-10-24): “if a user asks to open a site in a browser, it should open it in the embedded browser first, or ask ‘Embedded Browser’ or ‘System Browser’”.

  • AB-10 open_page(url) (pkg/engine/tools/openpage.go; the blitz agent has it, and its prompt says to use it, never the shell’s open, when the user asks to open, show or go to a site). It shows the page to the user and doesn’t read it. Only http and https (a bare host gets https://), never a host web.deny_domains or a deny web(...) rule refuses; it needs no approval, since it reads nothing.
  • AB-10a 2026-11-21 (the owner, hardening: a page the agent read could send it to http://localhost:… or the router, opened with the person’s own browser and sign-ins). A page whose host is, or resolves to, a private, loopback or link-local address (browser.PublicAddr: 127/8, ::1, 10/8, 172.16/12, 192.168/16, 169.254/16, fc00::/7 and the rest) is put to the person first, in every mode (MustAsk); nobody to ask (a job’s run) is a refusal. Public pages open as AB-10 says.
  • AB-10b 2026-11-26 (a report: with a Node app the agent had started, open_page on http://localhost:3000 asked, was allowed, and the web tab showed ERR_BLOCKED_BY_CLIENT, while the system’s browser opened it). A page AB-10a put to the person and they allowed opens in the web tab with local addresses in its reach, whatever browser.allow_local says (PageOpener’s local, AgentBrowserCommand.allow_local): the person said to open it, and a local app’s page calls its own local servers. Denied domains still hold and link-local addresses never load (EL-17); a public page’s tab still reaches no private address without browser.allow_local (BP-08a).
  • AB-10a 2026-11-05 (scan N26-engine-tools-1#13). An ask web(…) rule naming the page’s host puts open_page to the person (MustAsk, kind network) before it opens; with no ask rule it still needs no approval (the owner’s AB-10).
  • AB-11 Where: browser.open (your settings; Settings › Browser › Where pages you ask to open show): embedded, a web tab of the app’s (EL-100); system, the system’s browser; or ask (the default), which asks the first time in a chat, Embedded browser (first) or System browser, and keeps the answer for the chat; no answer, the embedded browser.
  • AB-11a 2026-11-05 (scan N26-engine-tools-1#15, #14, #34). With browser.open = "embedded", a window whose opener fails is an error (“couldn’t open the page in the app”), never a browser on the service’s machine instead; ask and system still fall back to the system’s browser. The question and its answers are localized (tools.open_page.*, and the browser’s browser.show question, tools.browser.*), compared by position. A chat’s answers are forgotten when its session is deleted (Registry.SessionGone).
  • AB-12 It’s carried on the same stream as the views (AB-01): the engine sends the newest window page (a web tab) or external (the system’s browser, Electron’s openExternal) with the URL, and the page opens it (no web tabs outside Electron: the system’s browser). No window, or one that can’t take it: the system’s browser on the service’s machine (open, xdg-open, url.dll). A run no one watches (a job’s) opens nothing and says so.

4. Not in scope

  • A chip in the chat that opens a silent view as a tab: the tool calls (and their screenshots) show what it did.