GebSecure Docs v0.1.0

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#

  1. 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) to POST /v1/browser/sessions/:id/actions. Each session is one BrowserContext (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.

  2. 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.254 or localhost would bypass it), and fulfilling responses ourselves would still let the browser follow 3xx hops on its own. Explicit navigate actions are also checked before any request leaves.

  3. 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 is browser:type.sensitive. Resources are browser:<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 generic browser:click/browser:submit permission and stays inside the domain lists.

  4. Protected intents need a human by default. approvalIntents (default: purchase, account change, message send) force APPROVAL_REQUIRED even 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 with approvalId; it runs once, and a changed page (e.g. a different price) no longer matches.

  5. Secrets by reference, values never stored. type accepts { secretRef }; the runtime reads the vault secret (access policy enforced, use audited), refuses it unless metadata.browserDomains covers 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.

  6. Untrusted page content is inspected before the agent sees it. extract output 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).

  7. 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 503 naming 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.