049 · Browser profiles
Browser profiles: the sign-ins (OAuth, single sign-on, a site’s own) the agents browse with, one chosen per workspace (spec_049_browser_profiles)
| Status | Built (v0.8.4, the owner’s request: “research if we can expose the profile features of Chromium, since we want to take advantage of OAuth and other web protocols and authentications”; one profile per workspace, the owner’s choice 2026-10-23) |
| Source | pkg/config/browserprofiles.go, pkg/engine/browser/browser.go (Options.ProfileDir), pkg/engine/tools/browser.go (syncProfile, webRules), browserProfile in pkg/engine/workspace.go, pkg/service/server/browserprofiles.go, ConfigService.*BrowserProfile* in proto/blitz/v1/config.proto; the page’s BrowserSettings.tsx and WorkspaceSettingsForm.tsx; the Electron app’s SignInWindow (apps/electron/src/main.ts) |
| Tests | pkg/config/browserprofiles_test.go, pkg/engine/browser/launch_test.go (TestLaunchWithAKeptProfile), pkg/engine/tools/browser_test.go (TestBrowserToolUsesTheWorkspacesProfile), pkg/service/server/browserprofiles_test.go, apps/desktop/web/src/BrowserSettings.test.ts, apps/electron/src/logic.test.ts |
| Depends on | spec_008_web (the browser, WEB-30–38), spec_038_electron (the window), spec_031_project_config (trust) |
The agent’s browser had a throwaway profile, deleted on close (WEB-30), so it was signed in nowhere, and the user’s own sign-ins (a mailbox, a wiki behind SSO, a dashboard) were out of its reach.
- Chromium keeps sign-ins in a profile: cookies, local storage, IndexedDB. A
--user-data-dirkept between runs keeps them for the system’s Chrome; Electron’ssession.fromPartition("persist:<name>")is the same for the app’s own views. - The user’s everyday Chrome profile is out of reach: Chrome 136 and later refuse
--remote-debugging-porton the default profile, and its cookies are encrypted with the OS keychain. Profiles are Blitz’s own, signed in to by hand. - Google (and some others) refuse sign-in in embedded or automated browsers (“This browser or app may not be secure”); a profile doesn’t change that. Blitz’s own OAuth (MCP servers,
pkg/mcpauth) stays as RFC 8252 says: the system browser and a loopback redirect.
- BP-01
config.BrowserProfiles:browser-profiles.jsonin the settings directory lists the profiles (name: lowercase letters, digits,-and_, up to 32; when made; the sites it browses without asking) and each workspace’s choice, by its folder with symbolic links resolved. Each profile’s data isbrowser/profiles/<name>beside it, 0700. A profile is the person’s: no project setting names one (WEB-38). - BP-02
ConfigService:ListBrowserProfiles(with a workspace’s choice),CreateBrowserProfile,DeleteBrowserProfile(its data and the workspaces’ choice too),ClearBrowserProfile(signed out of everything, the profile kept),SetBrowserProfileDomains,SetWorkspaceBrowserProfile("": none), andOpenBrowserProfile, which starts the system’s Chrome (or Chromium, Edge, Brave) on the profile’s folder at a web page, on the service’s machine, to sign in by hand (NO_BROWSERwithout one). A name that’s gone isNOT_FOUND,NO_BROWSER_PROFILE.
- BP-03 The browser tool takes the workspace’s profile before each action (
syncProfile): Chrome is launched with its folder (Options.ProfileDir; the last run’sDevToolsActivePortis removed first, andClosekeeps the folder), so the sign-ins last; a change of profile closes the browser, and the next action starts one with the new one. None when the workspace has none, or its project settings are new, changed or declined (a project the person hasn’t trusted could steer the agent into their sign-ins): a throwaway profile, as before. - BP-03a 2026-11-05 (scan N26-engine-top-2#20: the profile followed trust as the workspace opened, and the language servers trust as it is now, so forgetting trust kept the profile and
--trust-projectwithheld both). The browser profile and the language servers ask one question (Workspace.projectTrusted): no project files, or trusted now, or this run trusts them (--trust-project, its files loaded). Trust forgotten while the workspace is open withholds both from the next action. - BP-03b Built 2026-11-18 (the owner: “I can create a profile … log into sites with that profile. What I can’t do is drive that profile from the agent, which is the entire reason for having the profiles”). The agent may browse with any of the person’s profiles: the browser tool’s
profilenames one (none: signed out), kept for the chat (browserTool.chosen). The workspace’s own goes without asking; any other, or the workspace’s own while it’s withheld (BP-03a), is asked first (browser:profile:<name>, a network approval naming its sites), and refused is an error. A name that isn’t one is an error listing the person’s profiles (Registry.SetBrowserProfiles: the workspace’s, all, and the withheld one). - BP-03c Built 2026-11-18. The agent is told, once a chat, in a navigate’s note: browsing signed out while the person has profiles, which ones with their sites, and how to use one; the workspace’s own withheld until its project settings are trusted; and browsing in Chrome’s copy of a profile (BP-05: no app window), whose sign-ins made with Sign in… aren’t in it. The tool’s description says it browses signed in with a profile, for anything behind a sign-in.
- BP-03d Built 2026-11-18 (the owner’s session: “open the license.retailcortex.com page” opened signed out, with a password to type, though the only profile’s sites were
*.retailcortex.com). With no profile named, none chosen in the chat and none the workspace’s own, the one profile whose sites include the page’s (browserTool.forSite) is offered, as a named one is (BP-03b): by the browser’s navigate,open_pageandweb_fetch(signedInAs, then the browser asks). Refused, the chat browses signed out and isn’t asked again; two profiles with the site, none is offered. - BP-03e Built 2026-11-18 (the owner: “If a single profile is available, it should be the default profile”; “I like the idea of anonymous”). A workspace that chose none browses with the person’s only profile, as if chosen (
Workspace.browserProfiles). Anonymous (config.AnonymousBrowserProfile, reserved: no profile is namedanonymousornone) is a workspace’s choice to browse signed out, kept inbrowser-profiles.json; no profile is offered for a site there (BP-03d). The agent names it asprofile: anonymous(nonetoo). The workspace’s picker: Default:, your only profile (or None chosen with several), Anonymous (signed out), then the profiles. - BP-04 With a profile, the browser’s approvals use the profile’s own sites in place of
web.allow_domains(its sign-ins go with every request): those go without asking, every other site asks, deny rules still refuse. - BP-04a Built 2026-11-19 (a report: with profile
work, whose sites were*.example.com,browsernavigate tojira.example.com, an intranet behind a VPN, failed withnet::ERR_BLOCKED_BY_CLIENTwhilewww.example.comloaded; no approval was asked, as the site was the profile’s). A name among the profile’s own sites may resolve to a private address (RFC 1918, carrier-grade NAT100.64.0.0/10, unique local IPv6;browser.PrivateAddr) withoutbrowser.allow_local: the user listed it and signs in to it, so it’s theirs to reach. Loopback still needsallow_local, link-local never; a literal address is never a profile site. Headless, the proxy judges each address by the host it dials for (Options.PrivateHost, WEB-32); in the app the open command carries the sites (AgentBrowserCommand.private_sites, EL-17b). - BP-04b 2026-11-21 (security review electron#1: a site of
*or10.*let every page reach the private network). Only sites that name a domain give private-network reach: not a literal address, not a pattern without a domain (*,10.*,intranet); a literal address is never one, in the headless browser and the app’s. - BP-05 In the desktop app, the agent’s in-app browsing (spec_050_agent_browser) uses the profile’s Electron partition,
persist:profile-<name>; Sign in… opens a window on it (SignInWindow, EL-16), whose popups (OAuth’s) open in the same session. The two stores are apart: Chrome’s folder for the browsing done without the app (jobs, the CLI), the partition for the app’s; the user signs in to each they’ll use, and Settings says so.
- BP-06 Settings › Browser: each profile with Sign in… (in the app), Sign in with Chrome…, the site to open, its sites (one a line, saved as the field is left), Sign out of everything and Delete (asked); a field to make one. A workspace’s settings › Browser › Browser profile chooses one, or none (signed out), in simple mode too (2026-11-18: it was under Advanced, so a profile made in Settings was never used).
- BP-07 Built 2026-11-18.
web_fetchof a page whose site is one of the profile in use’s sites loads it in the browser, signed in (webFetcher.signedIn;Via: browser, a note naming the profile), under the browser’s approvals (BP-04), not as a plain request, which carries no sign-ins and would get the site’s login page. The browser failing falls back to the plain request. - BP-08 Built 2026-11-18 (the owner’s session: “open the internal browser using the work profile” went to
open_page, which couldn’t).open_pageshows a page signed in with a profile: itsprofilenames one (asked first unless it’s the workspace’s own, BP-03b;none: signed out), else the one the chat browses with. The page command carries it (AgentBrowserCommand.profile), and the app’s web tab opens in the profile’s partition (PreviewOpen’s profile,persist:profile-<name>) rather than the previews’ own. The system’s browser has its own sign-ins: the result’s note says so. - BP-08a 2026-11-21 (security review electron#2; the owner chose “Allow for this chat”). A page outside the profile’s own sites asks before it opens signed in with it (its sign-ins go with the page’s requests, as the browser asks for such a site, BP-04): Allow for this chat answers for that site in that chat. The profile’s own sites, and a page signed out, open without asking. The page command carries the browser’s reach (
allow_local,deny_domains, the profile’s own site names asprivate_sites), and the app’s web tab registers it with the session’s network filter, as the agent’s views do (EL-17): no private address withoutbrowser.allow_local(but for a local page the person said to open, AB-10b), never a denied domain.