Your agent's browser can now open private sites: preview.internal keeps a sandbox dev server off the public internet
Synopsis
Cloudflare added internal hostnames to the persistent browser in its Agents SDK: give the browser a name such as preview.internal and requests to it go to the agent itself rather than the internet. The agent can then check a dev server in its sandbox, a folder in its workspace, or another Worker in the same browser it uses for the web, with nothing exposed publicly. Each internal host has a fetch function running in the Durable Object, so it can use that object's bindings and state, and a host can carry a target schema so the model chooses which port or folder it serves.
Interpretation
Agents that build websites can now check their own hosted sites in a real browser without exposing the dev server to the public internet. Previously the agent's browser reached only public addresses, so a dev server running in a container had no path open only to the agent. Internal hostnames route requests for names such as preview.internal to the agent itself, and the example has the agent open the dev server in its sandbox that way.
Internal hostnames are a capability of the browser rather than of a particular agent harness, so the browser configuration survives a change of framework. Integration takes one of two forms: the built-in adapters for Pi Durable, AI SDK and TanStack AI, or a tool implemented with browser.session(). The example registers the tool with a Pi Durable agent through browserTool from agents/browser/pi and requires Agents SDK v0.31.0 or later.
The model can decide for itself which port or folder an internal host points at, and that choice persists. A host can carry a target schema, and the model calls browser.assignHost() with a target matching it, such as { port: 5173 }. The target is checked against the schema and stored, lasting across turns, browser restarts and redeploys, after which each request to http://preview.internal/ calls the host's fetch function with that target.
Perspective
It applies to setups using Cloudflare Agents SDK v0.31.0 or later that configure internal hostnames for an agent's persistent browser; the example given adds a private dev-server preview to a Pi Durable agent.
The material points to the Internal hostnames documentation for the complete example, limits and security guidance without expanding them here; browserTool now runs the model's code in its own Dynamic Worker and no longer needs a CodemodeRuntime export, so existing users should consult the v0.31.0 upgrade notes.
