network.routes sends a connection to one host:port to another, as a
container’s port mapping does. The agent keeps the address its task names,
and each workspace reaches its own copy of the service:
localhost:5003 to
127.0.0.1:61002 and allow only that, so neither reaches the other’s.
How a route applies
- Every connection in the workspace follows it:
curl, CLIs, mounts, and Python or JavaScript code. HTTPS, WebSocket and database connections too. Over HTTPS, the service’s certificate must still match the address the agent typed. allowed_domains,denied_domainsandpre_networkpolicies check where the route goes, not the address the agent typed.localand Sandlock runtimes don’t run in a workspace with routes, and sandbox runtimes (Docker, SSH) aren’t routed.- In a browser, a route for an
httpsorwssaddress can change only the port.
Per session
A profile can setroutes for its sessions. They replace
the workspace’s routes for the same address, and the workspace’s allowed
and denied lists still apply: