BrowserSession
Defined in: tools/builtin/builtin.types.ts:521
The browser capability seam — implement this against a real browser.
Remarks
Unlike every other seam here, this is stateful: it drives one persistent page (cookies, history, scroll position) across calls, so each method mutates a live session rather than answering an isolated request. Wire it to e.g. Playwright / Puppeteer driving Chromium, or a hosted browser (Browserbase, computer-use).
SECURITY: navigate dereferences a model-supplied URL with the same SSRF /
exfiltration surface as WebBackend.fetch, and a live session carries
cookies and credentials from prior steps. Route the resulting tools through the
permission gate (../../permissions) before granting them to a model you do not
fully trust.
See
- BrowserSnapshot
- browserTools which wraps this seam in model-facing tools.
Methods
click()
click(ref, ctx): Promise<BrowserSnapshot>;Defined in: tools/builtin/builtin.types.ts:537
Click the element identified by ref and return the resulting page.
Parameters
| Parameter | Type | Description |
|---|---|---|
ref | string | A ref from the current snapshot's elements. |
ctx | ToolContext | Per-call context; ctx.signal may be used to abort the click. |
Returns
Promise<BrowserSnapshot>
A snapshot of the page after the click.
navigate()
navigate(url, ctx): Promise<BrowserSnapshot>;Defined in: tools/builtin/builtin.types.ts:529
Navigate to a URL and return the resulting page.
Parameters
| Parameter | Type | Description |
|---|---|---|
url | string | Absolute URL to load. |
ctx | ToolContext | Per-call context; ctx.signal may be used to abort the navigation. |
Returns
Promise<BrowserSnapshot>
A snapshot of the loaded page.
type()
type(
ref,
text,
ctx): Promise<BrowserSnapshot>;Defined in: tools/builtin/builtin.types.ts:546
Type text into the element identified by ref and return the resulting page.
Parameters
| Parameter | Type | Description |
|---|---|---|
ref | string | A ref from the current snapshot's elements (a text field). |
text | string | The text to type into it. |
ctx | ToolContext | Per-call context; ctx.signal may be used to abort the input. |
Returns
Promise<BrowserSnapshot>
A snapshot of the page after typing.