Browse
Gives every agent (main and subagents) a browse tool: open a web page in a headless browser, act on it like a user, and read what happened — an outline of the page with clickable refs, console errors, failed or blocked requests and, on request, a screenshot. The browser stays open across calls in a conversation, so form contents persist, and logins on sites allowed for the conversation outlive the browser.
Workspace HTML files are served from the workspace through the file preview's resolver. Other sites are governed by the network access mode below. The browser itself never connects anywhere: every request is answered by Codumentor, and allowed sites are fetched by Codumentor with the client web_retrieve uses, which only connects to public addresses (checked at connect time, so DNS rebinding cannot reach the host's own services). The admin's intranet sites are the one exception (see below).
Configuration
Change the shipped entry with plugins_overrides (a top-level plugins: key replaces the whole plugin list):
plugins_overrides:
- module: codumentor.plugins.browse
class: BrowsePlugin
args:
enabled: true
network:
mode: user_rules # none | admin_list | user_rules
admin_origins: # exact origins; in user_rules mode, a cap
- https://cdn.jsdelivr.net
private_origins: # intranet sites; address must be in web.egress.allow_private
- http://wiki.corp.example
| Parameter | Default | Description |
|---|---|---|
enabled | true | Enable the plugin. |
target_agents | "all" | Which agents are offered the tool. |
idle_timeout_seconds | 300 | Soft idle timeout: after this long unused, a browser may be closed for a new one when every browser slot is taken; otherwise it stays open. |
max_idle_seconds | 1800 | Hard idle timeout: close a browser after this long unused even when nobody needs its slot. Must not be below idle_timeout_seconds; setting the two equal always closes the browser at the idle timeout (the previous behaviour). |
max_browsers | 4 | Most browsers open at once in this server process. |
max_outline_chars | 4000 | Character budget of the page outline in one result. |
network.mode | "none" | Other sites a page may load (see below). |
network.admin_origins | [] | Exact HTTPS origins (https://host[:port], no path or wildcard). |
network.private_origins | [] | Intranet sites: exact origins, https:// or http:// (see below). |
session.checkpoint_ttl_seconds | 900 | How long a browser stays open while a call waits mid-way for the user to allow a site; after it the resumed call reports that its steps must be repeated. |
session.cookies | "conversation" | conversation: allowed sites may set cookies, so logins work (see below). off: other sites get no cookies or Authorization headers. A change applies to browsers started after it; a browser already open keeps the setting it started with until it closes (max_idle_seconds) or the server restarts. |
limits.max_tabs | 4 | Most tabs one browser keeps open; a popup beyond it is closed before it runs, and the result says so. |
limits.max_download_bytes | 26214400 | Largest download kept (25 MB); a larger one is cancelled and reported. |
limits.max_upload_bytes | 26214400 | Largest workspace file one upload step may attach. |
teach.enabled | true | Operator switch for recorded handoffs ({handoff, record: true}); off, such a step is refused. |
teach.retention_days | 30 | Days a recording is kept in the conversation's files; it is also deleted with its conversation. |
teach.screenshots | "commit_points" | commit_points: one screenshot per recorded step; off: none. |
teach.max_steps | 400 | Most steps one recording keeps; capture stops there. |
teach.recording_ttl_seconds | 3600 | How long a recorded handoff may wait for the user, and the longest a recording runs. |
live_view.watch | true | Let a conversation's owner watch its browsers at any time, not only during a handoff (read-only, never recorded). |
live_view.takeover | true | Let the owner take a browser over: a running browse call stops before its next step and hands the page over; a browser no call uses is held by the user until they hand it back. |
live_view.hold_idle_seconds | 900 | A browser the user took over while no call was using it is handed back automatically after this many seconds without their input, so the agent can use it again. |
live_view.legacy_stream | false | Diagnosis and rollback: send the watch and handoff views every screencast frame as it comes, without suppressing identical images, pacing (4 fps watch, 10 fps handoff) or seeding a new viewer. Aggregate live-view metrics: GET /ui/admin/browse-live-metrics. |
live_view.binary_images | true | New clients receive the watch and handoff images over a same-origin binary WebSocket (…/images) with display acknowledgements (at most one image in flight per viewer, 3 s acknowledgement timeout) and read state from the SSE stream with ?images=0. Clients fall back to the SSE stream when the socket cannot be used; old clients keep it. Advertised as binary_images in the live listing and the handoff state. Ignored with legacy_stream. Metrics modes watch_ws/handoff_ws. |
live_view.adaptive_tiles | true | With binary_images on, capable viewers receive lossless WebP full frames and tile updates from Chromium's PNG screencast. Newer clients can receive just the changed rectangle within each tile. Requires Pillow with WebP support on the server. Ignored with legacy_stream. |
passwords.mode | "ask" | ask: during a handoff, offer to save a password the user logs in with and fill saved ones in (stored encrypted as the user's secrets). off: never capture, offer or fill. Each user can also switch the feature off for themselves in Settings → Saved logins. |
passwords.agent_login | true | Let the agent use a saved login with the {login: ...} step (phase C). |
passwords.max_logins | 100 | Most saved logins per user (1–1000). |
Both switches are on by default. To keep binary WebSocket delivery but use JPEG instead of adaptive tiles, set this browse plugin override:
plugins_overrides:
- module: codumentor.plugins.browse
class: BrowsePlugin
args:
live_view:
adaptive_tiles: false
Clients that do not offer WebP tiles, or servers without a usable WebP encoder,
keep receiving independent JPEG images on the binary socket. If the image socket
cannot be used, the UI falls back to JPEG over Server-Sent Events (SSE). Turn
binary_images off to return to paced JPEG/SSE.
Diagnosing a zoomed or clipped live view
Temporarily enable capture and viewport diagnostics on the server:
logging:
logger_levels:
codumentor.plugins.browse.live_view: DEBUG
codumentor.plugins.browse.viewport_fit: DEBUG
Reproduce the issue, note the time, then resize the workspace until the page
looks right. Compare the browse: capture geometry lines before and after
resizing with the browse: viewport lines. The capture log records the
requested viewport, Chromium's reported device dimensions and page scale, and
encoded image dimensions. It logs the first frame, geometry changes, and the
first available frame after top-level navigation, without URLs or pixels.
If the reported geometry is unchanged while the rendering is clipped, repeat
with adaptive_tiles: false to compare the JPEG path.
Chromium can drop the fitted size on its own after a navigation or tab change
(frames fall back to the window size, e.g. device=780x437 against
requested=1120x750). The live view then applies the fitted size again and
logs browse: viewport drift device=… status=applied. If drift lines repeat
without the geometry settling, the override is being reset faster than it is
re-applied.
Network access modes
| Mode | Other sites a page may load |
|---|---|
none | Nothing beyond workspace files. |
admin_list | Exactly the origins in admin_origins. |
user_rules | Origins each user allows for themselves, capped by admin_origins when that list is not empty. |
Codumentor's own origins, file: URLs and private, loopback and link-local addresses are refused in every mode, except the intranet sites below; listing a Codumentor origin in admin_origins or private_origins is a configuration error. Only HTTPS sites can be allowed, except the intranet sites.
Intranet sites
private_origins lists the only sites that may be on a private address or plain HTTP. A listed site is fetched only when the address it connects to is inside the operator's web.egress.allow_private ranges as well; both lists are needed:
web:
egress:
allow_private: ["10.20.0.0/16"]
plugins_overrides:
- module: codumentor.plugins.browse
class: BrowsePlugin
args:
enabled: true
network:
mode: user_rules
private_origins: ["https://wiki.corp.example", "http://10.20.0.5:8080"]
Users approve listed sites like any other (in admin_list mode they are reachable as listed; the admin_origins cap does not apply to them) and cannot add to the list: a Browse(...) rule for any other private or plain-HTTP site allows nothing. They are fetched by a separate client that connects only inside those ranges, so a public site the user allowed cannot be pointed at the intranet through DNS. The approval card says these sites are reached from the Codumentor server's network, not from the user's machine. If a listed site's name resolves to an address outside those ranges (a public one included), it is refused as outside the operator's allowed ranges. Keep the ranges to the intranet: the plugin warns at startup when allow_private contains a loopback range or 0.0.0.0/0 / ::/0 while private_origins is set.
Reading a refusal: which setting is missing
The refusal reasons the tool reports map directly to the setting to change — both intranet lists are needed, so a site refused for one reason may still be missing the other:
| Refusal reason | Meaning | Fix |
|---|---|---|
private or loopback address; an intranet site can be allowed only by listing it in browse.network.private_origins AND covering its address with web.egress.allow_private | The site is not one of the admin's intranet origins (or its address is private and neither list covers it). | Add the site's exact origin to browse.network.private_origins and make sure its resolved address is inside a web.egress.allow_private CIDR. |
address outside the operator's allowed ranges (web.egress.allow_private) | The origin is listed in private_origins, but the address it resolves to is outside every web.egress.allow_private CIDR. | Widen or add a CIDR in web.egress.allow_private covering the address the name resolves to. |
Resolve the site's name first (host <name> from the Codumentor host): private_origins takes the origin as users type it, while allow_private must cover the address it resolves to — a CNAME pointing at another internal host is covered by the target's address, not the name. Note that web.egress.allow_private is a live-reload setting, but plugins_overrides (including private_origins) is loaded once per process and needs a server restart.
In user_rules mode a call that opens another site, or names sites in allow_origins, shows the normal approval card: Allow once (this call only), Always allow this site (saved as a Browse(https://example.com) rule in Settings → Tool approvals) and Deny. Deny rules win. A Browse rule names exactly one site; a bare Browse deny rule refuses every site, and wildcards are not accepted. When a call that has not asked yet meets a site nobody allowed (a click or form submission to another site, a script from a CDN), it stops before its next step and asks then: a navigation to that site waits, form data included, until the user answers, and the call continues after the steps it already ran (an approval re-runs nothing). Sites met after a call has asked are refused, listed in the result and asked for by the next call.
The personal flavor ships with user_rules; elsewhere the default is none.
Logins on other sites
With session.cookies: conversation the agent's browser (a fresh profile; it never sees the user's own browser cookies) keeps the cookies allowed sites set, under Chrome's own rules. A top-level navigation carries the cookies Chrome attaches, as any browser would. Any other request (an image, a script, a fetch, an iframe) carries cookies and a page-set Authorization header only when it is same-site with the page in its tab: same scheme and same registrable domain, from the public-suffix list with its default rule, so sso.corp.local and app.corp.local count as one site and IP-address hosts must match exactly. Cross-site requests carry none, which keeps one allowed site from acting with another's login. Third-party sign-in widgets inside iframes therefore do not work; redirects to a login page do.
The browser closes after idle_timeout_seconds, but the cookies of sites allowed for this conversation or always are kept in server memory (never on disk) and put back into the conversation's next browser, as long as the site is still allowed. They are dropped when the conversation is deleted or the server restarts. The approval card says when the agent's browser already holds cookies for a site, since the agent can then act as the user there.
Saved passwords
With passwords.mode: ask (the default), when the user logs in during a handoff, the card offers to save the password once the login looks successful. Saving stores it encrypted as the user's own host-only secrets (the same store as the user-secrets panel; the agent's secret registry never contains one), keyed to the exact origin and username. Next time the user is in a handoff on that site, the saved login is filled into the page — the user still presses Sign in themselves.
The agent can also use a saved login by itself with the {login: true} step (or {login: true, record: "username"} when several exist): it fills and submits the saved login on the current page. This needs passwords.agent_login (on by default), a site kept for the conversation (a conversation grant or an always rule — a one-call allow is not enough, because a saved login acts as the user), an https (or admin-intranet) origin, and the user's saved-logins switch on. Several saved logins make the step list the usernames so the agent can ask the user which one to use; the agent never chooses silently. On an unattended run (a scheduled task, a webhook, a background agent told not to ask — nobody there could answer a handoff) the step works only with a login whose "Allow the agent to use this login when you are not present" switch is on; otherwise it fails and says so. The password itself never reaches the model — the step reports only the username and whether a password field is still shown (a possible failed login).
The user manages saved logins in Settings → Saved logins: the list (site, username, no passwords), delete, a per-login switch "Allow the agent to use this login when you are not present" (off by default; unattended runs need it) and the master switch for the whole feature. A site the user answered Never for this site on is listed there too and asked about no more.
Without the user_secrets plugin (or with it disabled), or when the instance has no jwt_secret, the whole feature is inactive: nothing is captured, offered or filled.
Handing the browser to the user
For a login, 2FA, a CAPTCHA, a consent dialog or a confirmation, the agent adds a step {handoff: "why"}. The web UI then shows Take over the agent's browser: a live view of the page that takes the user's clicks, taps, scrolling and typing (pasting and IME input too). Done hands the page back and the agent reads it as the user left it; Cancel fails the step. Nothing typed is recorded, and the page still loads only allowed sites. While you drive, the page is laid out at the card's size (so a phone gets the site's mobile layout), and the agent's own viewport comes back when the handoff ends. A page that is not allowed yet shows "site isn't allowed yet" over the page, with Allow once, More options (this conversation, always) and Go back; a refused form submission is not re-sent, so submit the form again after allowing. Other sites the page tried to load are counted in the toolbar's N blocked chip: its list groups them by domain, none checked. Check the ones to allow and choose Allow once or a longer scope; with nothing checked, the same buttons allow all of them. Unchecked sites stay blocked. The ⓘ button shows the agent's full reason and what the handoff means. The handoff waits up to session.checkpoint_ttl_seconds. The TUI and Telegram show the reason and a way to cancel (in Telegram, any next message); the takeover itself happens in the web UI. Scheduled and other unattended runs cannot hand over: the step fails at once.
A handoff with record: true lets the user teach the agent a task by doing it. It opens like any handoff, and nothing is captured until the user presses Start recording (the card is titled "Teach the agent: …" and the consent text stays open until then). From then on the user's clicks, the values entered (never a password: its fill is stored as «password, not recorded»), the pages and one screenshot per step are stored with the conversation; a one-line bar shows the time and step count; Pause stops capturing, Add note (Ctrl+.) attaches a remark to the current step, Explain so far hands what you did so far to the agent, and Discard (in the bar's menu) or Cancel discards the recording. Done returns a short step index to the agent, with signals worth asking about (a second click on the same button, long waits, errors, choices, final commits), and the per-step files under the conversation's from-browse/teach/<id>/. Recordings are deleted with the conversation and after teach.retention_days. Teaching is available on desktop only.
The owner can also watch a conversation's browsers (the main agent's and each subagent's) while the agent works, with the agent's current step captioned and its target highlighted, and take over: the running call finishes the step in flight, stops before the next one (or in a wait_for that is polling), and hands the page over like a handoff. The steps after it are not run, and the agent's result says so (the user took over before step 3 of 5; steps 3–5 were not run.). Taking over records nothing; the card's Record this correction starts a recording as Start recording does. Nobody else, admins included, can watch or take over. The watch view is the conversation workspace's Browser tab: the page fitted to the pane, the agent's step as the toolbar's status line, a picker when there are several browsers, and Take over (desktop only).
When watching and takeover are enabled, open Workspace → Browser on desktop, enter a complete URL, and choose Open browser. This starts the main agent's browser under your control without an agent turn. The same site rules and Allow controls apply. Use Go to enter another URL while you hold the browser, then choose Hand back (or Hand back and tell the agent). The agent's next browse call can read the current page without opening it again.
Taking over a browser that no call is using gives it to the user (a hold): they drive it like a handoff, with the same Allow and viewport fitting, until Hand back, or until live_view.hold_idle_seconds pass without their input, or until the browser closes. Meanwhile the agent's browse calls on that browser are refused at once (browser_held_by_user), and nothing is run. The first call after a hold is told that the user used the browser, which URL they left it on, and that earlier element refs are stale. A hold records nothing, and a held browser is not closed for idleness. Routes: POST /ui/plugins/browse/live/{conversation_id}/takeover|handback|input|viewport|allow|navigate?browser=<key> (contract in watch_routes.py).
Tabs, downloads and uploads
A popup or a link that opens a new tab gets an id (t2, …). It is set up like the first page (WebSockets blocked, request interception) before any of its scripts runs. The result lists the open tabs and marks the current one. Steps act on the current tab until {tab: "t2"} switches; {close_tab: "t2"} closes one. During a handoff the live view follows a popup the user opens. A download is saved to the conversation's files (the result gives its path and size). It is never opened or run, and the browser's copy is deleted. {upload: ref, file: "repo/path"} puts a workspace file into a file field. The path is checked like any workspace path: no .., no absolute path, and no symlink out of its folder. The user approves every upload on a card that names the file and the site, with Allow once and Deny only. Rules, modes and conversation grants never answer it, and unattended runs cannot upload. In Telegram, reply allow to approve an upload; any other reply refuses it.
Requirements
Needs a Chromium-family browser on the host (Chrome, Edge, or Chromium); without one the tool is not offered. Set CODUMENTOR_CHROME_PATH if the browser is not on the usual path.
Related
- Files — the preview resolver that serves workspace pages
- Web Retrieve — fetching pages as text