Sandbox and browser isolation
This page explains how Utming isolates the commands it runs and the websites it visits, and what each part of the system can and can't reach.
The short version: commands run as an unprivileged user in a workspace container. The browser runs in a separate container. Provider keys and the owner access key stay in the server process.
Trust boundaries
Section titled “Trust boundaries”flowchart LR
server[Utming server<br/>provider keys · Vault]:::accent
subgraph workspace[Workspace container]
sandbox[Sandbox user<br/>runs Pi commands]
cli[One user per CLI<br/>one CLI token each]
end
browser[Browser container<br/>Chromium · profiles]:::muted
net([Internet])
server -- supervised commands --> sandbox
server -- sealed CLI run --> cli
server -- stdin bridge --> browser
sandbox --> net
cli --> net
browser --> net
What each part can and can't reach
Section titled “What each part can and can't reach”| Server | Sandbox user | Connected CLI user | Browser container | |
|---|---|---|---|---|
| Provider keys | Yes | No | No | No |
| Owner access key | Yes | No | No | No |
| Vault values | Yes | No | No | Only a value the server enters in a page |
| A connected CLI token | Yes | No | Its own token only | No |
| Docker control | Local socket or restricted proxy | No | No | No |
| Workspace files | Through a guarded reader | Yes | Files passed as arguments | No shared mounts |
| Browser profiles | Through the bridge | No | No | Yes |
| Internet | Yes | Yes, see the limits below | Yes, with the same limits | Public addresses only, signed-in pages included. |
The workspace container
Section titled “The workspace container”Pi's native tools (read, bash, edit and write) run inside the workspace through WorkspaceSession.exec. Each thread works in /workspace/<thread ID>. A source install mounts UTMING_DATA_ROOT/workspaces; self-hosted and desktop runtimes use a persistent workspace volume. /home/node is a separate volume, so tools Pi installs persist.
The tools use the thread's Linux workspace path on every host, including Windows. The runtime converts Windows file paths before it sends file operations to the container.
- Commands run as the unprivileged
nodeuser, without sudo. - Bash gets no host environment. It sets the owner's
TZwhen known. - No workspace file is loaded as instructions.
Both the workspace and browser containers drop all capabilities, set no-new-privileges and have these limits:
| Container | Source install (compose.yaml) |
Local desktop runtime | Self-hosted server defaults |
|---|---|---|---|
| Workspace | 8 GB memory, up to 4 CPUs, 4,096 processes | 2 GB memory, 2 CPUs, 1,024 processes | 2 GB memory, no CPU limit, 512 processes |
| Browser | 8 GB memory, up to 6 CPUs, 4,096 processes, read-only root | 2 GB memory, 2 CPUs, 768 processes, read-only root | 3 GB memory, no CPU limit, 1,024 processes, read-only root |
For source installs, pnpm start uses the Docker daemon's CPU count when it is lower than these caps. It also respects lower UTMING_WORKSPACE_CPUS and UTMING_BROWSER_CPUS values from the shell or .env. Direct Compose commands keep the listed defaults; set those variables when using a smaller Docker VM.
The self-hosted server reaches Docker through a restricted proxy for its workspace and browser containers. The proxy hands each running command's stream over as a raw connection, so its HTTP time limits don't close commands that run longer. Its Compose configuration allows separate memory limits through UTMING_WORKSPACE_MEMORY and UTMING_BROWSER_MEMORY.
Command permission
Section titled “Command permission”Every model-issued Bash command passes the same Trust checker as app and browser actions. The runtime supplies the exact command, its actual folder and its effective time limit, including for delegates and nested calls. It waits behind an earlier app confirmation and checks Stop and application shutdown again before dispatch. The same cancellation signal reaches the command process. A failed check or a command that needs confirmation is refused. No pending shell approval is saved. A command that is allowed still passes the current turn and owner-request checks before it runs.
The checker cannot read a script from its filename. After a Trust refusal confirms that the command did not run, the model can inspect the program. It can put the full program text in a new checked command only if it contains no secrets or private data. Command records keep a redacted prefix of up to 4,000 characters. The program must not depend on its file name, path, shebang or resources relative to that file. The interpreter, flags, folder, inputs and outputs must stay the same. If the text form can change the effects, the model must not run it. All permission checks apply again. The checker must see the program text itself; command substitution keeps it hidden. A here-document must use a quoted delimiter that is not a complete line of the program.
Generated file helpers and command wrappers use an absolute shell and a fixed path of system programs. Python helpers run /usr/bin/python3 -I, so workspace modules and user startup files cannot replace them. Only the checked model command receives the normal path for installed tools. File reads, output capture and cleanup stay in the helper environment.
Successful commands record the Trust basis in Usage. The action target contains no command text or file content. Existing command records keep their separate redaction rules below.
The checker is a model and can make mistakes. Mutable scripts, imports and program settings can have indirect effects. This check does not inspect each network connection or prevent all data transfer. Public internet access remains available.
The command supervisor
Section titled “The command supervisor”Every command goes through a small supervisor inside the container, in src/providers/docker/command.ts.
- It owns the command's session and signals every process in it, even ones that left the process group.
- A command also ends the processes it detached, when the command itself ends, so work it left behind never outlives it. Stop ends the whole tree the same way, and escalates to
SIGKILLfor a process that ignores the first signal. - It enforces the timeout: 59 minutes for
bashby default. The model can ask for longer. It also enforces an output limit. A command stopped at either limit fails with an error that names the limit and its value, such as "Workspace command output passed its 16 MB limit." - It acknowledges when the command ends. If that acknowledgement is lost, the command fails as uncertain with the specific reason, such as the command stream closing early, and never runs again. The server cancels the other running commands, and new commands wait. From
/var/tmp, a folder the command can't remove, a check then stops every process owned by the command's Linux user,nodeor the connected CLI's own user, including background processes earlier commands started. It spares only the container's init process, the check's own chain of parent processes, and, when init isdocker-initortini, the container's main process: the earliest started child of init. When the check confirms none remain, the workspace reopens. When it can't prove that, for example because it can't read a running process's owner or parent, the server fences the workspace with the reason: no more commands run until Utming restarts.
Command output
Section titled “Command output”Up to 1 MiB of output reaches Pi. Pi shows the model the tail, and codemode scripts get the whole output and the exit code. Larger output keeps its first and last 512 KiB and names the complete log in the workspace.
For the task's command view, the runtime also saves each bash command. It saves the exit code when available and up to the last 16,000 characters of the redacted command output. It removes known secrets and secret-shaped text from the full output before taking the tail, and records nothing when no command redactor is set. The record sits on the call's tool_start and tool_complete or tool_failed rows in turn_events, and the owner's task and Usage routes read it. Usage lists each recorded command once and loads its output on request. The CSV export includes the command, exit code, status and saved output. These records remain in the local database until all data is removed. See Watch Utming's commands.
Pi writes truncated output, codemode files and images, and extracted web PDFs to the server's temp folder. The runtime moves each file into the workspace's .utming/outputs folder and rewrites its path before the result is recorded. See src/providers/pi/sandbox.ts.
Connected CLIs
Section titled “Connected CLIs”Each connected CLI runs as its own Linux user, derived from its path ID, in group utming-connected. Before each run, the supervisor installs the CLI's declared source into /var/tmp/utming-cli-<path id>, a folder only that user can open, if it's missing. It refuses an install folder or executable that another user can write, and refuses to run if another CLI's install belongs to the same user. So one CLI can't change another's install or read its token.
The CLI then runs with an environment built from scratch: a fixed PATH, a private temporary HOME and XDG_CONFIG_HOME, LANG and the connection's credential variables. Nothing comes from the sandbox user's files or environment, so a program the model plants never receives the token. See MCP, APIs and CLIs.
The browser container
Section titled “The browser container”The browser is a separate trusted container. It doesn't share mounts or a network namespace with the workspace. The server drives Vercel Labs agent-browser over a persistent multiplexed stdin bridge to a private Unix socket.
| Setting | Value |
|---|---|
| Display | One headed Chromium on a private 1920x1080 virtual display |
| Viewport | 1440x900, with Noto fonts and software WebGL |
| Time zone | The owner's saved IANA time zone, or UTC when unknown or invalid |
| Language | The owner's formatting locale, such as en-GB, sent as Accept-Language |
| HTTP cache | Under /tmp, outside the owner's profile |
One browser, a tab per session
Section titled “One browser, a tab per session”Utming runs one Chromium for the owner, with one profile that keeps cookies, logins and carts. Sessions share it, so two sessions on one website share its sign-in and cart. The chat, each task, each scheduled or background run and each subagent get their own window in that browser, so every session's page stays painted for screenshots and the live view. Each session has its own agent-browser session, attached to the browser over the DevTools protocol and pinned to its tab, so sessions act in parallel without touching each other's pages. All windows share the browser's network guard. Utming keeps one DevTools connection to the browser to place each session's window, track which tabs each session opened and route downloads.
- The browser stays up. It starts on first use and runs while Utming runs.
- A session keeps its tab for as long as it lives. Nothing else closes it: no other session, eviction or profile switch.
- Tabs a page opens belong to its session. When a page opens a popup or a new tab, the session follows it, and returns to the page that opened it when it closes.
tab_listandtab_switchshow only the session's own tabs. - The tabs close when their session ends, such as when a task finishes or you stop it. The profile stays, so a later task on the same website is still signed in.
- Only you erase the profile, with Remove all data.
- Downloads stay with their session. The browser saves every download to one private folder. Utming moves each finished file to the session whose tab started it and deletes a file that no session's tab started.
- A lost session recovers on its next step. Before each step, Utming asks the browser which of the session's tabs are still open and checks its driver with one small read. If the driver stopped or the tabs closed, Utming gives the session a new driver in the running browser. If the browser crashed or the browser service restarted, Utming first starts the browser again with the same profile. Either way it reopens the session's last page without the query string, and then runs the step. A session that stopped during an action doesn't reopen on its own, because the action may have happened: Pi opens the website again, checks the result there and never repeats the action. A browser crash can lose sign-ins from its last 30 seconds, because Chrome saves new cookies on a timer. A restart keeps them.
Pi reads the page from agent-browser's accessibility snapshot, with @eN references, as plain text after the page URL. A snapshot returns up to 40,000 characters with link addresses, and Pi reads the rest with an offset. After any other action, Pi gets the first 10,000 characters of the page without link addresses, which keeps each step's context small; Pi takes a snapshot when it needs more. When an action keeps the same document URL as the previous observation in the same turn, Utming returns (page unchanged) when nothing changed, or an incremental line diff when the changed lines stay within 65% of the page, falling back to the full text otherwise; explicit snapshot calls (or full: true) always return the full page. Pi interprets the page and chooses controls. The server also reads the selected control's form method and destination for the trust check, and the page's visible text when it prepares a confirmation question. For a card payment, the browser reads the checkout page's visible text when it prepares the payment, after it enters the card and again just before it submits, and compares only the money amounts in it: those written with a currency symbol or code in the main page, not amounts inside payment frames or images or without a currency marker.
A snapshot can use a CSS selector to read one part of the page. If the selector is invalid or no element matches it, Utming gets a specific reason and can take a snapshot of the whole page or choose a valid scope. The page stays open.
Pi can run multi-step browser flows in one turn with the browser_run tool, which executes a short async JavaScript script in an isolated worker thread with a node:vm context and a JSON-bridged page helper (open, snapshot, click, fill, type, press, select, check, uncheck, hover, drag, scroll, back, forward, reload, wait, evaluate, tabList, tabSwitch, acceptDialog, dismissDialog, screenshot). Every step inside browser_run runs sequentially through the same trust check, origin/URL/target guards and turn lock as a direct browser call, skips intermediate page snapshots until the script calls snapshot or finishes, and pauses cleanly if a step needs the owner's approval (up to 20 steps or 30 seconds per call, after which the worker is terminated).
A browser wait takes one condition: text to appear, a URL to match, or a page load state. waitMs sets how long to wait for that condition. If the call omits the condition or supplies more than one, Utming gets a validation error and can correct the wait on the same page.
Browser hit tests convert viewport positions to document coordinates using the target page or frame's current scroll position. This keeps the form shown to the trust check bound to the visible control after scrolling. A hit test finds the control a click would reach. A banner or dialog over the control blocks it, and Utming has to dismiss it first.
Every browser command has a deadline: 60 seconds, or a wait's own timeout plus 30 seconds. That leaves room for agent-browser's own 30-second limit on each browser call, so only a browser that has stopped answering misses it. A session that misses its deadline, is interrupted or doesn't close within 5 seconds has its agent-browser process killed and its tab closed. The browser and other sessions' tabs keep running. A cancelled action requires an explicit open before that session can continue. A lost bridge response still requires recovery of the application namespace because the worker may have closed it. Utming never repeats the interrupted action during recovery. While a dialog is open, the observation is the dialog, and every action except open is refused until Pi accepts or dismisses it.
The owner's profile stays on the browser container's volume when Utming replaces the container, for example after a restart. Chromium's profile lock from the old container names a host that no longer exists. Before Chromium starts, Utming removes a lock whose <host>-<pid> target names another host, so the profile opens again. A lock from the current container, or one Utming can't read, stays. When the browser fails to start, Pi sees that no page opened and the reason the browser gave, with Utming's internal browser paths removed. When a browser command exceeds Utming's time limit, Pi sees that fixed reason. Any other failure outside the browser's own errors shows only the generic "The workspace browser could not complete this action. Try again." message.
Known secret values (passwords, codes, card numbers and security codes) are removed from tool output and masked in screenshots; usernames and the cardholder name aren't secrets and stay visible. URL parameters that carry credentials, such as tokens and signatures, are hidden; other query parameters stay. When an action fails, Pi sees the browser's own error with known secrets removed. Pi never reads the browser profile's files. The code is in src/providers/agent-browser/.
Browser handoff
Section titled “Browser handoff”When Pi needs you in the browser, it calls browser with action: handoff and a clear instruction. sign_in does the same when no saved login applies. Utming web shows the live tab in chat.
sequenceDiagram participant Pi actor You participant Server participant Browser Pi->>You: Instruction and live browser view Browser-->>You: Live JPEG frames You->>Server: Clicks, typing and scrolling Server->>Browser: Forwarded while the chat turn waits You->>Server: Return to Utming Note over Pi: Next turn takes a fresh snapshot
- Each handoff identifies its waiting turn and tab. Input reaches only that tab while its question stays pending. Other sessions keep their own tabs.
- Return to Utming continues the session that asked, including a background session, without posting a message for you. Pi looks at the page to see what you did.
- The panel scrolls into view once, when its first frame arrives. While it is open, the task ledger marks its task
browserHandoff. With the full prompt, not the compact one for small context windows, the coordinator then points you to the panel instead of forwarding a message, because a task reply closes the handoff. - One bridge call carries frames out, newest first, and your input in. Each input is acknowledged after the browser applies it. Failures reach the view without retrying the input. Losing the connection rejects pending input and disables it until the view reconnects.
- The panel's title shows the page's protocol, host and port, taken from the browser's current address, never from Pi. The path and query stay out.
- Frames pause during credential entry. Passwords you type in the handoff join the known secrets.
- Utming keeps the last account and password you typed on a page in memory only. An account pairs with a password only when you typed it on the same origin, during this handoff and before the password. When you select Return to Utming, Utming takes that login from the browser and keeps it in memory for 10 minutes; the reply says only that a login can be saved and for which host. Utming saves it to Vault under that origin only when you select Save login to Vault, and only for HTTPS or loopback origins. The saved login then follows the website matching rules.
- An init script makes every passkey request fail at once and reports no passkey support, so a sign-in doesn't open a passkey prompt that the live view can't show. Utming adds it to every tab, popup and frame before the page's own scripts run.