Give an agent a browser
Give an agent a headless browser it drives through structured tools, limited to the sites you name.
The browser runs in a sandbox pod that reaches only the hosts of the Connections bound to it. A ToolPolicy then judges each navigation by the host it asks for. Sandbox security explains what each layer contains.
Prerequisites
Section titled “Prerequisites”- Enterprise enabled in the chart (
enterprise.enabled: true), for the ToolPolicy step. See Licensing. - The namespace your AgentRuntime runs in. The chart installs the ToolRegistry there, and it must already exist.
- A PromptPack whose prompt lists the browser tools in
tools. The model is offered only the tools the prompt lists. - A CNI that enforces NetworkPolicy. Without one, a sandbox has unrestricted egress.
Install the class and the registry
Section titled “Install the class and the registry”-
Set the chart values and upgrade the release:
sandbox:enabled: truetoolRegistry:namespace: agentsbrowserClass:enabled: trueruntimeClassName: gvisor # where your nodes run gVisor or KatatoolRegistry:enabled: trueTerminal window helm upgrade omnia oci://ghcr.io/altairalabs/charts/omnia -n omnia-system \--reuse-values -f browser.yamlThis installs the
browserClusterSandboxClass and thebrowser-sandboxToolRegistry inagents. The registry’s one sandbox,browser, names the class. Its one handler offers the tools insandbox.browserClass.toolRegistry.allowedTools, which default to every tool the browser serves. Narrow that list to offer the model fewer. See Browser Sandbox Class for every value.Leave
runtimeClassNameempty where no sandboxed runtime is installed: a RuntimeClass the cluster does not define fails the pod. -
Check that the registry resolved its sandbox:
Terminal window kubectl get toolregistry browser-sandbox -n agents \-o jsonpath='{.status.conditions[?(@.type=="SandboxesValid")].status}'The output is
True.
Bind the sites the agent may reach
Section titled “Bind the sites the agent may reach”-
Create a Connection for the sites, with
credential.kind: none. It adds itshoststo the sandbox’s egress and carries no credential.apiVersion: omnia.altairalabs.ai/v1alpha1kind: Connectionmetadata:name: example-docsnamespace: agentsspec:hosts: [docs.example.com, www.example.com]credential:kind: noneAdd every host the pages load from, such as a CDN for styles and scripts. A leading
*.matches any subdomain but not the apex. -
Reference the registry from the AgentRuntime and bind the Connection to the class’s
siterole:apiVersion: omnia.altairalabs.ai/v1alpha1kind: AgentRuntimemetadata:name: research-agentnamespace: agentsspec:toolRegistryRef:name: browser-sandboxsandbox:enabled: trueconnections:- sandbox: browserrole: siteconnection: example-docs# promptPackRef, providers and facades as for any agentTo browse signed in, bind a
browserSessionConnection tositeinstead, then sign in to the site. Until a session is stored, every browser tool answersconnection_not_enrolled.
Limit each navigation
Section titled “Limit each navigation”agent_browser_open, agent_browser_read and agent_browser_tab_new take a
url. A ToolPolicy can derive the host from it and permit only the hosts you
list. With Enterprise, the policy broker denies every call no ToolPolicy
permits, so this policy also grants the registry’s other tools.
-
Apply a ToolPolicy that selects the whole registry:
apiVersion: omnia.altairalabs.ai/v1alpha1kind: ToolPolicymetadata:name: browser-hostsnamespace: agentsspec:selector:registry: browser-sandboxproducers:- name: hasURLtype: celcel: 'has(body.url)'- name: hosttype: celcel: >-has(body.url) && body.url.split("/").size() > 2? body.url.split("/")[2].split(":")[0].lowerAscii(): ""policy: |@id("browse-listed-hosts")permit (principal, action == Action::"invoke",resource in Registry::"browser-sandbox")when {!context.hasURL ||["docs.example.com", "www.example.com"].contains(context.host)};mode: enforceonFailure: denyThe
hostproducer takes the text between//and the next/, without the port. A URL whose authority holds anything else, such as a user name or a query, yields a host that is not in the list, so the call is denied.about:blankhas no host and is denied too. -
Keep the list equal to the Connection’s
hosts, or narrower. The policy judges only the URL the model asks for. A redirect or a clicked link carries nourlargument, and the Connection’shostsbound those.
See Configure tool policies to try
the policy in mode: audit first.
Verify
Section titled “Verify”-
Check the AgentRuntime’s binding:
Terminal window kubectl get agentruntime research-agent -n agents \-o jsonpath='{.status.conditions[?(@.type=="SandboxConnectionsValid")].status}'The output is
True. -
Start a conversation and ask the agent to open a page on a listed host. The first browser tool call claims the sandbox:
Terminal window kubectl get sandboxclaims -n agentskubectl get deployments -n agents | grep egressThe claim reaches phase
Bound, and a<claim>-egressDeployment serves its egress proxy. -
Ask the agent to open a page on a host that is not listed. The policy broker denies the call before it reaches the sandbox.
Troubleshooting
Section titled “Troubleshooting”| What you see | Cause and fix |
|---|---|
SandboxConnectionsValid is False with ConnectionRoleUndeclared | The binding names a role the class does not declare. The chart’s browser class declares site |
SandboxConnectionsValid is False with ConnectionSandboxUnknown | sandbox in the binding is not browser, the registry’s sandbox name |
Every browser tool call is denied with no ToolPolicy permits this call | No ToolPolicy selects browser-sandbox in the agent’s namespace |
| A page loads without its styles, or fails to load | The page loads from a host the Connection does not name, and the egress proxy refuses it. Add the host to hosts |
The claim never reaches Bound | Check the sandbox Deployment’s events. A runtimeClassName the cluster does not define stops its pod being created. Set it empty, or install the runtime |
Related pages
Section titled “Related pages”- Sandbox security: the pod baseline, per-call policy and credential handling
- Connection: hosts, credential kinds and the binding checks
- ToolPolicy: producers and Cedar policies
- Sign in to a site for an agent