NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI, #636 most downloaded on PyPI
Graph and state machine library
Latest stable
2.69.0
Last release 5 days ago
17 Nov 2026
Ships on a steady schedule
a new release about every 1 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
1 version withdrawn
withdrawn after publishing
2 years old
340 releases · first in 2025
Drag across the ruler to compare, or tap a release to open it.
Reject invalid DeferredToolResults.approvals values by @adtyavrdhn in #8081
DeferredToolResults.approvals values by @adtyavrdhn in #8081GitHubCopilotProvider for GitHub Copilot's OpenAI-compatible API by @dsfaccini in #8059anthropic_disallows_sampling_settings in BedrockConverseModel by @rscholz98 in #7961$ref definitions inline in code-mode function signatures by @pydanty in #8056ToolReturnContent without a Python call per JSON node by @dsfaccini in #7823Full Changelog: v2.41.0...v2.42.0
Your coding agent can read these notes before it upgrades. Set up the MCP server →
<!-- Release notes generated using configuration in .github/release.yml at main -->
DeferredToolResults.approvals values by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/8081GitHubCopilotProvider for GitHub Copilot's OpenAI-compatible API by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/8059anthropic_disallows_sampling_settings in BedrockConverseModel by @rscholz98 in https://github.com/pydantic/pydantic-ai/pull/7961$ref definitions inline in code-mode function signatures by @pydanty in https://github.com/pydantic/pydantic-ai/pull/8056ToolReturnContent without a Python call per JSON node by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7823Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.41.0...v2.42.0
Deprecate fallback_model in favor of fallback_subagent_model on ImageGeneration and XSearch by @dsfaccini in #8077
fallback_model in favor of fallback_subagent_model on ImageGeneration and XSearch by @dsfaccini in #8077openai-codex provider for ChatGPT/Codex subscription authentication by @mpfaffenberger in #7769ImageGenerator by @EgonFerri in #5357RequestUsage.details and price them in cost by @adtyavrdhn in #8169ModelAPIError in BedrockConverseModel by @kimnamu in #8131Full Changelog: v2.40.0...v2.41.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
fallback_model in favor of fallback_subagent_model on ImageGeneration and XSearch by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/8077openai-codex provider for ChatGPT/Codex subscription authentication by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/7769ImageGenerator by @EgonFerri in https://github.com/pydantic/pydantic-ai/pull/5357RequestUsage.details and price them in cost by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/8169ModelAPIError in BedrockConverseModel by @kimnamu in https://github.com/pydantic/pydantic-ai/pull/8131Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.40.0...v2.41.0
Add pydantic_ai.prices.update_in_background() by @adtyavrdhn in #4841
pydantic_ai.prices.update_in_background() by @adtyavrdhn in #4841handle_barge_in=True, interrupt(played_bytes=...), and played_audio_bytes by @DouweM in #7870provider_factory to infer_realtime_model by @DouweM in #8106@agent.on_event for registering event listeners on an Agent by @DouweM in #8101respond= to RealtimeSession.send() and document that a text turn solicits a reply by @DouweM in #8110RealtimeSession.enqueue() for out-of-band prompts from code driving the session by @DouweM in #8109finish_reason on OpenAI Responses stream terminal events by @pydanty in #7916defer_loading reveal synthesis splitting a parallel batch's tool_result from its tool_use by @pydanty in #7879reasoning to the dated gpt-realtime-2025-08-28 snapshot by @DouweM in #8103stream_audio() and stream_transcripts() views when they are called, not on first iteration by @DouweM in #8107ctx.realtime_session.close() instead of wedging itself by @DouweM in #8105interrupt(played_ms=) cancel race, and two provider tables by @DouweM in #8132Full Changelog: v2.39.0...v2.40.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
pydantic_ai.prices.update_in_background() by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/4841handle_barge_in=True, interrupt(played_bytes=...), and played_audio_bytes by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7870provider_factory to infer_realtime_model by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8106@agent.on_event for registering event listeners on an Agent by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8101respond= to RealtimeSession.send() and document that a text turn solicits a reply by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8110RealtimeSession.enqueue() for out-of-band prompts from code driving the session by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8109finish_reason on OpenAI Responses stream terminal events by @pydanty in https://github.com/pydantic/pydantic-ai/pull/7916defer_loading reveal synthesis splitting a parallel batch's tool_result from its tool_use by @pydanty in https://github.com/pydantic/pydantic-ai/pull/7879reasoning to the dated gpt-realtime-2025-08-28 snapshot by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8103stream_audio() and stream_transcripts() views when they are called, not on first iteration by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8107ctx.realtime_session.close() instead of wedging itself by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8105interrupt(played_ms=) cancel race, and two provider tables by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8132Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.39.0...v2.40.0
Add OpenAI gpt-6-astra model support by @dsfaccini in #8055
gpt-6-astra model support by @dsfaccini in #8055context_subtree() exporter cache and its span-processor leaks by @dsfaccini in #7667Instrumentation spec option include_model_request_parameters and sharpen the undeclared-attribute merge error by @DouweM in #8046AzureProvider and for AsyncAzureOpenAI clients on OpenAIProvider by @quinnarnold in #7922stream_transcripts() by @DouweM in #8062Full Changelog: v2.38.0...v2.39.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
gpt-6-astra model support by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/8055context_subtree() exporter cache and its span-processor leaks by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7667Instrumentation spec option include_model_request_parameters and sharpen the undeclared-attribute merge error by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8046AzureProvider and for AsyncAzureOpenAI clients on OpenAIProvider by @quinnarnold in https://github.com/pydantic/pydantic-ai/pull/7922stream_transcripts() by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8062Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.38.0...v2.39.0
Give one-off capabilities a default id and a combine rule for repeats by @dsfaccini in #7248
id and a combine rule for repeats by @dsfaccini in #7248context_window to ModelProfile and context_window_used to RunContext by @adtyavrdhn in #4611finish_reason by @jonashaag in #7096gemini-3.8-flash model by @dsfaccini in #8021CustomEvents and CapabilityEvents into the run event stream and subscribe with @on_event by @DouweM in #6258claude-fable-5-1) and Claude Mythos 5.1 (claude-mythos-5-1) support by @dsfaccini in #7989VLLMProvider for vLLM servers by @adtyavrdhn in #6153CancellationToken in UI adapter run methods by @dsfaccini in #7743pytest tests/durable_exec/temporal from crashing when the suite's requirements are missing by @dsfaccini in #7898tool_choice handling and support NativeOutput on DeepSeek's Responses API by @dsfaccini in #7450CodeExecutionTool uploads never reaching a fresh Anthropic container on a multi-turn history by @dsfaccini in #7864REASONING_* events from ag-ui-protocol 0.1.11 instead of 0.1.13 by @dsfaccini in #7226GoogleProvider's overload by @dsfaccini in #8030XaiModel streamed text after a native tool call being merged into the ended pre-call part by @pydanty[bot] in #7925native factory config in XSearch and ImageGeneration fallback subagents by @CoralGarden52 in #7541genai-prices to 0.1.6 by @adtyavrdhn in #8019Full Changelog: v2.37.0...v2.38.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
id and a combine rule for repeats by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7248context_window to ModelProfile and context_window_used to RunContext by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/4611finish_reason by @jonashaag in https://github.com/pydantic/pydantic-ai/pull/7096gemini-3.8-flash model by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/8021CustomEvents and CapabilityEvents into the run event stream and subscribe with @on_event by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6258claude-fable-5-1) and Claude Mythos 5.1 (claude-mythos-5-1) support by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7989VLLMProvider for vLLM servers by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/6153CancellationToken in UI adapter run methods by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7743pytest tests/durable_exec/temporal from crashing when the suite's requirements are missing by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7898tool_choice handling and support NativeOutput on DeepSeek's Responses API by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7450CodeExecutionTool uploads never reaching a fresh Anthropic container on a multi-turn history by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7864REASONING_* events from ag-ui-protocol 0.1.11 instead of 0.1.13 by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7226GoogleProvider's overload by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/8030XaiModel streamed text after a native tool call being merged into the ended pre-call part by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/7925native factory config in XSearch and ImageGeneration fallback subagents by @CoralGarden52 in https://github.com/pydantic/pydantic-ai/pull/7541genai-prices to 0.1.6 by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/8019Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.37.0...v2.38.0
Add glm-5.3-flash and rework the Z.AI test suite onto cassettes by @dsfaccini in #7887
glm-5.3-flash and rework the Z.AI test suite onto cassettes by @dsfaccini in #7887finish_reason values by @zhj12395 in #7685TEXT_MESSAGE_START for the assistant message that owns a response's tool calls by @dsfaccini in #7699GoogleModel by client transport instead of provider name by @thejamesgore in #7280capabilities= on DBOS, matching Temporal by @DouweM in #6955Full Changelog: v2.36.0...v2.37.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
glm-5.3-flash and rework the Z.AI test suite onto cassettes by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7887finish_reason values by @zhj12395 in https://github.com/pydantic/pydantic-ai/pull/7685TEXT_MESSAGE_START for the assistant message that owns a response's tool calls by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7699GoogleModel by client transport instead of provider name by @thejamesgore in https://github.com/pydantic/pydantic-ai/pull/7280capabilities= on DBOS, matching Temporal by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6955Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.36.0...v2.37.0
Add --mcp-config support and tool-call streaming to clai by @Kludex in #1374
@durable_operation for capabilities and a public backend API for third-party durable execution engines by @DouweM in #6696InstructionPart.id by @DouweM in #6887RealtimeSession.send_audio() and move the voice example to listentome by @DouweM in #7860@durable_operation by @DouweM in #7868TestModel generation for narrow exclusive numeric bounds by @Terminator666666 in #7800ToolDefinition into Prefect cache keys by @DouweM in #7872Full Changelog: v2.35.3...v2.36.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
--mcp-config support and tool-call streaming to clai by @Kludex in https://github.com/pydantic/pydantic-ai/pull/1374@durable_operation for capabilities and a public backend API for third-party durable execution engines by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6696InstructionPart.id by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6887RealtimeSession.send_audio() and move the voice example to listentome by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7860@durable_operation by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7868TestModel generation for narrow exclusive numeric bounds by @Terminator666666 in https://github.com/pydantic/pydantic-ai/pull/7800ToolDefinition into Prefect cache keys by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7872Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.35.3...v2.36.0
Route Heroku GLM models through zai_model_profile by @LHMQ878 in #6837
zai_model_profile by @LHMQ878 in #6837safe_download cookies to original hostnames by @Diwak4r in #7077DeferredToolRequests.remaining resolving cross-category result IDs by @pydanty in #7626dbos extra; add opentelemetry-instrumentation-logging as a test dependency instead by @dsfaccini in #7820Full Changelog: v2.35.1...v2.35.3
<!-- Release notes generated using configuration in .github/release.yml at main -->
zai_model_profile by @LHMQ878 in https://github.com/pydantic/pydantic-ai/pull/6837safe_download cookies to original hostnames by @Diwak4r in https://github.com/pydantic/pydantic-ai/pull/7077DeferredToolRequests.remaining resolving cross-category result IDs by @pydanty in https://github.com/pydantic/pydantic-ai/pull/7626dbos extra; add opentelemetry-instrumentation-logging as a test dependency instead by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7820Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.35.1...v2.35.3
Carry Bedrock guardrail trace in ModelResponse.provider_details by @pydanty in #7562
trace in ModelResponse.provider_details by @pydanty in #7562provider_factory when cancelling Temporal responses by @DouweM in #7000dbos below 2.31.0 to avoid a missing opentelemetry-instrumentation-logging import by @dsfaccini in #7804Full Changelog: v2.35.0...v2.35.1
<!-- Release notes generated using configuration in .github/release.yml at main -->
trace in ModelResponse.provider_details by @pydanty in https://github.com/pydantic/pydantic-ai/pull/7562provider_factory when cancelling Temporal responses by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7000dbos below 2.31.0 to avoid a missing opentelemetry-instrumentation-logging import by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7804Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.35.0...v2.35.1
Deprecate RunContext.capability_loaded and available_capability_ids in favor of capability_active and active_capability_ids by @DouweM in #7454
RunContext.capability_loaded and available_capability_ids in favor of capability_active and active_capability_ids by @DouweM in #7454maximum reachable in TestModel by @pydanty in #7697Tool description instead of falling back to the function docstring by @mpfaffenberger in #7759Full Changelog: v2.34.0...v2.35.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
RunContext.capability_loaded and available_capability_ids in favor of capability_active and active_capability_ids by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7454maximum reachable in TestModel by @pydanty in https://github.com/pydantic/pydantic-ai/pull/7697Tool description instead of falling back to the function docstring by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/7759Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.34.0...v2.35.0
Add a LangChain migration skill by @adtyavrdhn in #7679
ZaiModel by @aisk in #7600TestModel generation for equal inclusive bounds by @pydanty in #7642Literal in FunctionSignature by @pydanty in #7579TestModel generation of falsy JSON Schema const values by @pydanty in #7630UIEventStream part state on cancellation by @adtyavrdhn in #7675logit_bias from Cerebras model settings by @ryanl-cerebras in #7653VercelAIAdapter rejecting reasoning part id in run input by @pydanty in #7706CohereModel by @pydanty in #7720VercelProvider dropping the Groq profile for groq/-prefixed models by @pydanty in #7551SpanQuery maximums by @lntutor in #6934Retry-After dates in wait_retry_after() by @parveshsaini in #7711load_capability by @lntutor in #6937r1 alias in deepseek_model_profile() by @adtyavrdhn in #7723Full Changelog: v2.33.0...v2.34.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
ZaiModel by @aisk in https://github.com/pydantic/pydantic-ai/pull/7600TestModel generation for equal inclusive bounds by @pydanty in https://github.com/pydantic/pydantic-ai/pull/7642Literal in FunctionSignature by @pydanty in https://github.com/pydantic/pydantic-ai/pull/7579TestModel generation of falsy JSON Schema const values by @pydanty in https://github.com/pydantic/pydantic-ai/pull/7630UIEventStream part state on cancellation by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/7675logit_bias from Cerebras model settings by @ryanl-cerebras in https://github.com/pydantic/pydantic-ai/pull/7653VercelAIAdapter rejecting reasoning part id in run input by @pydanty in https://github.com/pydantic/pydantic-ai/pull/7706CohereModel by @pydanty in https://github.com/pydantic/pydantic-ai/pull/7720VercelProvider dropping the Groq profile for groq/-prefixed models by @pydanty in https://github.com/pydantic/pydantic-ai/pull/7551SpanQuery maximums by @lntutor in https://github.com/pydantic/pydantic-ai/pull/6934Retry-After dates in wait_retry_after() by @parveshsaini in https://github.com/pydantic/pydantic-ai/pull/7711load_capability by @lntutor in https://github.com/pydantic/pydantic-ai/pull/6937r1 alias in deepseek_model_profile() by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/7723Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.33.0...v2.34.0
⚠️ If Anthropic stopped working for you in the last day
anthropic 1.0.0 — rebuilt on httpx2, with legacy httpx support removed — reached PyPI on August 20. Every earlier pydantic-ai release, including v2.32.2 cut a few hours before this one, allowed that version without supporting it: a fresh or unpinned install of pydantic-ai[anthropic] could resolve anthropic 1.0.0 and then fail at runtime when using an Anthropic model. Apologies for the breakage window.
pydantic-ai v2.33.0, which requires and supports anthropic>=1.0.0.anthropic<1.If you pass your own http_client to AnthropicProvider, it must now be an httpx2.AsyncClient — the 1.x SDK rejects legacy httpx clients at construction.
httpx2 for Anthropic clients by @dsfaccini in #7657Full Changelog: v2.32.2...v2.33.0
Fail the workflow on UnexpectedModelBehavior and FallbackExceptionGroup under the deprecated TemporalAgent by @aviseth in #7465
pydantic_evals tasks and the evaluate decorator by @pydanty[bot] in #7535RunContext.cancel() in realtime sessions by @adtyavrdhn in #7528m.youtube.com URLs in VideoUrl by @uczltw6 in #7592UnexpectedModelBehavior and FallbackExceptionGroup under the deprecated TemporalAgent by @aviseth in #7465Full Changelog: v2.32.1...v2.32.2
<!-- Release notes generated using configuration in .github/release.yml at main -->
pydantic_evals tasks and the evaluate decorator by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/7535RunContext.cancel() in realtime sessions by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/7528m.youtube.com URLs in VideoUrl by @uczltw6 in https://github.com/pydantic/pydantic-ai/pull/7592UnexpectedModelBehavior and FallbackExceptionGroup under the deprecated TemporalAgent by @aviseth in https://github.com/pydantic/pydantic-ai/pull/7465Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.32.1...v2.32.2
Reject Agent.run_sync() from synchronous callbacks inside agent runs by @dsfaccini in #7277
Agent.run_sync() from synchronous callbacks inside agent runs by @dsfaccini in #7277thinking blocks with an empty signature by @mpfaffenberger in #7601FunctionModel function or stream_function by @dsfaccini in #7589Full Changelog: v2.32.0...v2.32.1
<!-- Release notes generated using configuration in .github/release.yml at main -->
Agent.run_sync() from synchronous callbacks inside agent runs by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7277thinking blocks with an empty signature by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/7601FunctionModel function or stream_function by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7589Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.32.0...v2.32.1
Suggest known model names for invalid identifiers by @dsfaccini in #7325
provider_details["annotations"] by @dsfaccini in #7458role: 'tool' by @dsfaccini in #7582timeout= for blocking sync tools and hooks by @adtyavrdhn in #7557RunContext.cancel() from setup-phase for_run hooks instead of raising UserError by @adtyavrdhn in #7567httpx2 for compatible HTTP clients by @dsfaccini in #7351Full Changelog: v2.31.1...v2.32.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
provider_details["annotations"] by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7458role: 'tool' by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7582timeout= for blocking sync tools and hooks by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/7557RunContext.cancel() from setup-phase for_run hooks instead of raising UserError by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/7567httpx2 for compatible HTTP clients by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7351Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.31.1...v2.32.0
Deny native structured output for Claude Sonnet 5 and Fable 5 on Bedrock by @pydanty[bot] in #7374
thinking_level='LOW' for Gemini models that reject MINIMAL by @pydanty[bot] in #7469Full Changelog: v2.31.0...v2.31.1
<!-- Release notes generated using configuration in .github/release.yml at main -->
thinking_level='LOW' for Gemini models that reject MINIMAL by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/7469Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.31.0...v2.31.1
Allow a UIEventStream to be built without a run_input , and give AGUIEventStream its own thread_id / run_id by @dsfaccini in #7292
UIEventStream to be built without a run_input, and give AGUIEventStream its own thread_id/run_id by @dsfaccini in #7292FallbackModel spans to the failing model, not the fallback: wrapper by @strawgate in #7018openai through Temporal workflow sandboxes by @adtyavrdhn in #7464Full Changelog: v2.30.0...v2.31.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
UIEventStream to be built without a run_input, and give AGUIEventStream its own thread_id/run_id by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7292FallbackModel spans to the failing model, not the fallback: wrapper by @strawgate in https://github.com/pydantic/pydantic-ai/pull/7018openai through Temporal workflow sandboxes by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/7464Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.30.0...v2.31.0
GHSA-q2xc-rrxj-58x9 : the local dev web chat UI ( Agent.to_web() , clai web ) didn't validate the Host header, so DNS rebinding from a website you vis
Agent.to_web(), clai web) didn't validate the Host header, so DNS rebinding from a website you visit could reach it and run the served agent with your local process's tools and credentials. Fixed in pydantic-ai/pydantic-ai-slim 2.30.0 by validating Host against localhost/loopback/LAN addresses by default; deployments reached under a real hostname must opt in with the new allowed_hosts setting.openrouter:web_search for web search by @dsfaccini in #7378gemini-3.7-flash model by @dsfaccini in #7445metadata on XaiProvider by @pydanty[bot] in #7423allowed_hosts to Agent.to_web() and clai web by @DouweM in #7437openai resource imports and genai-prices data loading at Model construction time by @adtyavrdhn in #7408EvaluationReport.print() on non-UTF-8 consoles by @dsfaccini in #7290Full Changelog: v2.29.0...v2.30.0
Support FastMCP 4 and MCP SDK v2 in MCPToolset alongside FastMCP 3 by @adtyavrdhn in #6738
MCPToolset alongside FastMCP 3 by @adtyavrdhn in #6738azure_voice_live setting by @DouweM in #6642for_realtime bugs from #6676 by @DouweM in #7412Full Changelog: v2.28.0...v2.29.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
MCPToolset alongside FastMCP 3 by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/6738azure_voice_live setting by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6642for_realtime bugs from #6676 by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7412Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.28.0...v2.29.0
Fixes a high-severity vulnerability in the development web chat UI (Agent.to_web(), clai web): the chat endpoint didn't check the request's content ty…
Fixes a high-severity vulnerability in the development web chat UI (Agent.to_web(), clai web): the chat endpoint didn't check the request's content type, so a plain cross-origin request from a website open in the developer's browser could reach the endpoint without a CORS preflight and trigger the served agent to run and execute its tools with the local process's privileges and credentials. The endpoint now requires Content-Type: application/json and rejects other requests before the body is parsed and before the agent runs. See GHSA-h4xc-3qfq-jf93. Patched in 2.28.0 (v2) and 1.107.4 (v1).
Agent.realtime() by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6324CachePoint to the preceding user message instead of raising by @Diwak4r in https://github.com/pydantic/pydantic-ai/pull/7071PeekableAsyncStream pulls by @mikemikimike in https://github.com/pydantic/pydantic-ai/pull/7023state_restored honestly on realtime reconnect by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7379await_maybe helper by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7265safe_download Host header dropping non-default port by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/7348cerebras optional dependency group by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7387Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.27.1...v2.28.0
This release fixed an information-disclosure issue: retry-prompt content (validation feedback sent back to the model, which can quote invalid values f
This release fixed an information-disclosure issue: retry-prompt content (validation feedback sent back to the model, which can quote invalid values from its output) was not redacted by InstrumentationSettings(include_content=False) when the retry was not tied to a tool call. Now disclosed as GHSA-3gh4-cghq-f8v4 (low). Fixed here in 2.27.1 (#7357); v1 users should upgrade to 1.107.4 or later.
<!-- Release notes generated using configuration in .github/release.yml at main -->
XaiStreamedResponse finish_reason mapping for streaming responses by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/6814RetryPromptPart OpenTelemetry content on include_content by @sean-kim05 in https://github.com/pydantic/pydantic-ai/pull/7357Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.27.0...v2.27.1
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
xai_agent_count to XaiModelSettings by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/7155CompactionPart through the Vercel AI and AG-UI adapters by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7287SnowflakeModel and SnowflakeProvider for Snowflake Cortex by @ayirpown in https://github.com/pydantic/pydantic-ai/pull/6150include_binary_content=False in every OTel serialization sink by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7131ToolReturn.tools in the redacted OTel shape by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7273SpanQuery has_attributes matching for JSON-serialized dict and list values by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/5905encrypted_content verbatim by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7286sanitize_messages by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7285Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.26.0...v2.27.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
load_capability, or ToolReturn.tools — using each provider's native deferral/addition channel by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7104AgentRun.cancel(), RunContext.cancel(), RunCancelled by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6497Model.resolve_prompt_cache_retention() to resolve effective prompt-cache retention from model settings by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7254run_stream_events() iterator to public AgentRunEvents handle with cancel() and run-state access by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6498OpenAIResponsesModel + DeepSeekProvider by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7202model_id through WrapperModel and resolve it against the active model in TemporalModel by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7181supports_inline_system_prompts=False by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7253is_tool_available, TestModel native additions) by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7260CompactionPart boundaries by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7225UIEventStream callbacks that return an async iterator without being an async generator function by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7256CompactionPart by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7228Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.25.0...v2.26.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
FileSearchTool collections search options by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/7154max_tokens for Mistral models, not max_completion_tokens by @feiiiiii5 in https://github.com/pydantic/pydantic-ai/pull/6929base_url port and forward base_url through WrapperModel by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7136thinking="minimal" for GPT-5.6 models by @daikeren in https://github.com/pydantic/pydantic-ai/pull/7082ToolCallPart.args_as_json_str() by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7092Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.24.0...v2.25.0
This release included a fix for an availability vulnerability — unbounded memory use when downloading remote content via the local web_fetch tool or F…
This release included a fix for an availability vulnerability — unbounded memory use when downloading remote content via the local web_fetch tool or FileUrl media downloads — now disclosed as GHSA-v2xh-2vp8-57h8. Fixed in 2.24.0 (#7141); v1 users should upgrade to 1.107.2 or later.
<!-- Release notes generated using configuration in .github/release.yml at main -->
timeout=0 by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/7114allowed_function_names by @LHMQ878 in https://github.com/pydantic/pydantic-ai/pull/6875top_p=0.0 to Bedrock by @LHMQ878 in https://github.com/pydantic/pydantic-ai/pull/6864ignore_streamed_leading_whitespace in Bedrock streams by @LHMQ878 in https://github.com/pydantic/pydantic-ai/pull/6828kimi-k2-thinking and Heroku's kimi-k2-5 as Kimi reasoning models by @LHMQ878 in https://github.com/pydantic/pydantic-ai/pull/6823UserError when an OpenRouter model omits its provider prefix by @LHMQ878 in https://github.com/pydantic/pydantic-ai/pull/6860groq/compound model names by @LHMQ878 in https://github.com/pydantic/pydantic-ai/pull/6825ToolApprovalResponded.approved a StrictBool by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6995Retry-After integer values in wait_retry_after by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/7066ag-ui-protocol instead of returning 422 by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7119apply_event replay by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7138Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.23.0...v2.24.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
ModelSettings.extra_headers by @kkauy in https://github.com/pydantic/pydantic-ai/pull/4825gemini-3-pro-image and gemini-3.1-flash-image Gateway aliases by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/7069cost to RunUsage and cost_limit to UsageLimits by @Kludex in https://github.com/pydantic/pydantic-ai/pull/2684ToolAvailabilityDeltaPart with native tool_addition and additional_tools rendering by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6793bedrock_max_concurrency instead of deadlocking on 0 by @LHMQ878 in https://github.com/pydantic/pydantic-ai/pull/6878GoogleCloudProvider credential scoping and ADC auth env-var leak by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/6500created timestamp from any chunk in OpenAI streaming responses by @LKRCharon in https://github.com/pydantic/pydantic-ai/pull/5496TypeAdapter cache by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7085LogfirePlugin by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7086agent.iter() by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6871Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.22.0...v2.23.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
MCPToolset clients to skip optional MCP tasks via prefer_tasks by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/6851VALIDATED tool mode on supported models by @hramezani in https://github.com/pydantic/pydantic-ai/pull/6353system messages on Anthropic by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6765RunContext.is_tool_available by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7011safe_download redirects by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/6811extra_headers before setdefault in OpenAI chat and Groq models by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/6868args_validator by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6897tool_def in Temporal function-tool activities instead of re-running prepare by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6890UserError instead of hanging when run_sync() is called on an event loop it cannot drive by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6905RunContext fields a tool can read by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6944after_tool_validate when an args_validator defers the call by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6961LogfirePlugin by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6962EnqueueGuard on the DBOS/Prefect model-request and cancel_suspended_response units by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6943ActivityConfig after the activity round trip by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6947Model instances in durable runs instead of re-inferring them from model_id by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6898sets, carry conversation_id, and hard-error on omitted fields in TemporalRunContext by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6891ApprovalRequired/CallDeferred from post-validation tool hooks, UserError from pre-validation ones by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6951UserError when a history processor or fallback_on handler has unresolvable type annotations by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6958ModelAPIError for OpenRouter responses with null choices and no error envelope by @ZacharyHampton in https://github.com/pydantic/pydantic-ai/pull/6901$ref to a union $def, not just the first one by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6960ActivityConfig keys in TemporalDurability by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6964TaskConfig on Prefect MCP tools and add PydanticUserError to its non-retryable set by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6952InstrumentedModel by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6982MCPToolset.tool_for_tool_def by @hramezani in https://github.com/pydantic/pydantic-ai/pull/6449HookTimeoutError and FallbackExceptionGroup instead of retrying forever by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6978tool_choice on OpenRouter anthropic/ models by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6957max_retries to ToolSearchToolset by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/6740ActivityConfig validation on Python 3.10 and 3.11 by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6989pydantic_graph through Temporal workflow sandboxes by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6990TypeAdapters by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7001SystemPromptPart semantics across caching and Temporal by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6984genai-prices>=0.1.0 for detailed usage by @alexmojaki in https://github.com/pydantic/pydantic-ai/pull/6933anyio as a direct dependency of pydantic-ai-slim and pydantic-graph by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7008Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.21.0...v2.22.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
per_request_input_tokens_limit to UsageLimits by @Oxygen56 in https://github.com/pydantic/pydantic-ai/pull/5907KnownModelName from Gateway probes and stable Google image IDs by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/6806Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.20.0...v2.21.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
claude-opus-5) support by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6723reasoning.context support (default all_turns) for the gpt-5.4/gpt-5.5/gpt-5.6 families by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/6673RequestUsage fields across serialization by @alexmojaki in https://github.com/pydantic/pydantic-ai/pull/6685ALLOW_MODEL_REQUESTS guards for embeddings by @zcxGGmu in https://github.com/pydantic/pydantic-ai/pull/6774include_server_side_tool_invocations for Vertex on Gemini 3+ by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/6773_openrouter_settings_to_openai_settings mutating caller's settings dict by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/6743PartStartEvent by @Jonas1312 in https://github.com/pydantic/pydantic-ai/pull/6785McpError from an MCP server recoverable instead of fatal by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6787Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.19.0...v2.20.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
headers and retry_after to ModelHTTPError, populate from all provider SDKs by @dmontagu in https://github.com/pydantic/pydantic-ai/pull/6733<4 by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/6737Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.18.0...v2.19.0
<!-- Release notes generated using configuration in .github/release.yml at v2.18.0 -->
<!-- Release notes generated using configuration in .github/release.yml at v2.18.0 -->
AdvisorTool support for Anthropic and OpenRouter by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/6605external_web_access option to WebSearchTool for OpenAI Responses by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/6710BedrockMantleProvider and normalize response-scoped tool-call IDs by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6538google-genai stream errors in GoogleModel by @dmontagu in https://github.com/pydantic/pydantic-ai/pull/6693Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.17.0...v2.18.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
RequestUsage and RunUsage support arbitrary fields for upcoming genai-prices by @alexmojaki in https://github.com/pydantic/pydantic-ai/pull/6683O(n²) instrumentation cost by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6635ContentFilterError for real Model Armor response blocks (finishReason: MODEL_ARMOR) and record moderation wire-truth cassettes by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6679Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.16.0...v2.17.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
mistral_prompt_cache_key setting and pass parallel_tool_calls to the Mistral SDK by @lionpeloux in https://github.com/pydantic/pydantic-ai/pull/6654ToolFailed for model-visible failures without retries by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/5585run_id= to agent runs, durable wrappers, and UI adapters by @grahamcracker1234 in https://github.com/pydantic/pydantic-ai/pull/6615openai_moderation to OpenAIChatModelSettings and expose Chat Completions moderation results in provider_details by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6658GoogleModelSettings by @Alex-Resch in https://github.com/pydantic/pydantic-ai/pull/5691gemini-3.6-flash and gemini-3.5-flash-lite models by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6668ctx.enqueue() error inside durable units across Temporal, DBOS, and Prefect by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6666$ref sibling keywords when inlining $defs by @lntutor in https://github.com/pydantic/pydantic-ai/pull/6592ctx.enqueue() from an event_stream_handler inside DBOS steps / Prefect tasks by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6671Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.15.0...v2.16.0
Deprecate the Exa search common tools in favor of the ExaSearch capability in Pydantic AI Harness by @dsfaccini in https://github.com/pydantic/pydanti…
<!-- Release notes generated using configuration in .github/release.yml at main -->
gpt-5.6 by @Wh1isper in https://github.com/pydantic/pydantic-ai/pull/6423MistralModel prompts by @pulphix in https://github.com/pydantic/pydantic-ai/pull/6556run/iter/override time by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6072DynamicCapability toolsets in durable execution and wrap DynamicToolset in DBOS steps and Prefect tasks by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6623openai_moderation setting and expose OpenAI Responses API moderation results in provider_details by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/6628ExaSearch capability in Pydantic AI Harness by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6644tool_search replay with null call IDs by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/6604reasoning.encrypted_content on persisted responses by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/6614register_legacy_workflows to DBOSDurability for clean DBOSAgent migration by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6640Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.14.1...v2.15.0
Temporarily withdraw durable wrapper-agent deprecations by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6625
<!-- Release notes generated using configuration in .github/release.yml at main -->
DBOSDurability by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6624Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.14.0...v2.14.1
Add TemporalDurability, DBOSDurability and PrefectDurability capabilities to replace the deprecated wrapper agents by @DouweM in https://github.com/py…
<!-- Release notes generated using configuration in .github/release.yml at main -->
reasoning_effort support via thinking settings by @YHallouard in https://github.com/pydantic/pydantic-ai/pull/5294TemporalDurability, DBOSDurability and PrefectDurability capabilities to replace the deprecated wrapper agents by @DouweM in https://github.com/pydantic/pydantic-ai/pull/4977gemini-2.5-flash-lite-preview-09-2025 and gemini-3.1-flash-lite-preview by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/6606Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.13.0...v2.14.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
include_model_request_parameters instrumentation setting to omit the model_request_parameters span attribute by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6488RaiseContentFilterError capability to raise content filter error for non-empty content filter responses by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6167cache_hit_ratio property to RequestUsage and RunUsage by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6529get_model, resolve_model_id, and for_agent capability hooks by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6333MistralModel streaming settings by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/6563Failed to detach context error when a streamed run is interrupted mid-segment by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6572pydantic_monty in workflow sandbox by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/6564mcp to 1.28.1 for Dependabot alerts by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/6562Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.12.0...v2.13.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
kimi-k3 model by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6551EnqueuedMessagesEvent when enqueued messages are delivered into the run by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6256DeferredToolCallEvent and DeferredToolResultEvent to AgentStreamEvent by @YHallouard in https://github.com/pydantic/pydantic-ai/pull/5588ToolReturnPart serialization to use field aliases so wire output matches return_schema by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/6543*args by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/6541id from the capability for durable execution by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6408GoogleModel per-Part media_resolution forwarding in vendor_metadata by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/6525Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.11.0...v2.12.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
HistoryProcessor and add actionable hints to usage-limit and tool-retry errors by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6346MistralStreamedResponse streamed number/integer validation to accept int-valued numbers and reject bools by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/6479Agent('test') when provider credentials are missing by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6342profile={"default_structured_output_mode": "native"} by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6521profile={'default_structured_output_mode': 'native'} sending untransformed schema by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6539Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.10.0...v2.11.0
Bump transformers floor to >=5.5.0 for CVE-2026-5241 by @hramezani in https://github.com/pydantic/pydantic-ai/pull/6482
<!-- Release notes generated using configuration in .github/release.yml at main -->
message_history provider-valid out of the box (repair tool-call/result pairing) by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6319stop_reason=pause_turn by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6303has_values() returning True for all-zero usage details by @sean-kim05 in https://github.com/pydantic/pydantic-ai/pull/6466RenamedToolset silently dropping a tool on a name collision by @sean-kim05 in https://github.com/pydantic/pydantic-ai/pull/6462bytes in instrumentation serialization by @alexmojaki in https://github.com/pydantic/pydantic-ai/pull/6483run_stream_sync by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/6454ToolCallPart to the preceding reasoning message by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5924DeferredToolResults resume when an output tool call was settled in the same batch as deferred calls by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6491transformers floor to >=5.5.0 for CVE-2026-5241 by @hramezani in https://github.com/pydantic/pydantic-ai/pull/6482Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.9.1...v2.10.0
fix(deps): bump soupsieve to 2.8.4 to fix ReDoS (CVE-2026-49477) by @hramezani in https://github.com/pydantic/pydantic-ai/pull/6442
<!-- Release notes generated using configuration in .github/release.yml at main -->
JsonSchemaTransformer by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/6440MistralModel._get_timeout_ms by @Ricardo-M-L in https://github.com/pydantic/pydantic-ai/pull/5019KnownModelName and restore Gateway-supported models by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/5843Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.9.0...v2.9.1
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
A moderate advisory, GHSA-jpr8-2v3g-wgf9 (CWE-863), affecting the AG-UI UIAdapter.sanitize_messages dangling-tool-call strip, was fixed in 2.5.0 and backported to 1.107.1 on the v1 line. If you are on 2.5.0 or later you already have the fix; this note calls it out now that the advisory is public.
pydantic-ai / pydantic-ai-slim >= 2.0.0, < 2.5.0 (v2) and >= 1.88.0, < 1.107.1 (v1)2.5.0 (v2) and 1.107.1 (v1)requires_approval=True / ApprovalRequiredToolset, or if your tool handlers validate their arguments and enforce authorization themselves./usage slash command to clai CLI for cumulative token usage by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/6245RunContext): expose the run's usage_limits to tools and capabilities by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6341UploadedFile by @gaurav0107 in https://github.com/pydantic/pydantic-ai/pull/5815repr() crash on message parts whose field != returns a non-bool (#6415) by @hramezani in https://github.com/pydantic/pydantic-ai/pull/6421MCPToolset on the DBOSAgent wrapper path by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6406capture_run_messages capture correctly (#1568) by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6345end_strategy='early' for NativeOutput, PromptedOutput, and image output by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6427Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.8.0...v2.9.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
to_cli() to pass model for unset-model agents by @hramezani in https://github.com/pydantic/pydantic-ai/pull/63842.0.0 and target sdk_version=7 in Agent.to_web() by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6296JsonSchemaTransformer to recurse into allOf composition by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/6394Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.7.0...v2.8.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
grok-4.5 model by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6362override(model=...) on an agent with no model set by @hramezani in https://github.com/pydantic/pydantic-ai/pull/6357AlibabaProvider (Chat Completions API) by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5727Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.6.0...v2.7.0
deps: bump torch floor to 2.12.1 to close CVE-2025-3000 by @hramezani in https://github.com/pydantic/pydantic-ai/pull/6309
<!-- Release notes generated using configuration in .github/release.yml at main -->
files support to CodeExecutionTool for Anthropic and OpenAI by @HenryYYang in https://github.com/pydantic/pydantic-ai/pull/4338LatestBedrockModelNames by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6318WebSearchTool domain filters to Groq search_settings by @Iam-Mil in https://github.com/pydantic/pydantic-ai/pull/6160max_running by @VectorPeak in https://github.com/pydantic/pydantic-ai/pull/6282PrefectAgent cache-key drift by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/6313for_run once per run and preserve resolved native tools under override(native_tools=...) by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6332genai-prices to 0.0.70 by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/6330Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.5.1...v2.6.0
Exclude deprecated Bedrock gateway model anthropic.claude-3-5-sonnet-20240620-v1:0 by @ddanielcruzz in https://github.com/pydantic/pydantic-ai/pull/62…
<!-- Release notes generated using configuration in .github/release.yml at main -->
toolResult attachment co-location per-model via bedrock_tool_result_colocatable_content by @Hasnaathussain in https://github.com/pydantic/pydantic-ai/pull/6098thinking setting to Groq reasoning_effort by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6231OnlineEvaluator.max_concurrency by @VectorPeak in https://github.com/pydantic/pydantic-ai/pull/6267FileUrl.force_download in UI round-trips by @HarperZ9 in https://github.com/pydantic/pydantic-ai/pull/6205anthropic.claude-3-5-sonnet-20240620-v1:0 by @ddanielcruzz in https://github.com/pydantic/pydantic-ai/pull/6297NativeOutput description instead of last member's docstring by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6265toolResult turns by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6259ModelResponse from Mistral and Cohere request payloads by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6302Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.5.0...v2.5.1
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
This release included the fix for GHSA-jpr8-2v3g-wgf9 (moderate, CWE-863), carried by the sanitize_messages change in #6169. On the AG-UI serving path (Agent.to_ag_ui() / AGUIAdapter), the dangling-tool-call strip anchored to a pre-sanitization index, so a dropped trailing client message could re-expose a preceding unresolved tool call for execution. The v1 line is patched in 1.107.1.
2.5.0 (v2) and 1.107.1 (v1)>= 2.0.0, < 2.5.0 (v2) and >= 1.88.0, < 1.107.1 (v1)sanitize_messages for inbound message-history hardening by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6169_clean_message_history merges consecutive ModelRequests regardless of conversation_id/metadata by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/6221_build_prompt section order with its few-shot examples by @immuhammadfurqan in https://github.com/pydantic/pydantic-ai/pull/6111thinking support and add models to KnownModelNames by @SuperMarioYL in https://github.com/pydantic/pydantic-ai/pull/6208toolsets in durable runs by @Trollgeir in https://github.com/pydantic/pydantic-ai/pull/6076gen_ai.usage.details.* OTel attributes to fix double-counting by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/6244anyio portal thread; fix async stream_text early-break teardown by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6199bedrock_supported_media_kinds_in_tool_returns for Meta, Mistral, and Qwen by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6254numpy source builds in examples by @hramezani in https://github.com/pydantic/pydantic-ai/pull/6246Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.4.0...v2.5.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
preserve_file_data into allow_uploaded_files (inbound security) and an AG-UI representation opt-in by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6232GEval evaluator and standard quality metric rubrics for LLMJudge by @dmontagu in https://github.com/pydantic/pydantic-ai/pull/5129XSearchTool handle limit by @gyx09212214-prog in https://github.com/pydantic/pydantic-ai/pull/5979process_tool_calls by @kratos0718 in https://github.com/pydantic/pydantic-ai/pull/6189WebSearchTool.user_location to xAI web search by @manan-tech in https://github.com/pydantic/pydantic-ai/pull/6181KeyboardInterrupt in synchronous run_until_complete wrappers by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6198description from ToolSearchMatch by @serozhenka in https://github.com/pydantic/pydantic-ai/pull/5654max_concurrency by @VectorPeak in https://github.com/pydantic/pydantic-ai/pull/6228run_stream_events() background task on first event iteration by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6234genai-prices to >=0.0.69 by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/6212Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.3.0...v2.4.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
provider_name on TestModel non-streaming responses by @syf2211 in https://github.com/pydantic/pydantic-ai/pull/6066defer_loading without tool_search on models without native tool search by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/6144safe_to_json by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6073ToolReturnPart.content via a ToolReturnContent discriminator by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6191AGUIAdapter.dump_messages reordering ToolReturnPart after UserPromptPart by @amarjaleelbanbhan in https://github.com/pydantic/pydantic-ai/pull/5969new_messages() boundary by position so a rebuilt resumed request isn't leaked by @klplentific in https://github.com/pydantic/pydantic-ai/pull/6034tool_kind in Vercel AI and AG-UI message round-trips by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/5873get_tools caching replay-deterministic by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5883FilePart.content.vendor_metadata in AG-UI and Vercel AI adapter round-trips by @Navaneethp007 in https://github.com/pydantic/pydantic-ai/pull/6095get_instructions in an activity under Temporal by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5925Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.2.0...v2.3.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
claude-sonnet-5) support by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6161retry_options parameter to GoogleProvider by @graydeon in https://github.com/pydantic/pydantic-ai/pull/4966detail from vendor_metadata for GroqModel and MistralModel by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/6014group_by_temporal emitting first item alone when delayed past soft_max_interval by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/5947output_audio_tokens in usage accumulation by @jnMetaCode in https://github.com/pydantic/pydantic-ai/pull/4594TogetherProvider.model_profile against model names without a / by @immuhammadfurqan in https://github.com/pydantic/pydantic-ai/pull/6113GoogleModel): include CodeExecutionTool in include_server_side_tool_invocations check by @aarsh767 in https://github.com/pydantic/pydantic-ai/pull/6052downstream_join_id double-firing the join on a non-empty iterable by @clavedeluna in https://github.com/pydantic/pydantic-ai/pull/6009output_audio_tokens accumulation in _incr_usage_tokens by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6141ClosedResourceError when cancelling a graph run mid-send by @conradlee in https://github.com/pydantic/pydantic-ai/pull/6149vendor_metadata through Vercel AI & AG-UI adapters by @Bartok9 in https://github.com/pydantic/pydantic-ai/pull/5790strip_markdown_fences by @CodingFeng101 in https://github.com/pydantic/pydantic-ai/pull/6090/v1 in base_url by @VectorPeak in https://github.com/pydantic/pydantic-ai/pull/6142schema_path handling in Dataset.to_file by @VectorPeak in https://github.com/pydantic/pydantic-ai/pull/6143deps deserialization in non-streaming Temporal model-request activity by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5900Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.1.0...v2.2.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
_20260209 web tools with server-tool replay by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/4844ExceptionGroup-wrapped tool errors to ModelRetry in MCPToolset by @dmontagu in https://github.com/pydantic/pydantic-ai/pull/6004cancel() from flipping complete state on finished stream by @Oxygen56 in https://github.com/pydantic/pydantic-ai/pull/5795PydanticAIPlugin.__init__ by @syf2211 in https://github.com/pydantic/pydantic-ai/pull/6065Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.0.0...v2.1.0
Emit reasoning_effort='none' for Cerebras, deprecate cerebras_disable_reasoning, add cerebras_clear_thinking by @dsfaccini in https://github.com/pydan…
After seven betas, Pydantic AI V2 is now stable. V2 leans into a harness-first design with capabilities as a core primitive — a single composable unit that bundles an agent's tools, hooks, instructions, and model settings, reaching every layer of the agent through one concept.
Install it with:
uv add pydantic-ai
See the Upgrade Guide for everything that's changed and the recommended path from V1.
<!-- Release notes generated using configuration in .github/release.yml at main -->
gemini-embedding-2 embedding model by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5887DeferredTools in AGUIAdapter by @jjmllr in https://github.com/pydantic/pydantic-ai/pull/5441google_task text-prefix conditioning for gemini-embedding-2 embeddings by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5894xai_max_turns to XaiModelSettings by @manan-tech in https://github.com/pydantic/pydantic-ai/pull/5978function_calling_config without function declarations by @glendigity in https://github.com/pydantic/pydantic-ai/pull/5791UploadedFile parts to input_image by @Oxygen56 in https://github.com/pydantic/pydantic-ai/pull/5809thinking handling for Groq qwen3 and Cerebras gpt-oss by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5850Evaluator outputs by @alexmojaki in https://github.com/pydantic/pydantic-ai/pull/5863AnthropicModel.count_tokens divergence on ToolSearchTool replay history by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5855reasoning_content on synthesized tool-call turns for DeepSeek thinking models by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/5842UploadedFile.provider_name in tool returns and consolidate the guard into Model._validate_uploaded_file_provider by @Oxygen56 in https://github.com/pydantic/pydantic-ai/pull/5860zai-glm reasoning in <think> tags and bump to zai-glm-4.7 by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5891GoogleModel streaming chunks by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5886output_audio_tokens in RunUsage by @HaozheZhang6 in https://github.com/pydantic/pydantic-ai/pull/5904kind discriminator in text output by @ret2libc in https://github.com/pydantic/pydantic-ai/pull/5845additionalModelRequestFields in Bedrock count_tokens by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5910MCPToolset(http_client=...) crash on FastMCP's follow_redirects kwarg by @he-yufeng in https://github.com/pydantic/pydantic-ai/pull/5694tool_choice from ModelSettings to v2 chat API by @Julien-ser in https://github.com/pydantic/pydantic-ai/pull/5833max_tokens to max_completion_tokens or max_tokens via OpenAIModelProfile flag by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5926top_k model setting to Bedrock additionalModelRequestFields by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5922FallbackModel declaring an unassigned _model_name dataclass field by @dorukgezici in https://github.com/pydantic/pydantic-ai/pull/5932groq_reasoning_effort setting by @Oxygen56 in https://github.com/pydantic/pydantic-ai/pull/5797reasoning_effort='none' for Cerebras, deprecate cerebras_disable_reasoning, add cerebras_clear_thinking by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5897Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.0.0b7...v2.0.0
The stable V2.0 release. There are no new breaking or behavior changes since the betas; the full breaking-change list and recommended upgrade path are in the v2.0.0b1 entry below. Install it with:
uv add pydantic-ai
<!-- Release notes generated using configuration in .github/release.yml at v2-main -->
<!-- Release notes generated using configuration in .github/release.yml at v2-main -->
For more information on Pydantic AI V2, see the release notes for v2.0.0b1 and the Upgrade Guide.
Beta 7 adds no new breaking or v2-specific changes, but pulls in these changes from v1.107.0:
UploadedFile consistently with FileUrl in UI adapters by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5772
VercelAIAdapter trusts client-controlled provider metadata to construct UploadedFile references (confused-deputy file read) https://github.com/pydantic/pydantic-ai/security/advisories/GHSA-h7p7-w5gc-xj3wVercelAIAdapter), AND your model-provider or cloud-storage account holds files referenceable by an attacker-guessable UploadedFile id or storage URI (e.g. s3://…, gs://…).UploadedFile parts before running it.AGUIAdapter / Agent.to_ag_ui on defaults — the preserve_file_data flag that re-enables this path is off by default.known_model_names() to enumerate KnownModelName members by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5803CachePoint and prompt caching support by @Adversarian in https://github.com/pydantic/pydantic-ai/pull/4604claude-fable-5) and Claude Mythos 5 (claude-mythos-5) support by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5849message=None Bedrock start events in stream path by @Bartok9 in https://github.com/pydantic/pydantic-ai/pull/5818AnthropicModel.count_tokens with native tools by @kazmer97 in https://github.com/pydantic/pydantic-ai/pull/5704Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.0.0b6...v2.0.0b7
The seventh V2 beta, forked from v1.107.0. There are no new V2 breaking or behavior changes since v2.0.0b6 below — everything in that entry applies unchanged — but this beta picks up the latest V1 release on top, which adds Claude Fable 5 / Mythos 5 model support and OpenRouter prompt caching (CachePoint), plus known_model_names() and Anthropic fixes; see the v1.107.0 release notes for the full list.
Install it the same way, pinning the exact pre-release version:
pip/uv-add "pydantic-ai==2.0.0b7"
For the full breaking-change list and the recommended upgrade path, see the v2.0.0b1 entry below; the only difference is that the latest V1 to upgrade through first is now v1.107.0.
<!-- Release notes generated using configuration in .github/release.yml at v2-main -->
<!-- Release notes generated using configuration in .github/release.yml at v2-main -->
For more information on Pydantic AI V2, see the release notes for v2.0.0b1 and the Upgrade Guide.
Beta 6 adds no new breaking or v2-specific changes, but pulls in these changes from v1.106.0:
UploadedFile consistently with FileUrl in UI adapters by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5772
VercelAIAdapter trusts client-controlled provider metadata to construct UploadedFile references (confused-deputy file read) https://github.com/pydantic/pydantic-ai/security/advisories/GHSA-h7p7-w5gc-xj3wVercelAIAdapter), AND your model-provider or cloud-storage account holds files referenceable by an attacker-guessable UploadedFile id or storage URI (e.g. s3://…, gs://…).UploadedFile parts before running it.AGUIAdapter / Agent.to_ag_ui on defaults — the preserve_file_data flag that re-enables this path is off by default.seed setting to xAI by @colesmcintosh in https://github.com/pydantic/pydantic-ai/pull/5741api_host and timeout to XaiProvider by @colesmcintosh in https://github.com/pydantic/pydantic-ai/pull/5742event_stream_handler doesn't consume the stream by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/5771Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.0.0b5...v2.0.0b6
The sixth V2 beta, forked from v1.106.0. There are no new V2 breaking or behavior changes since v2.0.0b5 below — everything in that entry applies unchanged — but this beta picks up the latest V1 release on top, which adds api_host/timeout configuration and base seed mapping for the xAI provider, plus streaming and data-URI handling fixes; see the v1.106.0 release notes for the full list.
Install it the same way, pinning the exact pre-release version:
pip/uv-add "pydantic-ai==2.0.0b6"
For the full breaking-change list and the recommended upgrade path, see the v2.0.0b1 entry below; the only difference is that the latest V1 to upgrade through first is now v1.106.0.
<!-- Release notes generated using configuration in .github/release.yml at v2-main -->
<!-- Release notes generated using configuration in .github/release.yml at v2-main -->
For more information on Pydantic AI V2, see the release notes for v2.0.0b1 and the Upgrade Guide.
Beta 5 adds no new breaking or v2-specific changes, but pulls in these changes from v1.105.0:
reasoning_effort support and current xAI model names by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/5454gateway/ model construction inside a Temporal workflow by passing provider SDKs through the sandbox by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/5733GoogleModelSettings.google_cached_content so request omits system_instruction, tools, and tool_config by @gaurav0107 in https://github.com/pydantic/pydantic-ai/pull/5681Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.0.0b4...v2.0.0b5
The fifth V2 beta, forked from v1.105.0. There are no new V2 breaking or behavior changes since v2.0.0b4 below — everything in that entry (including the prepare-callbacks change) still applies — but this beta picks up the latest V1 release on top, which adds on-demand (deferred-loading) capabilities and Grok 4.3 reasoning_effort support, plus GoogleModelSettings.google_cached_content and Temporal gateway/ fixes; see the v1.105.0 release notes for the full list.
Install it the same way, pinning the exact pre-release version:
pip/uv-add "pydantic-ai==2.0.0b5"
For the full breaking-change list and the recommended upgrade path, see the v2.0.0b1 entry below; the only difference is that the latest V1 to upgrade through first is now v1.105.0.
Beta 4 turns the V1 deprecation warning for prepare-callback None returns into a hard TypeError, and pulls in two V1 releases on top — v1.103.0 and v1…
<!-- Release notes generated using configuration in .github/release.yml at v2-main -->
For more information on Pydantic AI V2, see the Upgrade Guide.
Beta 4 turns the V1 deprecation warning for prepare-callback None returns into a hard TypeError, and pulls in two V1 releases on top — v1.103.0 and v1.104.0:
list_prompts and get_prompt functionality to McpServer by @bdore in https://github.com/pydantic/pydantic-ai/pull/3889VercelAIAdapter's UIMessage.metadata by @Genmin in https://github.com/pydantic/pydantic-ai/pull/5279anthropic_eager_input_streaming in OpenRouterModel by @Alex-Resch in https://github.com/pydantic/pydantic-ai/pull/5656None returns from tool prepare callbacks by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/5668malformed_model_output and malformed_tool_use to FinishReason.error by @kuishou68 in https://github.com/pydantic/pydantic-ai/pull/5640type='adaptive' in _is_thinking_enabled by @sevakva in https://github.com/pydantic/pydantic-ai/pull/5651force_download flag from client-submitted FileUrl parts in UIAdapter.sanitize_messages by @colesmcintosh in https://github.com/pydantic/pydantic-ai/pull/5571None by @dfm88 in https://github.com/pydantic/pydantic-ai/pull/5188thinking=False on hybrid OpenRouter/xAI/Bedrock routes, aligning silent-drop with direct routes by @sarth6 in https://github.com/pydantic/pydantic-ai/pull/5433tool_choice cache preservation by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5674Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.0.0b3...v2.0.0b4
The fourth V2 beta, forked from v1.104.0. One new V2 behavior change since v2.0.0b3:
prepare_tools= / PrepareTools capability) that return None now raise TypeError instead of silently stripping all tools. V1.103.0 announces this change via PydanticAIDeprecationWarning (see #5188); V2 turns the warning into a hard error (see #5668). Return an empty list ([]) when you mean "no tools for this turn."This beta also picks up two V1 releases on top — v1.103.0 and v1.104.0 — together adding Claude Opus 4.8 support, McpServer.list_prompts / get_prompt, message-timestamp roundtripping through VercelAIAdapter's UIMessage.metadata, OpenRouter eager input streaming, and several Bedrock and UI fixes. See those release notes for the full list.
Install it the same way, pinning the exact pre-release version:
pip/uv-add "pydantic-ai==2.0.0b4"
For the full breaking-change list and the recommended upgrade path, see the v2.0.0b1 entry below; the only difference is that the latest V1 to upgrade through first is now v1.104.0.
<!-- Release notes generated using configuration in .github/release.yml at v2-main -->
<!-- Release notes generated using configuration in .github/release.yml at v2-main -->
For more information on Pydantic AI V2, see the release notes for v2.0.0b1 and the Upgrade Guide.
Beta 3 adds no new breaking or v2-specific changes, but pulls in these changes from v1.102.0:
FileUrl into force_download='allow-local' on a URL that is, or could be, influenced by untrusted input, AND runs on a NAT64- or ISATAP-configured network (e.g. some IPv6-only or dual-stack-with-NAT64 Kubernetes setups).Agent.to_web / clai web; VercelAIAdapter; AGUIAdapter / Agent.to_ag_uistrict=None tools to strict mode with Bedrock, and skip strict field when botocore is too old by @shailendher in https://github.com/pydantic/pydantic-ai/pull/5580variable_instructions span attribute by @madanlalit in https://github.com/pydantic/pydantic-ai/pull/5487VercelAIAdapter now accepts providerExecuted / title on dynamic-tool message parts by @he-yufeng in https://github.com/pydantic/pydantic-ai/pull/5474WebFetchTool domain matching by @DouweM in https://github.com/pydantic/pydantic-ai/pull/5592Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.0.0b2...v2.0.0b3
The third V2 beta, forked from v1.102.0. There are no new V2 breaking changes since v2.0.0b1 below — everything in that entry applies unchanged — but this beta picks up the latest V1 release on top, which is a bug-fix release; see the v1.102.0 release notes for the full list.
Install it the same way, pinning the exact pre-release version:
pip/uv-add "pydantic-ai==2.0.0b3"
For the full breaking-change list and the recommended upgrade path, see the v2.0.0b1 entry below; the only difference is that the latest V1 to upgrade through first is now v1.102.0.
<!-- Release notes generated using configuration in .github/release.yml at v2-main -->
<!-- Release notes generated using configuration in .github/release.yml at v2-main -->
For more information on Pydantic AI V2, see the release notes for yesterday's v2.0.0b1 and the Upgrade Guide.
Beta 2 adds no new breaking or v2-specific changes, but pulls in these changes from v1.101.0:
ctx.enqueue / agent_run.enqueue) by @DouweM in https://github.com/pydantic/pydantic-ai/pull/4980XSearch capability model-agnostic via subagent fallback by @colesmcintosh in https://github.com/pydantic/pydantic-ai/pull/5120top_k model setting in GoogleModel, AnthropicModel, and CohereModel by @madanlalit in https://github.com/pydantic/pydantic-ai/pull/5558AnthropicModel dropping code execution tool results when continuing a conversation by @2830500285 in https://github.com/pydantic/pydantic-ai/pull/5568BaseModel tool arguments sent in wrapped form when the model uses default extra='ignore' by @macayu17 in https://github.com/pydantic/pydantic-ai/pull/5560xai-sdk 1.6.0 by @FU-max-boop in https://github.com/pydantic/pydantic-ai/pull/5355genai-prices minimum version by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/5565Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.0.0b1...v2.0.0b2
The second V2 beta, forked from v1.101.0. There are no new V2 breaking changes since v2.0.0b1 below — everything in that entry applies unchanged — but this beta picks up the latest V1 release on top, which adds the pending message queue (ctx.enqueue / agent_run.enqueue).
Install it the same way, pinning the exact pre-release version:
pip/uv-add "pydantic-ai==2.0.0b2"
For the full breaking-change list and the recommended upgrade path, see the v2.0.0b1 entry below; the only difference is that the latest V1 to upgrade through first is now v1.101.0.
V2.0.0b1 is forked from v1.100.0 (out today), which (along with other recent versions) deprecates most of what V2 removes. The recommended path (full…
V2 leans into a harness-first design, with capabilities as a core primitive. A capability is a single, composable unit that bundles an agent's tools, lifecycle hooks, instructions, and model settings — so a whole extension (a memory system, a guardrail, a coding toolkit) can reach every layer of the agent through one concept you pass via capabilities=[...]. Pydantic AI stays a small core: some capabilities ship with it, more come from the first-party Pydantic AI Harness, and others are third-party or your own.
Many of V2's changes move configuration that used to be spread across Agent arguments onto that primitive, alongside the behavior changes V1's stability guarantee didn't allow.
V2.0.0b1 is forked from v1.100.0 (out today), which (along with other recent versions) deprecates most of what V2 removes. The recommended path (full before → after in the Upgrade Guide):
uv add 'pydantic-ai==2.0.0b1'
pydantic-ai install now ships fewer extras — add providers like bedrock, groq, mistral explicitly.openai: model names now use the OpenAI Responses API; use openai-chat: to stay on Chat Completions.WebSearch/WebFetch are native-only by default, and MCP(url=...) runs locally by default.capture_run_messages() now also captures partial messages from interrupted runs.end_strategy='graceful') instead of being skipped.Most other removals were deprecated by v1.100.0; the Upgrade Guide has the complete list, split into changes covered vs. not covered by deprecation warnings.
It's a pre-release — stable V2.0 is expected within roughly two weeks — so pin the exact b version and expect occasional changes before then.
File issues or chat in Slack.
Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v1.100.0...v2.0.0b1
The first V2 beta, forked from v1.100.0, which deprecates most of what V2 removes. V2 leans into a harness-first design with capabilities as a core primitive: a single, composable unit that bundles an agent's tools, hooks, instructions, and model settings, reaching every layer of the agent through one concept. Many of V2's changes move configuration that used to be spread across Agent arguments onto that primitive, alongside the behavior changes that V1's stability guarantee didn't allow. Pydantic AI stays a small core: some capabilities ship with it, more come from the first-party Pydantic AI Harness, and others are third-party or your own.
The breaking changes below are split into two groups:
Recommended upgrade path. To make the jump as smooth as possible:
You can also upgrade straight to V2 and work through the list below directly — it's organized so a coding agent can apply the code changes mechanically. Resolving deprecation warnings on the latest V1 first is still the smoother path, since it spreads the work out and leaves you only the behavior changes to reason about consciously at the end.
Message history serialized with V1 (via [ModelMessagesTypeAdapter][pydantic_ai.messages.ModelMessagesTypeAdapter]) continues to deserialize in V2.
These removals and behavior changes could not be announced via a V1 deprecation warning, so review them even if you've resolved every deprecation warning on the latest V1.
Code changes:
None to object: an un-parameterized Agent(...) now infers Agent[object, str] instead of Agent[None, str], and the pydantic_graph StateT/RunEndT/DepsT defaults changed to match. Update explicit Agent[None, ...], RunContext[None], and Tool[None] annotations that don't actually require None dependencies to use object. This is a type-checking-only change; runtime behavior is unchanged. See #5307.pydantic_graph.persistence package and the pydantic_graph.mermaid module are removed, with no V2 equivalent for standalone Mermaid generation (render diagrams with Graph.render()). The builder API deliberately does not snapshot graph state, so there is no pydantic_graph replacement for the persistence package; to save, resume, and fork agent run state, Pydantic AI Harness ships the StepPersistence capability. The move of the [GraphBuilder][pydantic_graph.GraphBuilder] API out of pydantic_graph.beta to the top-level pydantic_graph was deprecation-announced; see below. See #5470.ModelProfile][pydantic_ai.profiles.ModelProfile] and its subclasses are now TypedDicts instead of dataclasses. Passing profile=OpenAIModelProfile(field=value) into a model still works unchanged; the migration only matters if you read or mutate profile fields, or call .update()/.from_profile(). See ModelProfile is now a TypedDict below. (#5481)Default behavior changes — same API, different runtime behavior (roughly ordered by how many users they affect):
uv add pydantic-ai / pip install pydantic-ai now installs a slimmer set of extras (frontier providers plus minimal integrations); providers like bedrock, groq, and mistral are no longer included by default, so you'll need to add the extras you use. See Slimmer default extras below. (#5467)end_strategy changed from 'early' to 'graceful': when a model calls function tools in the same response as a successful output tool, those function tools now run (and their side effects happen) instead of being skipped, and tool calls run in the order the model emitted them. See Parallel tool-call execution order below. (#5339)gen_ai.aggregated_usage.*. See Instrumentation defaults below. (#5523)capture_run_messages()][pydantic_ai.capture_run_messages] now also captures the partial ModelRequest/ModelResponse from an interrupted run, marked with state='interrupted' (a new ModelRequest.state field is added). Code that asserts on exact captured-message counts on error paths may need updating. See #5364.OutputToolCallEvent/OutputToolResultEvent instead of FunctionToolCallEvent/FunctionToolResultEvent. Separately, native tool calls and returns no longer emit dedicated events at all — the BuiltinToolCallEvent/BuiltinToolResultEvent classes are removed and they surface only via the standard PartStartEvent/PartDeltaEvent. See #5332 and #5476.ModelProfile][pydantic_ai.profiles.ModelProfile] is now a TypedDict {#modelprofile-is-now-a-typeddict}See the Model Profile guide for an overview of what a model profile is and how to configure one.
[ModelProfile][pydantic_ai.profiles.ModelProfile] and all its subclasses ([OpenAIModelProfile][pydantic_ai.profiles.openai.OpenAIModelProfile], [AnthropicModelProfile][pydantic_ai.profiles.anthropic.AnthropicModelProfile], [GoogleModelProfile][pydantic_ai.profiles.google.GoogleModelProfile], BedrockModelProfile, etc.) are now TypedDict(total=False) instead of @dataclass. This unifies the mental model with [ModelSettings][pydantic_ai.settings.ModelSettings] (also a TypedDict) and enables direct dict-spread for cross-class merging.
ModelProfile.update() and ModelProfile.from_profile() are removed; use the module-level [merge_profile][pydantic_ai.profiles.merge_profile] (later argument wins per key).
Migration recipes:
| v1 (dataclass) | v2 (TypedDict) |
|---|---|
OpenAIModelProfile(field=value) |
Same syntax; returns a partial dict instead of a fully-defaulted instance. |
profile.field (attribute read) |
profile.get('field', <default>) — non-trivial defaults are exported from [pydantic_ai.profiles][pydantic_ai.profiles] (e.g. [DEFAULT_THINKING_TAGS][pydantic_ai.profiles.DEFAULT_THINKING_TAGS], [DEFAULT_PROMPTED_OUTPUT_TEMPLATE][pydantic_ai.profiles.DEFAULT_PROMPTED_OUTPUT_TEMPLATE]); the fully-merged base is [DEFAULT_PROFILE][pydantic_ai.profiles.DEFAULT_PROFILE]. |
profile.field = value (attribute write) |
profile['field'] = value |
dataclasses.replace(profile, field=value) |
{**profile, 'field': value} or merge_profile(profile, ModelProfile(field=value)) |
profile.update(other) |
merge_profile(profile, other) |
OpenAIModelProfile.from_profile(p) |
Just p — no upcasting needed |
Model(name, profile=full_profile) (full replace) |
Now merges on top of the provider's default profile — usually what you want. For a hard replace use Model(name, profile=lambda _default: full_profile). |
Model(name, profile=fn) where fn: Callable[[str], ModelProfile | None] |
Removed — the user-passed callable is now Callable[[ModelProfile], ModelProfile], receiving the resolved default and returning the final profile. The (model_name: str) -> ModelProfile | None shape is still accepted internally by Provider.model_profile. |
isinstance(profile, OpenAIModelProfile) |
Not supported by TypedDict at runtime — raises TypeError. Use isinstance(profile, dict) or check key presence ('openai_chat_supports_web_search' in profile). Pyright still narrows correctly via the TypedDict subclass annotation. |
Model.profile is now the single source of truth for the resolved profile. It is composed by [merge_profile][pydantic_ai.profiles.merge_profile] in this order (later wins):
DEFAULT_PROFILE][pydantic_ai.profiles.DEFAULT_PROFILE] — base defaults for every documented key.Provider.model_profile(model_name) — provider/model-specific resolution.profile= argument — either a partial dict (merged on top) or a Callable[[ModelProfile], ModelProfile] (full control: receives the resolved default, returns the final profile).In v1, ModelProfile.update() silently filtered out fields not declared on the target class. In v2, dict-spread preserves every key.
This means e.g. a Bedrock-hosted Anthropic model's resolved profile now carries the upstream anthropic_* fields alongside the bedrock_* fields, where v1 dropped them. No in-tree model class reads cross-class fields, so behavior is unchanged in the standard providers; but custom model classes that do profile.get('anthropic_supports_adaptive_thinking', False) on a non-Anthropic route will now see the value the upstream Anthropic profile set, where v1 always returned the default.
See the Model Profile guide for how to configure a profile, and PR #5481 for the full ModelProfile redesign.
The default [end_strategy][pydantic_ai.agent.EndStrategy] changed from 'early' to 'graceful'. This only affects responses where a model calls function tools in the same response as an output tool (the call that ends the run). When that output tool succeeds, the function tools requested alongside it now run by default instead of being skipped, so their side effects happen and their results reach the model if the run continues; and a function tool's [ModelRetry][pydantic_ai.exceptions.ModelRetry] now suppresses the output result so the model can correct itself on the next round. The case where every output tool fails is unchanged: function tools run and the run continues either way. Most agents don't need any change. If you relied on the run ending the instant an output tool succeeds — skipping any function tools requested in the same response — set end_strategy='early' explicitly.
The sequential=True flag on a tool is now a per-tool barrier rather than a batch-wide serial switch: a sequential tool runs alone, but other tools in the same response still run in parallel around it. The barrier now also applies to output tools via [ToolOutput(sequential=True)][pydantic_ai.output.ToolOutput], not just function tools. To run all of a run's tools serially, wrap the run in [agent.parallel_tool_call_execution_mode('sequential')][pydantic_ai.agent.AbstractAgent.parallel_tool_call_execution_mode] or set parallel_tool_calls=False on the [model settings][pydantic_ai.settings.ModelSettings].
See Parallel Output Tool Calls for the full behavior of all three strategies, and #5339.
pydantic-ai extrasA bare uv add pydantic-ai / pip install pydantic-ai now installs pydantic-ai-slim[openai,anthropic,google,cli,mcp,evals,web,retries,logfire] — frontier providers plus minimal integrations. Providers and integrations that were previously bundled are no longer installed by default; add the ones you use explicitly, e.g. uv add 'pydantic-ai[bedrock,groq]': bedrock, groq, mistral, cohere, xai, huggingface, temporal, ag-ui, ui, and spec. See the installation guide for the full list of extras.
Some pydantic-ai-slim extras were also removed outright (not just dropped from the default bundle): the outlines-* extras (the Outlines integration is removed), vertexai (Vertex AI is now served by the google extra), fastmcp (the FastMCP back-compat shim is removed), and a2a (A2A now lives in the upstream fasta2a package). See #5467.
The default instrumentation format is now version 5 (versions 2–4 still work but emit a deprecation warning; version 1 and its event_mode=/logger_provider= arguments are removed). In version 5, deferred tool calls (CallDeferred/ApprovalRequired) are no longer recorded as span errors.
Separately, [InstrumentationSettings][pydantic_ai.models.instrumented.InstrumentationSettings]'s use_aggregated_usage_attribute_names now defaults to True: agent run spans report token usage under gen_ai.aggregated_usage.* while model request spans keep gen_ai.usage.*, which avoids double-counting in backends that sum parent and child usage. Dashboards and alerts that read token usage from run spans must be updated, or set use_aggregated_usage_attribute_names=False to keep the V1 attribute names.
See #5523.
These changes were announced in the latest V1 releases via deprecation warnings that name the replacement API. If you upgraded to the latest V1 and resolved every warning, you've already made them. The V1 → V2 migration map carries the full before → after for every symbol; this section records the behavior that changes with them and the PRs each one landed in.
Behavior changes that flip silently if the V1 deprecation warning was not addressed — even though these were announced, an unaddressed warning means the behavior changes without raising an error, so confirm you've handled them:
openai: model prefix now uses the OpenAI Responses API ([OpenAIResponsesModel][pydantic_ai.models.openai.OpenAIResponsesModel]) instead of the Chat Completions API ([OpenAIChatModel][pydantic_ai.models.openai.OpenAIChatModel]). Use openai-chat: to keep Chat Completions, or openai-responses: to opt into the new default explicitly. Announced via #5334; flipped in #5469.WebSearch and WebFetch capabilities are now native-only and raise on models that don't support them, and MCP(url=...) runs the server locally by default. Restore the V1 fallbacks with WebSearch(local='duckduckgo'), WebFetch(local=True), and MCP(url=..., native=True). Announced via #5331; changed in #5333.API removals and renames — look each old name up in the migration map; the PRs that announced and landed each group are:
| Group | PRs |
|---|---|
Providers: Grok → xAI (grok: prefix → xai:) |
#5460 |
Providers: Google GLA/Vertex → GoogleProvider/GoogleCloudProvider, GeminiModel → GoogleModel |
#5336, #5543, #5479 |
Models: OpenAIModel → OpenAIChatModel, system_prompt_role and sampling-settings move into the profile |
#5468 |
Models: StreamedResponse.usage() becomes a property (affects custom Model subclasses) |
#5546 |
Models: bare provider-prefix-less names (Agent('gpt-5')) now raise UserError |
#5464 |
Native tools: builtin_tools → native_tools throughout |
#5338, #5396 |
Native tools: UrlContextTool → WebFetchTool |
#5458 |
MCP: per-transport server classes → MCPToolset |
#5325, #5337 |
Agent config → capabilities: instrument= |
#5434 |
Agent config → capabilities: event_stream_handler=, prepare_tools= |
#5335, #5475 |
Agent config → capabilities: history_processors= |
#5425 |
Agent config: mcp_servers= → toolsets=, sequential_tool_calls() → parallel_tool_call_execution_mode() |
#5466 |
Tools: DeferredToolCalls → DeferredToolRequests, DeferredToolset → ExternalToolset |
#5459 |
Tools: FunctionToolset.tool() now requires a RunContext first parameter |
#5462 |
Tools: pydantic_ai.ext.aci removed (wrap with Tool.from_schema) |
#5510, #5467 |
Usage and response-field renames (request_tokens → input_tokens, vendor_details → provider_details, …) |
#5476 |
Events: dedicated OutputToolCallEvent/OutputToolResultEvent, FunctionToolResultEvent.result → .part |
#5332 |
Streaming: StreamedRunResult accessor renames, stream_responses() → stream_response() |
#5296, #5463 |
Streaming: Agent.run_stream_events() is an async context manager only |
#5440 |
Results: result.usage()/result.timestamp()/stream.get() become properties |
#5263 |
Integrations: Agent.to_a2a() and the bundled fasta2a move upstream |
#5426, #5502 |
Integrations: Agent.to_ag_ui()/AGUIApp → AGUIAdapter, cached_async_http_client → create_async_http_client() |
#5345, #5464 |
Graph: pydantic_graph.beta imports move to top-level pydantic_graph |
#5306, #5470 |
Instrumentation: version=1 and its event_mode=/logger_provider= arguments removed |
#5523 |
Pydantic Evals: keyword-only arguments, required Dataset(name=...), Evaluator.name → get_serialization_name() |
#5547, #5548 |
Pydantic Evals: evaluation_name/evaluator_version class attributes → get_default_evaluation_name()/get_evaluator_version() |
#5554, #5556 |
Four of these carry a caveat the name mapping alone doesn't convey:
Agent.set_mcp_sampling_model() is not removed — it still sets the sampling model on every registered MCPToolset, while MCPToolset(sampling_model=...) sets it on one toolset at construction.version=2/3/4 still work but now emit a deprecation warning, and the default is version=5 — see Instrumentation defaults above for the behavior changes that ship with it.Agent(instrument=...): only the constructor arguments are removed. The Agent.instrument property, Agent.instrument_all(), and InstrumentedModel are unchanged.GHSA-m5vj-8mcw-82qx (high): web_fetch_tool and the WebFetch capability's local fallback re-indented a JSON response on the event loop before applying
web_fetch_tool and the WebFetch capability's local fallback re-indented a JSON response on the event loop before applying the returned-content limit, so a deeply nested document within the download size limit could expand to hundreds of times its size, using large amounts of memory and delaying other work in the same process. You are affected if an attacker can choose or influence the URLs the tool fetches. Provider-native web fetching is not affected. Fixed in v1.107.10 and v2.66.0 (pydantic-ai, pydantic-ai-slim).169.254.0.23, so someone who can supply a URL the application downloads could have it fetch the instance's temporary role credentials. You are affected if you run on Tencent Cloud and allow local URLs, through force_download='allow-local' on a FileUrl or web_fetch_tool(allow_local_urls=True). Fixed in v1.107.10 and v2.66.0 (pydantic-ai, pydantic-ai-slim).extra_headers and extra_body embedding settings, so credentials passed through them could be read by anyone with access to the exported traces. You are affected if you instrument embedding models and pass secrets through those settings. Fixed in v1.107.10 and v2.66.0 (pydantic-ai, pydantic-ai-slim). Restrict access to historical traces and rotate credentials they exposed.$defs and $ref, a small tool schema whose definitions reference one another repeatedly expanded exponentially when inlined on the event loop, which can take minutes of CPU time and gigabytes of memory. You are affected if you serve such a model through the AG-UI adapter, where clients submit their own frontend tool schemas. Fixed in v1.107.10 and v2.66.0 (pydantic-ai, pydantic-ai-slim).VercelAIAdapter or AGUIAdapter. Fixed in v1.107.10 and v2.66.0 (pydantic-ai, pydantic-ai-slim).s3:// object or uploaded file with the application's credentials. You are affected if tool results can contain data third parties control, that history is stored and reloaded or carried by Temporal, DBOS or Prefect durable execution, and your model or its provider fetches or resolves such files; the advisory lists which do. Fixed in v1.107.10 and v2.66.0 (pydantic-ai, pydantic-ai-slim).allowed_domains on the local web-fetch tool looked a refused hostname up in DNS before rejecting it, so data encoded in the hostname could reach that domain's nameserver. Domain lists are now checked before resolution. You are affected only if you rely on such an allowlist while the model processes content untrusted parties can influence. Fixed in v1.107.10 and v2.66.0 (pydantic-ai, pydantic-ai-slim).Full Changelog: v1.107.9...v1.107.10
One column per month.