Pydantic AI's Browser Egress Policy Missed Four Network APIs
Pydantic AI Harness uses PlaywrightBrowser to open pages for an agent. Its egress policy inspected ordinary HTTP requests and page WebSockets. CVE-2026-136641 describes a gap in that policy: WebRTC, WebTransport, WebSocketStream, and FedCM traffic could still reach destinations outside the configured allowlist.
The affected package versions are 0.24.0 through 0.73.0, fixed in 0.74.0. The advisory assumes a website controlled by a third party can run script in a browser the agent opens. The page chooses a destination, and the browser sends a connection setup that the policy does not inspect.
The policy covered a protocol list, not the network
An egress allowlist works only when every outbound mechanism passes through the same control. A page can create an ordinary HTTPS request, a WebSocket, a WebRTC candidate exchange, a WebTransport session, or a browser identity request. Each has different browser APIs and enforcement points.
The advisory says WebRTC could let a page learn whether a STUN target answers. WebTransport and FedCM had browser-level protections for some private-network paths, but WebSocketStream could read what a server sent, including from a private address. FedCM requests could carry the browser profile's provider cookies to a chosen configuration URL.
The impact is not that the page read an arbitrary internal HTTP response body. It is that the browser made requests outside the declared policy and exposed a signal, a WebSocket channel, or a credentialed fetch path. That is enough to turn an AI browsing tool into an internal reachability oracle if the agent opens hostile pages.
Network isolation belongs outside the browser SDK
Upgrade to pydantic-ai-harness 0.74.0. The patch removes the affected APIs under an enforced egress policy and disables related Chromium features. The advisory also lists residual paths involving workers, remote CDP, sandboxed iframes, and documents loaded before attachment.
Use a network egress filter that includes TCP and UDP. Do not rely only on browser-level domain checks. Run untrusted browsing in a dedicated network namespace with a proxy that can enforce destination policy and log denied connections. Disable browser access to link-local addresses and management networks, including DNS names that resolve there.
If the agent must open an attacker-influenced page, consider a two-stage workflow. Fetch the content through a hardened parser first, or render it in a browser with no access to sensitive networks. Treat the browser as a hostile-code runtime even when the automation framework supplies a policy.
Test the policy, not one URL
Build a test page that attempts each protocol against a controlled destination. Assert that every attempt is blocked or denied by the network layer. Test WebSockets created by page scripts, dedicated workers, and service workers. Test FedCM calls with a non-allowlisted provider. Repeat the test after browser upgrades because API availability changes.
Log denied egress at the network boundary. A browser policy miss may produce a silent failure inside the agent, while the proxy log shows the destination and protocol. Preserve those records during incident review and correlate them with the pages the agent opened.
The patch closes the known API gaps. The durable control is a network boundary that does not depend on the browser SDK enumerating every protocol.
