pypi pydantic-ai 2.74.0
v2.74.0 (2026-11-24)

one hour ago

What's Changed

🛡️ Security

  • GHSA-wm3r-gc4c-q7qg (medium, CVE-2026-136639): Pydantic AI Harness's PlaywrightBrowser private-address block did not refuse IPv6 site-local addresses (fec0::/10), so on a network that still routes that range, a page or URL an attacker influences could make the browser open an internal address and return its content to the model. You are affected if you use PlaywrightBrowser with block_private_addresses=True, the default, to open pages an attacker can influence. Fixed in pydantic-ai-harness 0.74.0.
  • GHSA-p2q8-3252-77c3 (medium, CVE-2026-136640): PlaywrightBrowser's private-address block let through IPv6 addresses that embed a cloud metadata address under a network's own NAT64 prefix, and ISATAP forms of private addresses, so on such networks the browser could reach the metadata service. You are affected if you use PlaywrightBrowser with its default address block on an IPv6 network with a NAT64 or SIIT translator that uses its own prefix. The block now refuses every IP address that Pydantic AI's URL download guard refuses. Fixed in pydantic-ai-harness 0.74.0.
  • GHSA-g87v-g79r-whvj (medium, CVE-2026-136638): PlaywrightBrowser treated a URL with a backslash in its query as having no host and allowed script and asset requests with no host, so a page script could send requests to private addresses, to hosts outside allowed_domains and to hosts in blocked_domains. You are affected if you use PlaywrightBrowser to open pages an attacker can influence. Fixed in pydantic-ai-harness 0.74.0.
  • GHSA-mj96-6529-3cpf (medium): PlaywrightBrowser's egress policy did not cover WebRTC, WebTransport, WebSocketStream or FedCM traffic, so a page could reach hosts and ports the policy refuses, and read replies over WebSocketStream, including from private addresses. You are affected if you use PlaywrightBrowser to open pages an attacker can influence. Under an enforced policy, which is the default, the patched version removes those APIs from pages and frames and launches Chromium with FedCM and WebSocketStream off; workers' WebTransport, WebSocketStream in workers over cdp_url, isolated sandboxed iframes and documents loaded before attachment stay open, as the advisory lists. Fixed in pydantic-ai-harness 0.74.0.
  • GHSA-gm2p-369w-rcgv (medium, CVE-2026-136642): With OpenTelemetry instrumentation enabled, realtime sessions on ElevenLabs Agents recorded elevenlabs_agents_custom_llm_extra_body and elevenlabs_agents_dynamic_variables in full in their trace spans, including secret__ dynamic variables, which ElevenLabs intends for auth tokens and API keys. You are affected if you instrument realtime sessions with ElevenLabsAgentsRealtimeModel and pass credentials through either setting; on 2.58.0 to 2.62.0, include_content=False does not remove them. Fixed in pydantic-ai and pydantic-ai-slim 2.74.0.
  • GHSA-7xcv-6766-v6v5 (medium, CVE-2026-136643): Online evaluation let OpenTelemetry baggage in the current context set attributes on its gen_ai.evaluation.result events that the evaluation left unset, such as error.type and gen_ai.evaluation.score.value, so a client sending a baggage header could have a passing evaluation recorded with an error type, or a failed one recorded with a score. You are affected if you run online evaluation in an application whose OpenTelemetry setup extracts inbound baggage, as the default propagators do. Fixed in pydantic-evals 2.74.0 and 1.107.11.

⚠️ Compatibility Notes

  • Add the computer tool contract to core: pydantic_ai.computer_use and ComputerTool by @adtyavrdhn in #11006
    • Adds ComputerTool to NATIVE_TOOLS_REQUIRING_CONFIG: it needs a computer tool to run its calls.
  • [cache] Send static instructions as leading input messages on GPT-6.2, which never caches top-level instructions by @dsfaccini in #14095
    • Continuing a GPT-6.2 response through an explicit openai_previous_response_id='resp_…' without its message_history now inherits that response's static instructions. Pass the message_history, or profile=OpenAIModelProfile(openai_responses_stable_instructions_as_input=False).
  • Stop summing Gemini's running usage totals when streaming through OpenAIChatModel by @dsfaccini in #14285
    • Streaming a gemini* model through OpenAIProvider now reports the endpoint's final usage totals instead of their sum, so cost figures drop and UsageLimits token limits trip later.
  • Under an enforced egress policy (the default), PlaywrightBrowser pages no longer have RTCPeerConnection, WebTransport, WebSocketStream or FedCM, and browsers it launches start with those Blink features off. If your agent needs one of them, open an issue: a parameter that keeps them can be added. (by @dsfaccini in #14363)

🚀 Features

  • Warn with DeprecatedModelWarning on requests to claude-opus-4-5 by @dsfaccini in #14290
  • Add the computer tool contract to core: pydantic_ai.computer_use and ComputerTool by @adtyavrdhn in #11006
  • Harness: add the ComputerUse() capability and the Display protocols it drives by @adtyavrdhn in #11037
  • Add DockerContainer(desktop=True) for computer use by @adtyavrdhn in #11040
  • OpenAI: send the computer tool as OpenAI's native computer tool on GPT-5.4 and later by @adtyavrdhn in #11038
  • Add DaytonaSandbox(desktop=True) for computer use by @adtyavrdhn in #11210
  • Add E2BSandbox(desktop=True) for computer use by @adtyavrdhn in #11211
  • Add desktop to SpritesSandbox for ComputerUse by @adtyavrdhn in #12965
  • Add desktop to BoxLiteSandbox for ComputerUse by @adtyavrdhn in #12966
  • Add desktop to BoxdSandbox for ComputerUse, driven by boxd's computer API by @adtyavrdhn in #12968
  • Add desktop to SmolSandbox for ComputerUse by @adtyavrdhn in #12967
  • Add desktop to RenderSandbox for ComputerUse by @adtyavrdhn in #13986
  • Add desktop to ModalSandbox for ComputerUse by @adtyavrdhn in #12964
  • Add desktop to KubernetesSandbox for ComputerUse by @adtyavrdhn in #13988
  • Anthropic: send the computer tool as each Claude model's computer use tool by @adtyavrdhn in #11039
  • Add desktop to OpenSandbox for ComputerUse by @adtyavrdhn in #13987
  • Google: send the computer tool as Google's computer use tool on Gemini by @adtyavrdhn in #14307
  • [cache] Send static instructions as leading input messages on GPT-6.2, which never caches top-level instructions by @dsfaccini in #14095
  • Send a tool's text output to Qwen3 Next as a JSON string field with needs_json_string_tool_returns by @DouweM in #12366
  • Add a CDPBrowser Harness capability that drives Chrome with raw DevTools Protocol commands by @samuelcolvin in #14229

🐛 Bug Fixes

  • Keep a custom identifier on BinaryContent and FileUrl across VercelAIAdapter round trips by @dsfaccini in #14281
  • Stop summing Gemini's running usage totals when streaming through OpenAIChatModel by @dsfaccini in #14285
  • Classify OpenRouter context-window overflow nested in metadata.raw as ModelContextWindowExceededError by @pydanty in #14231
  • Keep the stored id on the user message in AGUIAdapter.dump_messages when an activity message follows it by @rscholz98 in #13161
  • Return a failed reason from ArgumentCorrectness when non-object tool arguments nest too deeply to print by @dsfaccini in #14422

Full Changelog: v2.73.0...v2.74.0

Don't miss a new pydantic-ai release

NewReleases is sending notifications on new releases.