// CONTENTS Part 03 · Core engine

// PART 03

Browser and computer use

Chapter 16 / 56 3 min read English Part 03 of 14

Agentic browsing is controlled by the botbrowserpolicy crate (Cargo feature browser-policy). The crate does not drive a browser. It is a control plane: an external driver service reports each completed step, and the crate decides whether that step may be recorded, charges it against a budget, and persists what the page said.

Authority: botserver/crates/botbrowserpolicy/src/ — policy.rs, budget.rs, tasks.rs, memory.rs, api.rs.

Task lifecycle

POST /api/browser/tasks                → queued
  POST …/:id/pause                     → paused   (only from running)
  POST …/:id/resume                    → running  (only from paused)
  POST …/:id/cancel                    → cancelled (not from a terminal state)
  POST …/:id/advance                   → records one step (only while running)
  POST …/:id/finish                    → finished, stores result + citations
  GET  …/:id/events                    → SSE stream of new steps
GET  /api/browser/tasks                → the caller's recent tasks
GET  /api/browser/memory               → browsing facts
DELETE /api/browser/memory             → purge the caller's facts
GET|PUT /api/browser/policy            → platform admin policy document

States are the string constants queued, running, paused, finished, failed, cancelled. A policy or budget violation during advance marks the task failed and stores the reason in error, so the failure is visible after the fact rather than only in the response.

GET …/:id/events is an SSE endpoint that polls the task once per second, up to 3,600 ticks. Because EventSource cannot set headers, the suite passes the bearer token as ?token=; a header wins when both are present.

Policy document

The per-task policy is embedded in the task’s plan JSONB under key policy (PolicyConfig::from_plan). When absent, PolicyConfig::default() applies.

Field Default Meaning
allowed_domains [] Empty means “allow everything not denied”; otherwise exact host or dot-suffix subdomain
denied_domains [] Always wins over the allow list
max_steps 60 Step cap for the task
max_cost_units 10_000 Cost cap, in milli-units as reported by the driver
allow_credential_pages false Disables the credential-phishing guard

The budget is enforced per step: the driver reports a cost, the crate refuses to record steps beyond max_cost_units, and a driver that reports zero is never stopped by the cost limit.

Computer use

A separate host module, botserver/src/core/computer_use/, tracks desktop-level actions (the “use the computer” surface). It is a pending-action map keyed by id with a TTL, pruned on read — explicitly volatile state, not a queue. The web channel reaches these capabilities through turn hooks and the __ui_plan__ planner, not through a browser engine inside botserver: as with browser policy, the platform orchestrates and audits; the execution happens in a driver or VM outside the API process.

Agent VM (the heavier sibling)

When a turn needs an actual machine — package installs, dev servers, file trees — the agent VM is used instead: a dedicated Incus container per session (botagent crate, agent_sessions binding, snapshots and idle stop). The browser-policy control plane and the agent VM share the same philosophy:

Concern Browser policy Agent VM
Execution external driver Incus container
Budgets steps + cost units cold-start budget, idle timeout
Memory browsing facts (per caller, purgeable) conversation folder, published to Drive
Persistence task rows + memory rows agent_sessions, snapshots

What to verify before relying on it

  • The browser-policy feature must be compiled in (cargo build --features browser-policy); otherwise the routes do not exist.
  • The driver service is external: the policy crate gates and records, but if nothing calls /api/browser/tasks, nothing happens.
  • Browsing memory is per caller; DELETE /api/browser/memory is the purge path — there is no admin-wide wipe endpoint.

Found a mistake? Open an issue · All books

// SEARCH ESC
Pagefind · 236 pages · 4 books Enter to open ↑ ↓ to move