Architecture · All ADRs
ADR 0013 — Browser & computer-use security: gateway-driven browser, policy egress proxy, intent-escalated authorization
Architecture decision record — status: Accepted.
Status: Accepted
Context#
Agents increasingly act through a web browser (computer use). A browser is the most permissive tool an agent can hold: it can buy, send, change account settings, upload and download files, read untrusted content that carries prompt injections, and reach internal networks. Giving an agent a raw browser (or a CDP endpoint) bypasses every GebSecure control.
Decision#
Agents never get a browser handle. Browsers run in the trusted runtime on gateway nodes: a pool of headless Chromium processes driven by Playwright over its private pipe (no remote-debugging port). Agents send typed actions (
navigate,click,type,select,upload,download,submit,scroll,screenshot,extract,close) toPOST /v1/browser/sessions/:id/actions. Each session is oneBrowserContext(no shared cookies/storage/cache between sessions or tenants), with a per-session download sandbox directory, idle/lifetime/action limits and service workers disabled; popups and unsolicited downloads are refused and recorded.All browser egress goes through a GebSecure policy proxy. Each context is created with a per-session proxy credential. The proxy sees every request — navigations, each redirect hop, subframes, subresources, XHR/fetch and TLS/WebSocket tunnels — and applies the layered domain lists and the SSRF rules of ADR 0011 (DNS resolved once, non-public addresses refused unless explicitly allow-listed, connection pinned to the validated address). We chose a proxy over Playwright request interception because interception is not invoked for redirect hops (a public page redirecting to
169.254.169.254orlocalhostwould bypass it), and fulfilling responses ourselves would still let the browser follow 3xx hops on its own. Explicitnavigateactions are also checked before any request leaves.Every action is an authorization request with page-derived context. The target element is resolved strictly (exactly one match) and described by an in-page guard script plus Playwright's accessibility snapshot. Deterministic classifiers (
@gebsecure/browser-guard) assign an intent and a field kind; intents escalate the action name:browser:purchase,browser:message.send,browser:account.change, and typing into password/card/CVV/SSN/OTP/API-key fields isbrowser:type.sensitive. Resources arebrowser:<host><path>(query strings never enter resources or logs). Policies, risk, taint guards, simulations and approvals therefore apply unchanged. Classification only adds scrutiny; a disguised control still needs the genericbrowser:click/browser:submitpermission and stays inside the domain lists.Protected intents need a human by default.
approvalIntents(default: purchase, account change, message send) forceAPPROVAL_REQUIREDeven when a policy permits the action. The approval binds the exact action snapshot: action, resource, element descriptor, page context and an operation digest (typed values enter it only as an HMAC under a per-session in-memory key). The agent retries the identical action withapprovalId; it runs once, and a changed page (e.g. a different price) no longer matches.Secrets by reference, values never stored.
typeaccepts{ secretRef }; the runtime reads the vault secret (access policy enforced, use audited), refuses it unlessmetadata.browserDomainscovers the current site, types it, and redacts it from anything returned to the agent. Typed values (literal or secret) are never written to audit, replay, approvals or traces; outbound DLP inspects literal text and uploads.Untrusted page content is inspected before the agent sees it.
extractoutput and downloaded text pass sanitization, inbound DLP and the prompt-injection engine over visible and hidden text; detections taint the agent (later write actions need approval).Evidence. Each action writes an ordered replay row (action, target summary after DLP, intent, decision, approval, timing, URL before/after, DOM hash, screenshot id, trace id) and an audit record; runtime events (blocked requests, refused downloads, dismissed dialogs) are rows in the same sequence. Screenshots mask sensitive fields and are envelope-encrypted (ADR 0010) with per-artifact retention.
Consequences#
- (+) One enforcement point for all browser traffic, including redirects and subresources; SSRF and domain lists cannot be bypassed from page JavaScript.
- (+) Existing GSL policies, risk engine, approvals, simulation, DLP, injection/taint, audit and tracing apply to computer use with no special cases.
- (−) Sessions are node-affine (the browser lives in one gateway process). Requests reaching another node get
503naming the hosting node; load balancers should route by session id. A node crash loses its sessions (the worker expires them). - (−) HTTPS is tunneled, so domain lists are host-level for TLS (paths are enforced for explicit navigations and policies).
- (−) Intent heuristics are deterministic and conservative (e.g. any form with card fields is treated as a purchase); organizations tune with policies and
approvalIntents.