LLM frameworks · Pydantic
Pydantic AI
Python framework for building AI agents, from the Pydantic team.
5Advisories
0critical
2high
3medium
2026-11-25Latest
Pydantic AI CVEs & security
Is Pydantic AI safe?
Pydantic AI is the Pydantic team's Python framework for building AI agents.
We track 5 security advisories that affect Pydantic AI. By severity: 2 high and 3 medium. All of them have a CVE ID. The most common kind is SSRF & network (3). The newest entry is dated 2026-11-25.
Newest entries on this page
- CVE-2026-136641: Pydantic AI Harness PlaywrightBrowser's egress policy didn't cover WebRTC, WebTransport, WebSocketStream or FedCM, so a page the agent opened could reach blocked hosts (fixed 0.74.0) medium 2026-11-25
- CVE-2026-136638: Pydantic AI Harness's PlaywrightBrowser egress policy treated URLs with a backslash as host-less, so page scripts could reach private and blocked hosts (fixed 0.74.0) medium 2026-11-25
- CVE-2026-133505: In Pydantic AI, third-party data in a tool result shaped like a file object was rebuilt as a real file when message history was reloaded, triggering local-network downloads or s3:// reads with the app's credentials (fixed 1.107.10 / 2.66.0) medium 2026-11-20
Using Pydantic AI safely
- Treat model output and tool arguments as untrusted input, and validate them before acting.
- Give agents only the tools they need, and don't let tools run shell commands or arbitrary code without a sandbox.
- If your agent reads web pages, emails or documents, assume they can contain prompt injection.
- Keep the package and its model-provider SDKs updated, and pin versions in production.
Timeline · advisories per quarter
52026 Q4
Named in sources
Reported for Pydantic AI
01. CVE-2026-133161: Pydantic AI Harness's ToolOutputLimits(strip_ansi=True) can be stalled for minutes by crafted tool output, blocking every agent run in the process (fixed 0.70.0)With strip_ansi=True, the ToolOutputLimits capability in pydantic-ai-harness strips ANSI escape sequences from tool output with a pattern that takes time quadratic in the line length. A tool result of a few hundred kilobytes with many unterminated escape sequences can hold the event loop for tens of seconds to minutes, delaying every other request and agent run in the process. The attacker only needs to put text into something a tool returns: shell output, a file, a fetched page or an MCP server response. Affects 0.4.0 to 0.69.0; fixed in 0.70.0.
Pydantic AI
MCP SDKs & servers 2026-11-19 02. CVE-2026-107295: any website can make the Pydantic AI web chat UI (Agent.to_web, clai web) run your agent and its tools, upgrade to 1.107.4 or 2.28.0Pydantic AI's development web chat UI (Agent.to_web() and clai web) didn't check the content type of requests to its chat endpoint. A website open in the developer's browser could send a request to the local UI and make the agent run its tools with the local process's privileges, even when bound to localhost. Tools marked requires_approval=True weren't protected either.
Pydantic AI 2026-10-08 03. CVE-2026-136641: Pydantic AI Harness PlaywrightBrowser's egress policy didn't cover WebRTC, WebTransport, WebSocketStream or FedCM, so a page the agent opened could reach blocked hosts (fixed 0.74.0)pydantic-ai-harness's PlaywrightBrowser enforces an egress policy (allowed_domains / blocked_domains) on HTTP requests and page WebSockets, but in 0.24.0 through 0.73.0 not on WebRTC (STUN/TURN), WebTransport, WebSockets opened with WebSocketStream, or the browser's own FedCM requests. Script on a page the agent opens could send that traffic to hosts and ports the policy refuses, including private addresses, read WebSocketStream responses, and use FedCM to send data, with the identity provider's cookies, to a host outside the allowlist. Fixed in 0.74.0, with some paths still uncovered.
Pydantic AI 2026-11-25 04. CVE-2026-136638: Pydantic AI Harness's PlaywrightBrowser egress policy treated URLs with a backslash as host-less, so page scripts could reach private and blocked hosts (fixed 0.74.0)Pydantic AI Harness's PlaywrightBrowser gives agents a browser with an egress policy (allowed_domains, blocked_domains, private-address blocking). It treated any URL containing a backslash as having no host and allowed host-less script and asset requests, so a script on a page the agent opened could add a backslash to a URL's query and send requests to private addresses, to hosts outside allowed_domains and to blocked hosts. Fixed in pydantic-ai-harness 0.74.0.
Pydantic AI 2026-11-25 05. CVE-2026-133505: In Pydantic AI, third-party data in a tool result shaped like a file object was rebuilt as a real file when message history was reloaded, triggering local-network downloads or s3:// reads with the app's credentials (fixed 1.107.10 / 2.66.0)When Pydantic AI loads serialized message history, it rebuilds file items (ImageUrl, DocumentUrl, AudioUrl, VideoUrl, UploadedFile) nested in tool results. A plain mapping a tool returned that serialized to the same JSON shape was rebuilt as a file too. A third party who controls data that reaches a tool result, such as a record an MCP server or function tool fetches from an external system, could make the application download a URL on its local network (DocumentUrl/ImageUrl with force_download='allow-local' turns off the private-network block; cloud metadata stays blocked), or make the model provider read an s3://, gs:// or uploaded file with the application's credentials. No prompt injection needed: the next model request does it. Fixed in pydantic-ai / pydantic-ai-slim 1.107.10 and 2.66.0.
Pydantic AI
MCP SDKs & servers 2026-11-20