← All tools
LLM frameworks · Pydantic

Pydantic AI

Python framework for building AI agents, from the Pydantic team.

5Advisories
0critical
2high
3medium
2026-11-25Latest
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. highDenial of serviceCVE-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. highAgent hijackingCVE-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. mediumSSRF & networkCVE-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. mediumSSRF & networkCVE-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. mediumSSRF & networkCVE-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
The weekly email

One email a week. Only what changed.

Every new security hole in AI coding tools, MCP servers, app builders and the stacks they generate (Next.js, Supabase, Node, PHP), each with how to check your app and the fix. No roundups of things you already read.

Free, one email a week. Read the latest issue first if you like. One-click unsubscribe in every email. We never sell or share addresses.