diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 288ee47..96a8c91 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "2.14.1"
+ ".": "2.15.0"
}
diff --git a/.stats.yml b/.stats.yml
index 1ef2a27..b4d46dd 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 27
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase/browserbase-f39b852755134d01a440f7c37701f6c5397f43d13740d9ba08739cae488382a7.yml
-openapi_spec_hash: de6c25eebe5026d0fb9a4d7a93ec7718
-config_hash: d4b0c534eaf7665ea25168e0e824c9d3
+configured_endpoints: 36
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase/browserbase-e82c289d3d3aabd936a476cf81630587ffe46ab9e9bdebced4b31b8c2f9bc08f.yml
+openapi_spec_hash: 473121b283812a3dfd866afe9b61dc7d
+config_hash: 1b24ea9fa13645b16b74aa794dbc8190
diff --git a/CHANGELOG.md b/CHANGELOG.md
index cc782ff..a8d8d44 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,18 @@
# Changelog
+## 2.15.0 (2026-07-02)
+
+Full Changelog: [v2.14.1...v2.15.0](https://github.com/browserbase/sdk-node/compare/v2.14.1...v2.15.0)
+
+### Features
+
+* [CORE-000][apps/sdk] Add agents to SDK ([1f1fb26](https://github.com/browserbase/sdk-node/commit/1f1fb26aaa11928cdc6b26baa7452c8577ea206c))
+
+
+### Documentation
+
+* document and un-gate allowedDomains session setting ([d18989f](https://github.com/browserbase/sdk-node/commit/d18989f3085093d85cf8e52825c8920ce753e7b9))
+
## 2.14.1 (2026-06-18)
### Bug Fixes
diff --git a/api.md b/api.md
index 04af9b4..bd75c9d 100644
--- a/api.md
+++ b/api.md
@@ -139,3 +139,36 @@ Methods:
- client.sessions.replays.retrieve(id) -> ReplayRetrieveResponse
- client.sessions.replays.retrievePage(id, pageId) -> Response
+
+# Agents
+
+Types:
+
+- AgentCreateResponse
+- AgentRetrieveResponse
+- AgentUpdateResponse
+- AgentListResponse
+
+Methods:
+
+- client.agents.create({ ...params }) -> AgentCreateResponse
+- client.agents.retrieve(agentId) -> AgentRetrieveResponse
+- client.agents.update(agentId, { ...params }) -> AgentUpdateResponse
+- client.agents.list({ ...params }) -> AgentListResponse
+- client.agents.delete(agentId) -> void
+
+## Runs
+
+Types:
+
+- RunCreateResponse
+- RunRetrieveResponse
+- RunListResponse
+- RunListMessagesResponse
+
+Methods:
+
+- client.agents.runs.create({ ...params }) -> RunCreateResponse
+- client.agents.runs.retrieve(runId) -> RunRetrieveResponse
+- client.agents.runs.list({ ...params }) -> RunListResponse
+- client.agents.runs.listMessages(runId, { ...params }) -> RunListMessagesResponse
diff --git a/package-lock.json b/package-lock.json
index 473e3ae..d5d0060 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "@browserbasehq/sdk",
- "version": "2.14.1",
+ "version": "2.15.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@browserbasehq/sdk",
- "version": "2.14.1",
+ "version": "2.15.0",
"dependencies": {
"@types/node": "^18.11.18",
"@types/node-fetch": "^2.6.4",
diff --git a/package.json b/package.json
index c3d9724..b3d0ff2 100644
--- a/package.json
+++ b/package.json
@@ -1,8 +1,9 @@
{
"name": "@browserbasehq/sdk",
- "version": "2.14.1",
+ "version": "2.15.0",
"description": "The official Node.js library for the Browserbase API",
"author": "Browserbase ",
+ "license": "Apache-2.0",
"types": "dist/index.d.ts",
"main": "dist/index.js",
"type": "commonjs",
diff --git a/src/index.ts b/src/index.ts
index af75d1a..b2edbc7 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -22,6 +22,16 @@ import { Extension, ExtensionCreateParams, Extensions } from './resources/extens
import { FetchAPI, FetchAPICreateParams, FetchAPICreateResponse } from './resources/fetch-api';
import { Project, ProjectListResponse, ProjectUsage, Projects } from './resources/projects';
import { Search, SearchWebParams, SearchWebResponse } from './resources/search';
+import {
+ AgentCreateParams,
+ AgentCreateResponse,
+ AgentListParams,
+ AgentListResponse,
+ AgentRetrieveResponse,
+ AgentUpdateParams,
+ AgentUpdateResponse,
+ Agents,
+} from './resources/agents/agents';
import {
Session,
SessionCreateParams,
@@ -171,6 +181,7 @@ export class Browserbase extends Core.APIClient {
projects: API.Projects = new API.Projects(this);
search: API.Search = new API.Search(this);
sessions: API.Sessions = new API.Sessions(this);
+ agents: API.Agents = new API.Agents(this);
/**
* Check whether the base URL is set to its default.
@@ -222,6 +233,7 @@ Browserbase.FetchAPI = FetchAPI;
Browserbase.Projects = Projects;
Browserbase.Search = Search;
Browserbase.Sessions = Sessions;
+Browserbase.Agents = Agents;
export declare namespace Browserbase {
export type RequestOptions = Core.RequestOptions;
@@ -277,6 +289,17 @@ export declare namespace Browserbase {
type SessionUpdateParams as SessionUpdateParams,
type SessionListParams as SessionListParams,
};
+
+ export {
+ Agents as Agents,
+ type AgentCreateResponse as AgentCreateResponse,
+ type AgentRetrieveResponse as AgentRetrieveResponse,
+ type AgentUpdateResponse as AgentUpdateResponse,
+ type AgentListResponse as AgentListResponse,
+ type AgentCreateParams as AgentCreateParams,
+ type AgentUpdateParams as AgentUpdateParams,
+ type AgentListParams as AgentListParams,
+ };
}
export { toFile, fileFromPath } from './uploads';
diff --git a/src/resources/agents.ts b/src/resources/agents.ts
new file mode 100644
index 0000000..0c43db0
--- /dev/null
+++ b/src/resources/agents.ts
@@ -0,0 +1,3 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+export * from './agents/index';
diff --git a/src/resources/agents/agents.ts b/src/resources/agents/agents.ts
new file mode 100644
index 0000000..9e2ed0c
--- /dev/null
+++ b/src/resources/agents/agents.ts
@@ -0,0 +1,335 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import { APIResource } from '../../resource';
+import { isRequestOptions } from '../../core';
+import * as Core from '../../core';
+import * as RunsAPI from './runs';
+import {
+ RunCreateParams,
+ RunCreateResponse,
+ RunListMessagesParams,
+ RunListMessagesResponse,
+ RunListParams,
+ RunListResponse,
+ RunRetrieveResponse,
+ Runs,
+} from './runs';
+
+export class Agents extends APIResource {
+ runs: RunsAPI.Runs = new RunsAPI.Runs(this._client);
+
+ /**
+ * Create a reusable agent. An agent defines a `systemPrompt` and `resultSchema`
+ * that guide its behavior for every run. Only `name` is required; an agent created
+ * with no `systemPrompt` behaves like an unconfigured run.
+ */
+ create(body: AgentCreateParams, options?: Core.RequestOptions): Core.APIPromise {
+ return this._client.post('/v1/agents', { body, ...options });
+ }
+
+ /**
+ * Retrieve an agent by ID.
+ */
+ retrieve(agentId: string, options?: Core.RequestOptions): Core.APIPromise {
+ return this._client.get(`/v1/agents/${agentId}`, options);
+ }
+
+ /**
+ * Update an existing agent. Only the fields provided in the body are modified;
+ * omitted fields are left unchanged.
+ */
+ update(
+ agentId: string,
+ body?: AgentUpdateParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise;
+ update(agentId: string, options?: Core.RequestOptions): Core.APIPromise;
+ update(
+ agentId: string,
+ body: AgentUpdateParams | Core.RequestOptions = {},
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ if (isRequestOptions(body)) {
+ return this.update(agentId, {}, body);
+ }
+ return this._client.patch(`/v1/agents/${agentId}`, { body, ...options });
+ }
+
+ /**
+ * List agents across your account. Supports filtering by creation time.
+ */
+ list(query?: AgentListParams, options?: Core.RequestOptions): Core.APIPromise;
+ list(options?: Core.RequestOptions): Core.APIPromise;
+ list(
+ query: AgentListParams | Core.RequestOptions = {},
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ if (isRequestOptions(query)) {
+ return this.list({}, query);
+ }
+ return this._client.get('/v1/agents', { query, ...options });
+ }
+
+ /**
+ * Delete an agent. Runs that already referenced this agent are unaffected.
+ */
+ delete(agentId: string, options?: Core.RequestOptions): Core.APIPromise {
+ return this._client.delete(`/v1/agents/${agentId}`, {
+ ...options,
+ headers: { Accept: '*/*', ...options?.headers },
+ });
+ }
+}
+
+/**
+ * A reusable agent. Referenced by `agentId` to apply a system prompt to every run
+ * that uses the agent.
+ */
+export interface AgentCreateResponse {
+ /**
+ * Unique identifier for the agent. Use this value as `agentId` when creating an
+ * agent run.
+ */
+ agentId: string;
+
+ createdAt: string;
+
+ /**
+ * Human-readable name for the agent. Used to identify the agent in the dashboard
+ * and API responses.
+ */
+ name: string;
+
+ updatedAt: string;
+
+ /**
+ * [JSON Schema](https://json-schema.org/specification) that runs referencing this
+ * agent will aim to conform their `result` to. Can be overridden per run by
+ * passing `resultSchema` on the run request.
+ */
+ resultSchema?: { [key: string]: unknown };
+
+ /**
+ * System prompt applied to every run that uses this agent.
+ */
+ systemPrompt?: string;
+}
+
+/**
+ * A reusable agent. Referenced by `agentId` to apply a system prompt to every run
+ * that uses the agent.
+ */
+export interface AgentRetrieveResponse {
+ /**
+ * Unique identifier for the agent. Use this value as `agentId` when creating an
+ * agent run.
+ */
+ agentId: string;
+
+ createdAt: string;
+
+ /**
+ * Human-readable name for the agent. Used to identify the agent in the dashboard
+ * and API responses.
+ */
+ name: string;
+
+ updatedAt: string;
+
+ /**
+ * [JSON Schema](https://json-schema.org/specification) that runs referencing this
+ * agent will aim to conform their `result` to. Can be overridden per run by
+ * passing `resultSchema` on the run request.
+ */
+ resultSchema?: { [key: string]: unknown };
+
+ /**
+ * System prompt applied to every run that uses this agent.
+ */
+ systemPrompt?: string;
+}
+
+/**
+ * A reusable agent. Referenced by `agentId` to apply a system prompt to every run
+ * that uses the agent.
+ */
+export interface AgentUpdateResponse {
+ /**
+ * Unique identifier for the agent. Use this value as `agentId` when creating an
+ * agent run.
+ */
+ agentId: string;
+
+ createdAt: string;
+
+ /**
+ * Human-readable name for the agent. Used to identify the agent in the dashboard
+ * and API responses.
+ */
+ name: string;
+
+ updatedAt: string;
+
+ /**
+ * [JSON Schema](https://json-schema.org/specification) that runs referencing this
+ * agent will aim to conform their `result` to. Can be overridden per run by
+ * passing `resultSchema` on the run request.
+ */
+ resultSchema?: { [key: string]: unknown };
+
+ /**
+ * System prompt applied to every run that uses this agent.
+ */
+ systemPrompt?: string;
+}
+
+/**
+ * A page of agents.
+ */
+export interface AgentListResponse {
+ /**
+ * The page of matching agents.
+ */
+ data: Array;
+
+ /**
+ * The maximum number of results returned in this page.
+ */
+ limit: number;
+
+ /**
+ * Cursor for the next page. Pass it back as `cursor` on the next request to
+ * continue paging. null when there are no more results.
+ */
+ nextCursor: string | null;
+}
+
+export namespace AgentListResponse {
+ /**
+ * A reusable agent. Referenced by `agentId` to apply a system prompt to every run
+ * that uses the agent.
+ */
+ export interface Data {
+ /**
+ * Unique identifier for the agent. Use this value as `agentId` when creating an
+ * agent run.
+ */
+ agentId: string;
+
+ createdAt: string;
+
+ /**
+ * Human-readable name for the agent. Used to identify the agent in the dashboard
+ * and API responses.
+ */
+ name: string;
+
+ updatedAt: string;
+
+ /**
+ * [JSON Schema](https://json-schema.org/specification) that runs referencing this
+ * agent will aim to conform their `result` to. Can be overridden per run by
+ * passing `resultSchema` on the run request.
+ */
+ resultSchema?: { [key: string]: unknown };
+
+ /**
+ * System prompt applied to every run that uses this agent.
+ */
+ systemPrompt?: string;
+ }
+}
+
+export interface AgentCreateParams {
+ /**
+ * Human-readable name for the agent. Used to identify the agent in the dashboard
+ * and API responses.
+ */
+ name: string;
+
+ /**
+ * An optional [JSON Schema](https://json-schema.org/specification) object. If
+ * provided, runs that reference this agent will aim to return a `result` that
+ * conforms to this schema when they complete. Can be overridden per run by passing
+ * `resultSchema` on the run request.
+ */
+ resultSchema?: { [key: string]: unknown };
+
+ /**
+ * System prompt that steers the agent's behavior on every run that uses this
+ * agent.
+ */
+ systemPrompt?: string;
+}
+
+export interface AgentUpdateParams {
+ /**
+ * Human-readable name for the agent. Used to identify the agent in the dashboard
+ * and API responses.
+ */
+ name?: string;
+
+ /**
+ * An optional [JSON Schema](https://json-schema.org/specification) object. If
+ * provided, runs that reference this agent will aim to return a `result` that
+ * conforms to this schema when they complete. Can be overridden per run by passing
+ * `resultSchema` on the run request.
+ */
+ resultSchema?: { [key: string]: unknown };
+
+ /**
+ * New system prompt that steers the agent's behavior on every run that uses this
+ * agent.
+ */
+ systemPrompt?: string;
+}
+
+export interface AgentListParams {
+ /**
+ * Pagination cursor. Pass the nextCursor from the previous response to fetch the
+ * next page. Omit to start from the first page.
+ */
+ cursor?: string;
+
+ /**
+ * Only return agents created on or before this timestamp (inclusive). ISO 8601 /
+ * RFC 3339, e.g. 2026-01-20T00:00:00Z.
+ */
+ endAt?: string;
+
+ /**
+ * Maximum number of results to return.
+ */
+ limit?: number;
+
+ /**
+ * Only return agents created on or after this timestamp (inclusive). ISO 8601 /
+ * RFC 3339, e.g. 2026-01-19T00:00:00Z.
+ */
+ startAt?: string;
+}
+
+Agents.Runs = Runs;
+
+export declare namespace Agents {
+ export {
+ type AgentCreateResponse as AgentCreateResponse,
+ type AgentRetrieveResponse as AgentRetrieveResponse,
+ type AgentUpdateResponse as AgentUpdateResponse,
+ type AgentListResponse as AgentListResponse,
+ type AgentCreateParams as AgentCreateParams,
+ type AgentUpdateParams as AgentUpdateParams,
+ type AgentListParams as AgentListParams,
+ };
+
+ export {
+ Runs as Runs,
+ type RunCreateResponse as RunCreateResponse,
+ type RunRetrieveResponse as RunRetrieveResponse,
+ type RunListResponse as RunListResponse,
+ type RunListMessagesResponse as RunListMessagesResponse,
+ type RunCreateParams as RunCreateParams,
+ type RunListParams as RunListParams,
+ type RunListMessagesParams as RunListMessagesParams,
+ };
+}
diff --git a/src/resources/agents/index.ts b/src/resources/agents/index.ts
new file mode 100644
index 0000000..47ed229
--- /dev/null
+++ b/src/resources/agents/index.ts
@@ -0,0 +1,22 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+export {
+ Agents,
+ type AgentCreateResponse,
+ type AgentRetrieveResponse,
+ type AgentUpdateResponse,
+ type AgentListResponse,
+ type AgentCreateParams,
+ type AgentUpdateParams,
+ type AgentListParams,
+} from './agents';
+export {
+ Runs,
+ type RunCreateResponse,
+ type RunRetrieveResponse,
+ type RunListResponse,
+ type RunListMessagesResponse,
+ type RunCreateParams,
+ type RunListParams,
+ type RunListMessagesParams,
+} from './runs';
diff --git a/src/resources/agents/runs.ts b/src/resources/agents/runs.ts
new file mode 100644
index 0000000..f01d793
--- /dev/null
+++ b/src/resources/agents/runs.ts
@@ -0,0 +1,553 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import { APIResource } from '../../resource';
+import { isRequestOptions } from '../../core';
+import * as Core from '../../core';
+
+export class Runs extends APIResource {
+ /**
+ * Run a browser agent to complete the `task` by using web search and browser
+ * tooling. Optionally pass `agentId` to run a
+ * [custom agent](/reference/api/create-an-agent) you've created.
+ */
+ create(body: RunCreateParams, options?: Core.RequestOptions): Core.APIPromise {
+ return this._client.post('/v1/agents/runs', { body, ...options });
+ }
+
+ /**
+ * Retrieve the current status and details of a run, including its result and
+ * associated session information. To fetch the run's messages, use
+ * [List Run Messages](/reference/api/list-run-messages).
+ */
+ retrieve(runId: string, options?: Core.RequestOptions): Core.APIPromise {
+ return this._client.get(`/v1/agents/runs/${runId}`, options);
+ }
+
+ /**
+ * List runs across your account. Supports filtering by status, by the agent they
+ * reference, and by creation time.
+ */
+ list(query?: RunListParams, options?: Core.RequestOptions): Core.APIPromise;
+ list(options?: Core.RequestOptions): Core.APIPromise;
+ list(
+ query: RunListParams | Core.RequestOptions = {},
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ if (isRequestOptions(query)) {
+ return this.list({}, query);
+ }
+ return this._client.get('/v1/agents/runs', { query, ...options });
+ }
+
+ /**
+ * Returns a paginated list of messages produced by a run, in chronological order,
+ * with the oldest messages first.
+ *
+ * Messages conform to the
+ * [AI SDK UIMessage format](https://ai-sdk.dev/docs/reference/ai-sdk-core/ui-message).
+ */
+ listMessages(
+ runId: string,
+ query?: RunListMessagesParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise;
+ listMessages(runId: string, options?: Core.RequestOptions): Core.APIPromise;
+ listMessages(
+ runId: string,
+ query: RunListMessagesParams | Core.RequestOptions = {},
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ if (isRequestOptions(query)) {
+ return this.listMessages(runId, {}, query);
+ }
+ return this._client.get(`/v1/agents/runs/${runId}/messages`, { query, ...options });
+ }
+}
+
+/**
+ * One execution of an agent against a task. Created in `pending` and transitioned
+ * through `running` → `completed`/`failed` by the runner.
+ */
+export interface RunCreateResponse {
+ createdAt: string;
+
+ /**
+ * Unique identifier for the run.
+ */
+ runId: string;
+
+ /**
+ * Current status of the run.
+ *
+ * - `PENDING` - agent will run soon
+ * - `RUNNING` - agent is currently running
+ * - `COMPLETED` - agent has finished running
+ * - `FAILED` - agent has failed the run
+ * - `STOPPED` - run was stopped by the user
+ * - `TIMED_OUT` - run exceeded maximum time
+ */
+ status: 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'STOPPED' | 'TIMED_OUT';
+
+ /**
+ * The original task description.
+ */
+ task: string;
+
+ updatedAt: string;
+
+ /**
+ * The ID of the agent applied to this run, if any. Omitted for ad-hoc runs.
+ */
+ agentId?: string;
+
+ cause?: RunCreateResponse.Cause;
+
+ endedAt?: string;
+
+ /**
+ * The agent's structured result for the run. Only present when the run has
+ * finished and output is available. The result conforms to the provided
+ * [JSON Schema](https://json-schema.org/specification) when one is set.
+ */
+ result?: { [key: string]: unknown };
+
+ /**
+ * Per-run [JSON Schema](https://json-schema.org/specification) override for the
+ * result shape. When unset, the agent's default `resultSchema` applies.
+ */
+ resultSchema?: { [key: string]: unknown };
+
+ /**
+ * External sandbox identifier assigned by the runner. Optional.
+ */
+ sandboxId?: string;
+
+ /**
+ * The Browserbase session ID powering this run.
+ */
+ sessionId?: string;
+
+ startedAt?: string;
+}
+
+export namespace RunCreateResponse {
+ export interface Cause {
+ /**
+ * Structured failure code (e.g., RUNNER_HEARTBEAT_LOST).
+ */
+ code: string;
+
+ /**
+ * Human-readable failure detail.
+ */
+ message?: string;
+ }
+}
+
+/**
+ * One execution of an agent against a task. Created in `pending` and transitioned
+ * through `running` → `completed`/`failed` by the runner.
+ */
+export interface RunRetrieveResponse {
+ createdAt: string;
+
+ /**
+ * Unique identifier for the run.
+ */
+ runId: string;
+
+ /**
+ * Current status of the run.
+ *
+ * - `PENDING` - agent will run soon
+ * - `RUNNING` - agent is currently running
+ * - `COMPLETED` - agent has finished running
+ * - `FAILED` - agent has failed the run
+ * - `STOPPED` - run was stopped by the user
+ * - `TIMED_OUT` - run exceeded maximum time
+ */
+ status: 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'STOPPED' | 'TIMED_OUT';
+
+ /**
+ * The original task description.
+ */
+ task: string;
+
+ updatedAt: string;
+
+ /**
+ * The ID of the agent applied to this run, if any. Omitted for ad-hoc runs.
+ */
+ agentId?: string;
+
+ cause?: RunRetrieveResponse.Cause;
+
+ endedAt?: string;
+
+ /**
+ * The agent's structured result for the run. Only present when the run has
+ * finished and output is available. The result conforms to the provided
+ * [JSON Schema](https://json-schema.org/specification) when one is set.
+ */
+ result?: { [key: string]: unknown };
+
+ /**
+ * Per-run [JSON Schema](https://json-schema.org/specification) override for the
+ * result shape. When unset, the agent's default `resultSchema` applies.
+ */
+ resultSchema?: { [key: string]: unknown };
+
+ /**
+ * External sandbox identifier assigned by the runner. Optional.
+ */
+ sandboxId?: string;
+
+ /**
+ * The Browserbase session ID powering this run.
+ */
+ sessionId?: string;
+
+ startedAt?: string;
+}
+
+export namespace RunRetrieveResponse {
+ export interface Cause {
+ /**
+ * Structured failure code (e.g., RUNNER_HEARTBEAT_LOST).
+ */
+ code: string;
+
+ /**
+ * Human-readable failure detail.
+ */
+ message?: string;
+ }
+}
+
+/**
+ * A page of agent runs.
+ */
+export interface RunListResponse {
+ /**
+ * The page of matching agent runs.
+ */
+ data: Array;
+
+ /**
+ * The maximum number of results returned in this page.
+ */
+ limit: number;
+
+ /**
+ * Cursor for the next page. Pass it back as `cursor` on the next request to
+ * continue paging. null when there are no more results.
+ */
+ nextCursor: string | null;
+}
+
+export namespace RunListResponse {
+ /**
+ * One execution of an agent against a task. Created in `pending` and transitioned
+ * through `running` → `completed`/`failed` by the runner.
+ */
+ export interface Data {
+ createdAt: string;
+
+ /**
+ * Unique identifier for the run.
+ */
+ runId: string;
+
+ /**
+ * Current status of the run.
+ *
+ * - `PENDING` - agent will run soon
+ * - `RUNNING` - agent is currently running
+ * - `COMPLETED` - agent has finished running
+ * - `FAILED` - agent has failed the run
+ * - `STOPPED` - run was stopped by the user
+ * - `TIMED_OUT` - run exceeded maximum time
+ */
+ status: 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'STOPPED' | 'TIMED_OUT';
+
+ /**
+ * The original task description.
+ */
+ task: string;
+
+ updatedAt: string;
+
+ /**
+ * The ID of the agent applied to this run, if any. Omitted for ad-hoc runs.
+ */
+ agentId?: string;
+
+ cause?: Data.Cause;
+
+ endedAt?: string;
+
+ /**
+ * The agent's structured result for the run. Only present when the run has
+ * finished and output is available. The result conforms to the provided
+ * [JSON Schema](https://json-schema.org/specification) when one is set.
+ */
+ result?: { [key: string]: unknown };
+
+ /**
+ * Per-run [JSON Schema](https://json-schema.org/specification) override for the
+ * result shape. When unset, the agent's default `resultSchema` applies.
+ */
+ resultSchema?: { [key: string]: unknown };
+
+ /**
+ * External sandbox identifier assigned by the runner. Optional.
+ */
+ sandboxId?: string;
+
+ /**
+ * The Browserbase session ID powering this run.
+ */
+ sessionId?: string;
+
+ startedAt?: string;
+ }
+
+ export namespace Data {
+ export interface Cause {
+ /**
+ * Structured failure code (e.g., RUNNER_HEARTBEAT_LOST).
+ */
+ code: string;
+
+ /**
+ * Human-readable failure detail.
+ */
+ message?: string;
+ }
+ }
+}
+
+export interface RunListMessagesResponse {
+ /**
+ * The page of messages, in chronological order, with the oldest messages first.
+ */
+ data: Array;
+
+ /**
+ * The `id` of the last message in `data`. Pass it back as `since` on the next
+ * request to continue paging, or to poll for new messages. `null` only when the
+ * run has no messages yet; in that case, omit `since` and retry.
+ */
+ nextSince: string | null;
+}
+
+export namespace RunListMessagesResponse {
+ export interface Data {
+ id: string;
+
+ createdAt: string;
+
+ /**
+ * An AI SDK response message (assistant or tool).
+ */
+ message: Data.Message;
+ }
+
+ export namespace Data {
+ /**
+ * An AI SDK response message (assistant or tool).
+ */
+ export interface Message {
+ /**
+ * Plain string (assistant text) or an array of typed parts.
+ */
+ content: string | Array;
+
+ role: 'assistant' | 'tool';
+
+ [k: string]: unknown;
+ }
+
+ export namespace Message {
+ export interface UnionMember1 {
+ /**
+ * text | reasoning | file | tool-call | tool-result
+ */
+ type: string;
+
+ data?: string;
+
+ input?: unknown;
+
+ mediaType?: string;
+
+ output?: unknown;
+
+ text?: string;
+
+ toolCallId?: string;
+
+ toolName?: string;
+
+ [k: string]: unknown;
+ }
+ }
+ }
+}
+
+export interface RunCreateParams {
+ /**
+ * A natural language description of the task the agent should accomplish.
+ */
+ task: string;
+
+ /**
+ * Optionally run a specific [custom agent](/reference/api/create-an-agent) you've
+ * created by ID. The run will use the agent's `systemPrompt` and `resultSchema`
+ * unless overridden.
+ */
+ agentId?: string;
+
+ /**
+ * Browser configuration for the agent's session. When omitted, runner defaults
+ * apply.
+ */
+ browserSettings?: RunCreateParams.BrowserSettings;
+
+ /**
+ * An optional [JSON Schema](https://json-schema.org/specification) object. If
+ * provided, the agent will aim to return a `result` that conforms to this schema
+ * when the run completes. Overrides the referenced agent's default `resultSchema`
+ * for this run only.
+ */
+ resultSchema?: { [key: string]: unknown };
+
+ /**
+ * Optional named variables the agent can reference as placeholders, i.e.
+ * `%variable%`. Each entry pairs a `value` the placeholder resolves to with an
+ * optional `description` that hints to the agent when it should be used. Values
+ * are not persisted.
+ */
+ variables?: { [key: string]: RunCreateParams.Variables };
+}
+
+export namespace RunCreateParams {
+ /**
+ * Browser configuration for the agent's session. When omitted, runner defaults
+ * apply.
+ */
+ export interface BrowserSettings {
+ context?: BrowserSettings.Context;
+
+ /**
+ * Set true to route the agent's browser session through the default proxy.
+ */
+ proxies?: boolean;
+
+ /**
+ * Set true to enable Browserbase Verified for the session.
+ */
+ verified?: boolean;
+ }
+
+ export namespace BrowserSettings {
+ export interface Context {
+ /**
+ * The Context ID.
+ */
+ id: string;
+
+ /**
+ * Whether to persist the context after browsing. Defaults to false.
+ */
+ persist?: boolean;
+ }
+ }
+
+ export interface Variables {
+ /**
+ * The value the placeholder resolves to when the agent uses it.
+ */
+ value: string;
+
+ /**
+ * Optional hint to the agent describing what this variable represents and when to
+ * use it.
+ */
+ description?: string;
+ }
+}
+
+export interface RunListParams {
+ /**
+ * Only return runs that reference this agent ID.
+ */
+ agentId?: string;
+
+ /**
+ * Pagination cursor. Pass the nextCursor from the previous response to fetch the
+ * next page. Omit to start from the first page.
+ */
+ cursor?: string;
+
+ /**
+ * Only return runs created on or before this timestamp (inclusive). ISO 8601 / RFC
+ * 3339, e.g. 2026-01-20T00:00:00Z.
+ */
+ endAt?: string;
+
+ /**
+ * Maximum number of results to return.
+ */
+ limit?: number;
+
+ /**
+ * Only return runs created on or after this timestamp (inclusive). ISO 8601 / RFC
+ * 3339, e.g. 2026-01-19T00:00:00Z.
+ */
+ startAt?: string;
+
+ /**
+ * Current status of the run.
+ *
+ * - `PENDING` - agent will run soon
+ * - `RUNNING` - agent is currently running
+ * - `COMPLETED` - agent has finished running
+ * - `FAILED` - agent has failed the run
+ * - `STOPPED` - run was stopped by the user
+ * - `TIMED_OUT` - run exceeded maximum time
+ */
+ status?: 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'STOPPED' | 'TIMED_OUT';
+}
+
+export interface RunListMessagesParams {
+ /**
+ * Return every message after `since` in one response, ignoring `limit`.
+ */
+ all?: boolean;
+
+ /**
+ * Maximum number of messages to return.
+ */
+ limit?: number;
+
+ /**
+ * The `id` of the last message you've already received. The response will contain
+ * messages produced after that one, in chronological order. Omit on the first
+ * call. Pass the previous response's `nextSince` value to continue paging or to
+ * poll for new messages.
+ */
+ since?: string;
+}
+
+export declare namespace Runs {
+ export {
+ type RunCreateResponse as RunCreateResponse,
+ type RunRetrieveResponse as RunRetrieveResponse,
+ type RunListResponse as RunListResponse,
+ type RunListMessagesResponse as RunListMessagesResponse,
+ type RunCreateParams as RunCreateParams,
+ type RunListParams as RunListParams,
+ type RunListMessagesParams as RunListMessagesParams,
+ };
+}
diff --git a/src/resources/index.ts b/src/resources/index.ts
index 7192b67..d81452f 100644
--- a/src/resources/index.ts
+++ b/src/resources/index.ts
@@ -1,5 +1,15 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+export {
+ Agents,
+ type AgentCreateResponse,
+ type AgentRetrieveResponse,
+ type AgentUpdateResponse,
+ type AgentListResponse,
+ type AgentCreateParams,
+ type AgentUpdateParams,
+ type AgentListParams,
+} from './agents/agents';
export {
Certificates,
type Certificate,
diff --git a/src/resources/sessions/sessions.ts b/src/resources/sessions/sessions.ts
index 0dc62c6..64aec7b 100644
--- a/src/resources/sessions/sessions.ts
+++ b/src/resources/sessions/sessions.ts
@@ -246,6 +246,18 @@ export namespace SessionCreateParams {
*/
advancedStealth?: boolean;
+ /**
+ * An optional list of allowed domains for the session. If you pass one or more
+ * domains, Browserbase restricts top-level (main-frame) page navigations to the
+ * listed domains and their subdomains. For example, `example.com` also permits
+ * `www.example.com` and `a.b.example.com`, but not `notexample.com`. Matching is
+ * domain-based, not full-URL. An empty list (the default) disables the restriction
+ * entirely. Browserbase enforces only main-frame navigations; it does not block
+ * iframe/subframe loads or other in-page resource requests (images, scripts, XHR,
+ * etc.).
+ */
+ allowedDomains?: Array;
+
/**
* Enable or disable ad blocking in the browser. Defaults to `false`.
*/
diff --git a/src/version.ts b/src/version.ts
index 1732631..ba989f0 100644
--- a/src/version.ts
+++ b/src/version.ts
@@ -1 +1 @@
-export const VERSION = '2.14.1'; // x-release-please-version
+export const VERSION = '2.15.0'; // x-release-please-version
diff --git a/tests/api-resources/agents/agents.test.ts b/tests/api-resources/agents/agents.test.ts
new file mode 100644
index 0000000..633bd42
--- /dev/null
+++ b/tests/api-resources/agents/agents.test.ts
@@ -0,0 +1,132 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import Browserbase from '@browserbasehq/sdk';
+import { Response } from '@browserbasehq/sdk/_shims/index';
+
+const client = new Browserbase({
+ apiKey: 'My API Key',
+ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
+});
+
+describe('resource agents', () => {
+ test('create: only required params', async () => {
+ const responsePromise = client.agents.create({ name: 'x' });
+ const rawResponse = await responsePromise.asResponse();
+ expect(rawResponse).toBeInstanceOf(Response);
+ const response = await responsePromise;
+ expect(response).not.toBeInstanceOf(Response);
+ const dataAndResponse = await responsePromise.withResponse();
+ expect(dataAndResponse.data).toBe(response);
+ expect(dataAndResponse.response).toBe(rawResponse);
+ });
+
+ test('create: required and optional params', async () => {
+ const response = await client.agents.create({
+ name: 'x',
+ resultSchema: { foo: 'bar' },
+ systemPrompt: 'x',
+ });
+ });
+
+ test('retrieve', async () => {
+ const responsePromise = client.agents.retrieve('agentId');
+ const rawResponse = await responsePromise.asResponse();
+ expect(rawResponse).toBeInstanceOf(Response);
+ const response = await responsePromise;
+ expect(response).not.toBeInstanceOf(Response);
+ const dataAndResponse = await responsePromise.withResponse();
+ expect(dataAndResponse.data).toBe(response);
+ expect(dataAndResponse.response).toBe(rawResponse);
+ });
+
+ test('retrieve: request options instead of params are passed correctly', async () => {
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
+ await expect(client.agents.retrieve('agentId', { path: '/_stainless_unknown_path' })).rejects.toThrow(
+ Browserbase.NotFoundError,
+ );
+ });
+
+ test('update', async () => {
+ const responsePromise = client.agents.update('agentId');
+ const rawResponse = await responsePromise.asResponse();
+ expect(rawResponse).toBeInstanceOf(Response);
+ const response = await responsePromise;
+ expect(response).not.toBeInstanceOf(Response);
+ const dataAndResponse = await responsePromise.withResponse();
+ expect(dataAndResponse.data).toBe(response);
+ expect(dataAndResponse.response).toBe(rawResponse);
+ });
+
+ test('update: request options instead of params are passed correctly', async () => {
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
+ await expect(client.agents.update('agentId', { path: '/_stainless_unknown_path' })).rejects.toThrow(
+ Browserbase.NotFoundError,
+ );
+ });
+
+ test('update: request options and params are passed correctly', async () => {
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
+ await expect(
+ client.agents.update(
+ 'agentId',
+ {
+ name: 'x',
+ resultSchema: { foo: 'bar' },
+ systemPrompt: 'x',
+ },
+ { path: '/_stainless_unknown_path' },
+ ),
+ ).rejects.toThrow(Browserbase.NotFoundError);
+ });
+
+ test('list', async () => {
+ const responsePromise = client.agents.list();
+ const rawResponse = await responsePromise.asResponse();
+ expect(rawResponse).toBeInstanceOf(Response);
+ const response = await responsePromise;
+ expect(response).not.toBeInstanceOf(Response);
+ const dataAndResponse = await responsePromise.withResponse();
+ expect(dataAndResponse.data).toBe(response);
+ expect(dataAndResponse.response).toBe(rawResponse);
+ });
+
+ test('list: request options instead of params are passed correctly', async () => {
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
+ await expect(client.agents.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
+ Browserbase.NotFoundError,
+ );
+ });
+
+ test('list: request options and params are passed correctly', async () => {
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
+ await expect(
+ client.agents.list(
+ {
+ cursor: 'cursor',
+ endAt: '2019-12-27T18:11:19.117Z',
+ limit: 1,
+ startAt: '2019-12-27T18:11:19.117Z',
+ },
+ { path: '/_stainless_unknown_path' },
+ ),
+ ).rejects.toThrow(Browserbase.NotFoundError);
+ });
+
+ test('delete', async () => {
+ const responsePromise = client.agents.delete('agentId');
+ const rawResponse = await responsePromise.asResponse();
+ expect(rawResponse).toBeInstanceOf(Response);
+ const response = await responsePromise;
+ expect(response).not.toBeInstanceOf(Response);
+ const dataAndResponse = await responsePromise.withResponse();
+ expect(dataAndResponse.data).toBe(response);
+ expect(dataAndResponse.response).toBe(rawResponse);
+ });
+
+ test('delete: request options instead of params are passed correctly', async () => {
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
+ await expect(client.agents.delete('agentId', { path: '/_stainless_unknown_path' })).rejects.toThrow(
+ Browserbase.NotFoundError,
+ );
+ });
+});
diff --git a/tests/api-resources/agents/runs.test.ts b/tests/api-resources/agents/runs.test.ts
new file mode 100644
index 0000000..e5e9f05
--- /dev/null
+++ b/tests/api-resources/agents/runs.test.ts
@@ -0,0 +1,124 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import Browserbase from '@browserbasehq/sdk';
+import { Response } from '@browserbasehq/sdk/_shims/index';
+
+const client = new Browserbase({
+ apiKey: 'My API Key',
+ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
+});
+
+describe('resource runs', () => {
+ test('create: only required params', async () => {
+ const responsePromise = client.agents.runs.create({ task: 'x' });
+ const rawResponse = await responsePromise.asResponse();
+ expect(rawResponse).toBeInstanceOf(Response);
+ const response = await responsePromise;
+ expect(response).not.toBeInstanceOf(Response);
+ const dataAndResponse = await responsePromise.withResponse();
+ expect(dataAndResponse.data).toBe(response);
+ expect(dataAndResponse.response).toBe(rawResponse);
+ });
+
+ test('create: required and optional params', async () => {
+ const response = await client.agents.runs.create({
+ task: 'x',
+ agentId: 'agentId',
+ browserSettings: {
+ context: { id: 'id', persist: true },
+ proxies: true,
+ verified: true,
+ },
+ resultSchema: { foo: 'bar' },
+ variables: { foo: { value: 'value', description: 'description' } },
+ });
+ });
+
+ test('retrieve', async () => {
+ const responsePromise = client.agents.runs.retrieve('runId');
+ const rawResponse = await responsePromise.asResponse();
+ expect(rawResponse).toBeInstanceOf(Response);
+ const response = await responsePromise;
+ expect(response).not.toBeInstanceOf(Response);
+ const dataAndResponse = await responsePromise.withResponse();
+ expect(dataAndResponse.data).toBe(response);
+ expect(dataAndResponse.response).toBe(rawResponse);
+ });
+
+ test('retrieve: request options instead of params are passed correctly', async () => {
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
+ await expect(client.agents.runs.retrieve('runId', { path: '/_stainless_unknown_path' })).rejects.toThrow(
+ Browserbase.NotFoundError,
+ );
+ });
+
+ test('list', async () => {
+ const responsePromise = client.agents.runs.list();
+ const rawResponse = await responsePromise.asResponse();
+ expect(rawResponse).toBeInstanceOf(Response);
+ const response = await responsePromise;
+ expect(response).not.toBeInstanceOf(Response);
+ const dataAndResponse = await responsePromise.withResponse();
+ expect(dataAndResponse.data).toBe(response);
+ expect(dataAndResponse.response).toBe(rawResponse);
+ });
+
+ test('list: request options instead of params are passed correctly', async () => {
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
+ await expect(client.agents.runs.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
+ Browserbase.NotFoundError,
+ );
+ });
+
+ test('list: request options and params are passed correctly', async () => {
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
+ await expect(
+ client.agents.runs.list(
+ {
+ agentId: 'agentId',
+ cursor: 'cursor',
+ endAt: '2019-12-27T18:11:19.117Z',
+ limit: 1,
+ startAt: '2019-12-27T18:11:19.117Z',
+ status: 'PENDING',
+ },
+ { path: '/_stainless_unknown_path' },
+ ),
+ ).rejects.toThrow(Browserbase.NotFoundError);
+ });
+
+ test('listMessages', async () => {
+ const responsePromise = client.agents.runs.listMessages('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
+ const rawResponse = await responsePromise.asResponse();
+ expect(rawResponse).toBeInstanceOf(Response);
+ const response = await responsePromise;
+ expect(response).not.toBeInstanceOf(Response);
+ const dataAndResponse = await responsePromise.withResponse();
+ expect(dataAndResponse.data).toBe(response);
+ expect(dataAndResponse.response).toBe(rawResponse);
+ });
+
+ test('listMessages: request options instead of params are passed correctly', async () => {
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
+ await expect(
+ client.agents.runs.listMessages('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
+ path: '/_stainless_unknown_path',
+ }),
+ ).rejects.toThrow(Browserbase.NotFoundError);
+ });
+
+ test('listMessages: request options and params are passed correctly', async () => {
+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
+ await expect(
+ client.agents.runs.listMessages(
+ '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
+ {
+ all: true,
+ limit: 1,
+ since: 'since',
+ },
+ { path: '/_stainless_unknown_path' },
+ ),
+ ).rejects.toThrow(Browserbase.NotFoundError);
+ });
+});
diff --git a/tests/api-resources/sessions/sessions.test.ts b/tests/api-resources/sessions/sessions.test.ts
index 137f03d..3f0d171 100644
--- a/tests/api-resources/sessions/sessions.test.ts
+++ b/tests/api-resources/sessions/sessions.test.ts
@@ -34,6 +34,7 @@ describe('resource sessions', () => {
{
browserSettings: {
advancedStealth: true,
+ allowedDomains: ['string'],
blockAds: true,
captchaImageSelector: 'captchaImageSelector',
captchaInputSelector: 'captchaInputSelector',