The upgrade reaches the instance’s
webSocket(ws, req) entry. The GET and the POST reach its fetch(req) entry.
The AgentClient wraps the socket, and any HTTP or WebSocket client can speak the wire. The mount routes and adds no policy of its own. Two gates decide who may call. The mount’s authorize runs at the edge, and the agent’s authorize runs inside the instance. Mounting Agents is the reference, and its authorization section covers both gates.