- Home
- Releases
- Pydantic AI
- 2.70.0
Pydantic AI 2.70.0 release notes
Pydantic AI 2.70.0 was released on November 17, 2026. The latest version is 2.76.0.
Release notes
What's Changed
🛡️ Security
- GHSA-m4cr-m4qc-9hh3 (high): With
strip_ansi=True, Pydantic AI Harness'sToolOutputLimitscapability removed ANSI escape sequences with a pattern that took time quadratic in the length of a line, so a tool result of a few hundred kilobytes with many unterminated escape sequences could occupy the event loop for tens of seconds to minutes. You are affected if you setstrip_ansi=True(namedOverflowingToolOutputbefore 0.13.0) and run tools whose output an attacker can influence. Fixed inpydantic-ai-harness0.70.0. - GHSA-5m5q-5qj4-gx9h (high): The
jwtpattern in Pydantic AI Harness's secret redaction backtracked in time quadratic in the length of the text it scanned, so a few hundred kilobytes of crafted text could occupy the event loop for tens of seconds to minutes. You are affected if you useredact_secretsorsecret_data()with thejwtpattern, which is included by default, on text an attacker can influence. The fixed pattern no longer matches a JWT whose header segment contains-eyJ. Fixed inpydantic-ai-harness0.70.0.
⚠️ Compatibility Notes
- Forward
service_tierto xAI and record the served tier inprovider_detailsby @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/13524 - Add
huggingface_logprobsandhuggingface_top_logprobstoHuggingFaceModelSettingsand return logprobs inprovider_detailsby @LHMQ878 in https://github.com/pydantic/pydantic-ai/pull/6855 - Let
Skillsread a loaded skill's bundled files withread_files=True, and substitute${SKILL_DIR}placeholders by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/13678 - Let a harness
SpendLimitsBudgetresolve itsusd/tokensceiling per scope from the run context by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/13644 - [voice-authority] Add
CapabilityPart, a request part for what a capability tells the model, rendered by the framework before any model sees it by @DouweM in https://github.com/pydantic/pydantic-ai/pull/11935 - Judge file input by media type with
supported_image_media_types,supported_audio_media_typesandsupported_video_media_typesby @DouweM in https://github.com/pydantic/pydantic-ai/pull/12419 - Skip
node_modules,.venvand other package directories inRepoContextnested traversal withnested_excludeby @DouweM in https://github.com/pydantic/pydantic-ai/pull/13103 - Fix
OpenAIChatModelsending Responses reasoning item ids as assistant-message fields inautothinking mode by @pydanty in https://github.com/pydantic/pydantic-ai/pull/12136 - Run
AnthropicModel's expired-container and stale-thinking-block retries for a status a retrying transport gave up on, and raiseModelHTTPErrorfor one fromOpenAIResponsesModel.compact_messagesby @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/13571 - Raise
ModelRequestRejectedErrorbeforeOpenAIChatModelsends tools to GPT-6 models with reasoning on by @pydanty in https://github.com/pydantic/pydantic-ai/pull/12264 - Fix Groq JSON output and reasoning flags, and raise
UserErrorforNativeOutputwith function tools onGroqModelby @pydanty in https://github.com/pydantic/pydantic-ai/pull/12667 - Run harness
FileSystemandShelltools on Azure Durable Task and Render by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/12421 - Fall back to
'auto'or raiseModelRequestRejectedErrorfor forced tool choice on OpenRouter'sqwen/qwen3.8-flash, which rejects forcing while reasoning by @pydanty in https://github.com/pydantic/pydantic-ai/pull/12262 - Re-run
get_instructionsandget_model_settingsfor the model that serves aModelFallbackattempt by @DouweM in https://github.com/pydantic/pydantic-ai/pull/13679
🚀 Features
- Forward
service_tierto xAI and record the served tier inprovider_detailsby @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/13524 - Let
PlaywrightBrowserprovision its CDP endpoint per run and attach to the default context by @NickAnthony in https://github.com/pydantic/pydantic-ai/pull/13555 - Add
huggingface_logprobsandhuggingface_top_logprobstoHuggingFaceModelSettingsand return logprobs inprovider_detailsby @LHMQ878 in https://github.com/pydantic/pydantic-ai/pull/6855 - Let a parent check on a running background delegation with
check_taskandDelegationTasks.snapshot()by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/13647 - Let
Skillsread a loaded skill's bundled files withread_files=True, and substitute${SKILL_DIR}placeholders by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/13678 - Add
StreamGuardrailto screen each streamed text, thinking and tool-call part before the caller sees it by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/13667 - Let a harness
SpendLimitsBudgetresolve itsusd/tokensceiling per scope from the run context by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/13644 - Add
PruneToolResultsso the model can replace a tool result it just received with a summary by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/13634 - Let
PostgresMemoryStoreprefix filters use an index, and keep nested scopes out of theMemoryfile listing withChildListingMemoryStoreby @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/13685 - Resume a finished sub-agent task from
message_taskby @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/13672 - Record each flagged
PromptInjectionDefenderverdict as aprompt_injection flaggedspan by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/13736 - Add
SubAgent(on_model_error=)to choose retry or return for a failed sub-agent separately fromon_failureby @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/13738 - [voice-authority] Add
CapabilityPart, a request part for what a capability tells the model, rendered by the framework before any model sees it by @DouweM in https://github.com/pydantic/pydantic-ai/pull/11935 - Add
ToolSearchtools selector for pre-search deferral by @pydanty in https://github.com/pydantic/pydantic-ai/pull/13139 - Add
register_workflowsto TemporalAgentPluginso activity-only workers can skip child workflow registration by @DouweM in https://github.com/pydantic/pydantic-ai/pull/13338 - Judge file input by media type with
supported_image_media_types,supported_audio_media_typesandsupported_video_media_typesby @DouweM in https://github.com/pydantic/pydantic-ai/pull/12419 - Add
RetryOnModelErrorscapability to retry the same model on transient model API errors by @DouweM in https://github.com/pydantic/pydantic-ai/pull/11932 - Skip
node_modules,.venvand other package directories inRepoContextnested traversal withnested_excludeby @DouweM in https://github.com/pydantic/pydantic-ai/pull/13103 - Wait a model error's
retry_afterdurably before retrying a model request on the AWS Lambda, Azure Durable Task, Absurd and pgtask durability capabilities by @DouweM in https://github.com/pydantic/pydantic-ai/pull/13283 - Add
ToolDefinition.durableto run a tool outside its durable unit on every durable execution engine by @DouweM in https://github.com/pydantic/pydantic-ai/pull/13214 - Add OpenAI
gpt-6.2-solandgpt-6.2-astramodel support by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/13760 - Give
AgentRunErrorthe failed run'sconversation, and addcapture_run_conversation(), so a failed turn can be stored by @DouweM in https://github.com/pydantic/pydantic-ai/pull/12324
🐛 Bug Fixes
- Fix
OpenAIChatModelsending Responses reasoning item ids as assistant-message fields inautothinking mode by @pydanty in https://github.com/pydantic/pydantic-ai/pull/12136 - End the ElevenLabs Agents response a malformed frame closes, instead of merging later replies into it by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/13611
- Run
AnthropicModel's expired-container and stale-thinking-block retries for a status a retrying transport gave up on, and raiseModelHTTPErrorfor one fromOpenAIResponsesModel.compact_messagesby @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/13571 - Raise
ModelRequestRejectedErrorbeforeOpenAIChatModelsends tools to GPT-6 models with reasoning on by @pydanty in https://github.com/pydantic/pydantic-ai/pull/12264 - Turn the
reasoningfield ofHuggingFaceModelresponses intoThinkingParts by @pydanty in https://github.com/pydantic/pydantic-ai/pull/10910 - Price non-ASCII text and encoded runs conservatively in the harness compaction token estimate by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/13620
- Wait for a pending parallel
InputGuardrailverdict beforeDetectLoopsstops a streamed request, and check long parts in linear time by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/13682 - Fix Groq JSON output and reasoning flags, and raise
UserErrorforNativeOutputwith function tools onGroqModelby @pydanty in https://github.com/pydantic/pydantic-ai/pull/12667 - Check model-written
pin(source='model')bodies for lookalike frames by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/13630 - Run harness
FileSystemandShelltools on Azure Durable Task and Render by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/12421 - Spill each
ToolOutputLimitscall separately when one run reuses atool_call_idby @gouyu-hou in https://github.com/pydantic/pydantic-ai/pull/12677 - Read
PydanticAIDocsremote pages at the installedpydantic_airelease tag instead ofmainby @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/13737 - Fall back to
'auto'or raiseModelRequestRejectedErrorfor forced tool choice on OpenRouter'sqwen/qwen3.8-flash, which rejects forcing while reasoning by @pydanty in https://github.com/pydantic/pydantic-ai/pull/12262 - Preserve Cohere
tool_planin message history and replay it on follow-up requests by @pydanty in https://github.com/pydantic/pydantic-ai/pull/13148 - Accept any task ID in
DelegationTasks.savewhen the owner has nodirectoryby @DouweM in https://github.com/pydantic/pydantic-ai/pull/13418 - Re-run
get_instructionsandget_model_settingsfor the model that serves aModelFallbackattempt by @DouweM in https://github.com/pydantic/pydantic-ai/pull/13679 - Cache uploaded documents per
XaiModelinstance by @pydanty in https://github.com/pydantic/pydantic-ai/pull/12485 - Fix xAI
DocumentUrlupload file names using downloaded media type extensions by @pydanty in https://github.com/pydantic/pydantic-ai/pull/12369 - Process spilled payloads in chunks in
read_tool_result, and keepRepoContextinstruction files under a linked directory inside the scanned directory by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/13595 - Raise
IncompleteToolCallright away when the token limit cuts off an output tool call, instead of retrying by @DouweM in https://github.com/pydantic/pydantic-ai/pull/13125 - Answer tool results and end the response after an unreadable or id-less OpenAI Realtime
response.doneby @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/13701 - Drop
stop_sequenceswith a warning on Bedrock Converse models that reject it by @DouweM in https://github.com/pydantic/pydantic-ai/pull/13762 - List valid ids for unknown
load_capabilityids and make loads of already-active capabilities a no-op by @Naeemeh146 in https://github.com/pydantic/pydantic-ai/pull/11937 - Include docstring admonition sections and whole annotated Returns sections in tool descriptions by @pydanty in https://github.com/pydantic/pydantic-ai/pull/12548
- Make the
CodeModespeculation scan of streamed code linear in its length by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/13697 - Drain the start-up readiness waiter inside the
try, so a cancelled run on Python 3.11 doesn't leave itswrap_runtask pending by @DouweM in https://github.com/pydantic/pydantic-ai/pull/13725 - Replay every input field of Anthropic tool search calls, so thinking after a search stays valid by @DouweM in https://github.com/pydantic/pydantic-ai/pull/13763
- Send a tool-returned video on OpenRouter only to models whose profile reads video, so the rest get a note instead of a 404 by @DouweM in https://github.com/pydantic/pydantic-ai/pull/13219
📦 Dependencies
- Cap provider SDK extras below the next major we haven't tested by @DouweM in https://github.com/pydantic/pydantic-ai/pull/13316
New Contributors
- @NickAnthony made their first contribution in https://github.com/pydantic/pydantic-ai/pull/13555
- @Naeemeh146 made their first contribution in https://github.com/pydantic/pydantic-ai/pull/11937
Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.69.0...v2.70.0
Source: GitHub release v2.70.0