web.agent() takes explicit model config. CLI model profiles are useful for proving a task, but SDK code should pass the route, model, and credential env-var values it needs.
What changes when you move to the SDK
The CLI is best for first runs and operator tasks. The SDK is best when your application owns the workflow around the browser agent:- Load customer or job context.
- Choose the target site and allowed domains.
- Provide secrets through scoped variables.
- Ask for structured output.
- Stream progress to your UI.
- Validate and persist the result.
- Open the run when something looks wrong.
Production shape
Most production workflows have four parts:- Deterministic setup: read database state, build a safe query, choose policy, and set budgets.
- Agent browsing: let the browser agent handle the web task.
- Deterministic validation: check schema, business rules, and source URLs.
- Evidence and failure handling: store artifacts, inspect status, and return blockers clearly.
Where deterministic browser control fits
Use deterministic browser control when a step must be exact: checking an expected page, downloading a known file, validating a selector, replaying a recovery path, or attaching another browser framework. It is an advanced workflow tool, not the fastest first run.Run tasks with web agent
Prove delegated browser tasks from the terminal before embedding them in code.
SDK quickstart
Run your first
web.agent() workflow in TypeScript.Structured output
Return data your product can validate and store.
Policies and approvals
Constrain domains and handle high-impact actions.
Mix agent and code
Combine browser agents with deterministic product logic.