Implementation
Browser agent, deterministic script or direct API? Choose by the action, not the demo
A capable browser demo does not tell you whether an agent should read a page, edit a field or commit an irreversible transaction. The right choice starts with the action and its consequences.
One invoice, three levels of consequence
An operations team needs to process one supplier invoice in an authorized payment portal. The input includes the invoice, supplier account, coding information and payment details. The expected result is not simply “the browser finished.” It is a payment instruction with a stable portal reference and a confirmed status.
The workflow contains several different actions. Reading the invoice and current account state is read-only. Correcting a cost-centre field is a reversible change. Previewing the payment instruction is also non-committing, although it must expose the exact supplier, amount, account and date that will be submitted. The final submission is irreversible from the automation’s perspective because it can create an external financial effect.
Those distinctions matter more than whether a browser agent can complete the whole sequence in a demo. The team might have an API for account data but not for invoice entry. The form might be stable while a supporting-document page changes between suppliers. One document might require interpretation, while the final payment fields remain entirely structured.
The authorized identity also changes by action. A read-only service identity may be enough to retrieve account state. Editing and submission may require a named user or a more narrowly scoped service identity. Approval belongs to the person or role authorized to commit the payment, not automatically to whichever component interpreted the invoice.
Map the workflow before choosing a tool
Record the required inputs and expected result.
Name the authorized user or service identity.
List each individual portal action.
Label every action read-only, reversible or irreversible.
Identify which actions, if any, a supported API covers.
Mark the points that require interpretation rather than fixed rules.
Note page states that visibly change across cases.
Name the approver for every consequential action.
Define the observable evidence that proves completion.
Choose the interface one action at a time
Choose the least complex method that can perform each authorized action and produce evidence of its result.
Look for a suitable direct API. Use it when it exposes the required operation, accepts the necessary identity and returns a result that can be reconciled with the system of record. Structured requests and responses usually make inputs, errors and references easier to inspect than page interactions.
Use deterministic browser control for stable page states. A fixed script is appropriate when the workflow can identify known pages, fields, buttons and confirmation states without interpreting ambiguous visual or textual variation.
Add interpretation only where fixed logic stops being dependable. A browser-control library combined with a model can help when navigation, labels or document layouts vary in ways that require contextual judgement.
Keep consequential submission separate. An interpretive component may prepare a proposed action without receiving authority to commit it. The final step can remain deterministic and approval-gated.
Require an observable result. Decide in advance which portal status, transaction reference or system-of-record entry proves that the action happened.
This selection happens per action, not per workflow. An API can retrieve the account balance, a fixed browser script can populate stable fields, and an agent can interpret an unusual document page. There is no benefit in extending agent autonomy into steps already expressed reliably through simpler controls.
Separate the interface, browser, library and agent
These options sit at different layers and are not mutually exclusive:
A direct API is an interface to the target system. It avoids browser interaction for the operations it exposes.
A deterministic browser script is fixed control logic, commonly built around known selectors, page states and assertions.
The Browser Use library is an open-source browser-agent and control layer that can run from application code with a chosen model and either a local or cloud browser. Its repository distinguishes the Python library from Browser Use Cloud and its hosted agent API (official repository).
A hosted browser service supplies remote browser execution. It does not determine whether the browser is controlled by fixed code or by an agent. Browser Use documents connecting Playwright or Puppeteer to its hosted browsers over CDP (browser infrastructure quickstart).
A browser agent is interpretive behavior. It uses page observations and a model or other decision logic to decide what to do next.
A deterministic Playwright script can therefore run in a hosted browser. A Browser Use agent can control a local browser or Browser Use Cloud. A team can also use the library to create structured tools while reserving submission for ordinary application code.
If the unresolved decision is about orchestration state or framework selection rather than the interface or browser-execution method, see choosing direct code or an agent framework.
As of 30 October 2026, Browser Use release notes listed 0.13.14 as the latest release and described browser recovery, Cloud URL and saved-task replay updates (release notes). Treat those notes as product-specific change records, not as evidence that a particular portal workflow will succeed.
Choose where the browser runs independently of how it is controlled
Self-managed browser execution
Your team operates the browser lifecycle and decides where credentials, cookies and session state are stored. You also provide logs, recordings and retention controls. This route can run fixed scripts or agents, with infrastructure and maintenance costs owned internally.
Hosted browser execution
A provider operates the remote browser lifecycle and may offer profiles, live inspection, logs or recordings. Credentials and session data cross the provider boundary according to the chosen setup. Retention, vendor dependency, browser time, traffic, proxy and model charges require current provider documentation. Fixed scripts and agents can both use this route.
Compare all five options against the same workflow
Direct API. Best where the portal operator exposes the exact authorized read or write operation. It offers explicit inputs and machine-readable responses, and may provide a stable transaction identifier. Its limit is coverage: an API cannot handle an operation it does not expose. In the invoice workflow, it is the first choice for account lookup or payment-status verification when those operations are available. Your team still owns request validation, authorization, retries and reconciliation.
Deterministic browser script. Best for stable pages with known states and fields. It gives the implementer direct control over selectors, validation, click order and assertions. It becomes expensive to maintain when layout or semantics change frequently. For the invoice, it can handle login-state checks, downloads, coding-field edits and preview generation if those elements are predictable.
Browser Use library. Best when application code needs a browser-agent layer, custom tools, structured results or a choice between local and cloud browser execution. The official project documents local execution, cloud-browser use and hosted-agent options as separate paths (Browser Use project). Its use introduces model behavior, library-version changes and additional execution state that the workflow owner must manage. It is a candidate for the variable supporting-document step, not an automatic replacement for stable controls.
Hosted browser service. Best when the team wants remote browser lifecycle management or provider observability while retaining its preferred control logic. Browser Use documents managed browsers with live preview and optional recording, while Browserbase documents session inspection, video replay, event timelines and logs (Browserbase observability). These are documented provider capabilities, not guarantees that the workflow logic is correct. Hosting also adds a provider boundary, retention choices and usage-based commercial terms.
Browser agent. Best for actions whose meaningful variation cannot be captured economically through fixed rules, such as identifying the relevant section in differently structured supplier pages. Its main limit is that interpretation is not the same as authorization or verified completion. For the invoice, an agent could extract or locate the information needed to prepare the form. It should not infer that a payment succeeded merely because it clicked a button or produced a completion message.
The practical choice is often a composition: API where available, fixed browser control where stable, interpretation where necessary, and either local or hosted execution according to operational constraints.
Keep credentials and session data within the smallest practical boundary
Start with the narrowest identity that can perform the action. Separate read access, reversible editing and final submission where the portal and operating model allow it. Do not give an interpretive component broader authority merely because it shares the same browser session.
Local execution can keep browser state within infrastructure you operate, but your team then owns storage, browser lifecycle and access controls. Hosted execution sends some combination of cookies, profile state, page content and interaction data through the provider environment. That may be acceptable, but it should be an explicit architecture decision rather than an incidental consequence of choosing an agent library.
Browser Use documents reusable Cloud profiles that preserve cookies, local storage and login state across hosted browsers (profile documentation). Its open-source repository separately notes that syncing an existing local profile transfers cookies but not local storage, IndexedDB or extensions, so some sites can require another sign-in. The distinction is important: the hosted profile can persist state after it exists, while the initial local-to-cloud transfer is not a complete copy of every browser storage mechanism.
Recordings and logs can help diagnose selector changes and partial completion, but they may also capture invoice details, account data or other sensitive page state. Recording behavior and retention are provider-specific. Browser Use documents API browser recording as off by default and says recording availability depends on browser shutdown and processing. Browserbase documents automatic session video replay and states that recordings are retained for up to 30 days on non-BYOS projects and 24 hours on BYOS projects (official observability documentation).
For each route, decide:
which identity enters the browser;
which domains may receive secrets;
whether reusable cookies or profiles are necessary;
which page data can appear in logs or recordings;
who can inspect those records;
how long the provider retains them; and
how sessions and recordings are deleted or allowed to expire.
Keep the answer proportional to the action. A read-only public lookup does not need the same controls as an authenticated payment submission.
Put approval before the irreversible click
Design a visible boundary between preparation and commitment.
The automation may collect invoice data, validate required fields, correct the coding value and generate a payment preview. The preview should present the consequential values in a stable form: supplier, amount, destination account, payment date and the invoice or workflow identifier used for reconciliation.
An authorized approver then accepts that exact proposal. Approval should bind to the values being submitted, not merely to a general instruction such as “pay this invoice.” If an agent interpreted the document, preserve its proposed values as inputs to the approval step rather than allowing the agent to reinterpret them after approval.
After approval, permit one deterministic submission attempt. Where the target system supports an idempotency key, unique business reference or equivalent duplicate control, use the invoice or workflow identifier consistently. Where it does not, store the attempt state internally and reconcile the portal before another attempt.
The reversible coding-field edit can be rolled back to its previous value if validation fails. A submitted payment instruction requires a different response: cancellation where the portal explicitly permits it, a compensating business process, or human escalation. Do not describe an irreversible effect as rollback merely because another action might offset it later.
For a broader treatment of consequential automation boundaries, see how to define a protected action.
Treat timeouts as unknown outcomes, not failed outcomes
Each method moves responsibility, but none removes it.
With a direct API, the caller must distinguish a rejected request from a timeout that occurred after the server accepted it. With a deterministic browser script, a changed selector can stop the workflow before a click, while a navigation timeout can happen after the click reached the portal. With an agent, changed page meaning may produce a plausible but incorrect action, and the agent’s own completion status is not proof of an external effect.
When contact is lost after a consequential request may have been sent, treat the outcome as unknown. Reconcile the external action before starting duplicate work rather than assuming that the missing response means the action failed.
For the invoice, recovery depends on the last confirmed state:
If the cost-centre edit was saved but payment was not submitted, inspect the current field and either continue from the verified state or restore the previous value.
If the session expired before approval, create a new session and rebuild the preview. Do not treat an old approval as permission for values that have been regenerated or changed.
If the submit request timed out, search the portal or system of record using the invoice number, workflow reference or returned transaction identifier.
If the portal shows a completed payment, record that result and stop.
If it shows no payment and the system provides a trustworthy final status, return the item to the controlled submission step.
If the evidence remains contradictory or incomplete, escalate rather than guessing.
Observability helps establish what the browser displayed and did, but the system of record establishes whether the consequential external effect exists.
Budget for the system you will have to maintain
Technical feasibility is only the first filter. The selected route creates an ongoing maintenance obligation.
A direct API requires monitoring for schema, authentication and contract changes. A deterministic script requires selector and page-state maintenance. An agent adds model, prompt, tool and evaluation changes. Hosted execution adds provider APIs, browser lifecycle semantics, retention settings and commercial dependencies.
Browser Use documentation says disconnecting from a managed browser does not stop it and requires an explicit stop operation. That detail affects both lifecycle ownership and usage control (Browser Use browser infrastructure). A provider can manage the underlying browser fleet while your application remains responsible for stopping owned sessions correctly.
Observability also has an operating cost. Recordings and network logs can shorten diagnosis, but someone must review exceptions, restrict access and enforce an appropriate retention choice. Browserbase documents live inspection, replay, console and network logs as provider features. Those records still do not decide whether an invoice should be paid.
Commercial structures vary and can change. As of 30 October 2026, Browserbase’s pricing page listed plan fees, included browser hours, concurrency, overage rates, proxy usage, model charges and retention differences (current pricing source). Browser Use documents separate browser, traffic and agent or model-related charges in its current materials. Evaluate the current official terms against your expected session length, concurrency, traffic, recording and model use rather than relying on a single headline price.
Assign ownership before adoption:
application owner for workflow logic and target-system changes;
operations owner for approvals and exceptions;
technical owner for browser, library and provider changes;
security or data owner for credentials, recordings and retention; and
finance owner for usage monitoring where execution is metered.
A hosted browser may reduce browser-infrastructure work. It does not remove selector maintenance, semantic validation, duplicate prevention, post-action verification or exception handling. Related implementation support is described in our Workflow & Agent Implementation service.
Map one workflow and choose the simplest verifiable route
For the hypothetical invoice, the resulting design might look like this:
Use a direct API for account lookup and payment-status reconciliation if the portal exposes those authorized operations.
Use deterministic browser control for stable login-state checks, invoice download, coding-field edits and payment preview.
Consider Browser Use or another interpretive agent only for supplier pages or documents whose meaningful structure varies beyond dependable fixed rules.
Keep approval outside the interpretive step and bind it to the exact previewed values.
Use hosted browser infrastructure only if its lifecycle, data path, observability, retention and cost fit the operating requirements. Hosting does not require agent autonomy.
| Option | Best-fit action | Main limit | Required verification | Recovery owner |
|---|---|---|---|---|
| Direct API | Structured read or write supported by the target system | Cannot cover operations the API does not expose | Confirm response and reconcile the returned reference with the system of record | Application owner |
| Deterministic browser script | Stable pages, fields and confirmation states | Selectors and page semantics require maintenance | Assert the resulting page state and check the external record for consequential actions | Automation owner |
| Browser Use library | Variable browser work needing model-guided control or custom tools | Adds library, model and execution-state responsibilities | Validate structured output and independently verify external effects | Agent application owner |
| Hosted browser service | Remote browser execution for fixed scripts or agents | Adds provider dependency, data-path, retention and usage considerations | Inspect provider session evidence and the target system’s result | Platform owner plus workflow owner |
| Browser agent | Navigation or interpretation with meaningful variation | Interpretation does not provide authorization or proof of completion | Check proposed values before approval and reconcile any committed action | Workflow owner with human exception handling |
Take one bounded workflow you already operate. List its actions, label each one read-only, reversible or irreversible, and choose the least complex method that can produce an observable result for each action. Start with a read-only step or a reversible edit in a controlled environment. Confirm the expected portal state without performing an unapproved consequential submission.
That exercise resolves the same question faced by the invoice team: not whether an agent can operate the portal, but where interpretation is actually necessary and where simpler controls make the result easier to authorize, verify and recover.
Questions and answers
Should every step in a browser workflow use the same method?
No. One workflow can use an API for structured reads, deterministic browser control for stable forms and an interpretive agent only for genuinely variable navigation. Keep one workflow identifier and verification model across those boundaries.
Does using a hosted browser mean using a browser agent?
No. A hosted browser is execution infrastructure. It can run deterministic Playwright or Puppeteer control, while an agent can control either a local browser or a hosted one.
When is a browser agent justified?
Use an agent when the required action depends on interpreting meaningful page variation that fixed rules cannot handle dependably. Keep irreversible submission behind a separate approval and verification boundary.