Skip to content

Update pydantic-ai-slim requirement from <2,>=1.0 to >=1.0,<3 in /backend - #17

Open
dependabot[bot] wants to merge 1 commit into
mac-local-mlx-q4from
dependabot/pip/backend/pydantic-ai-slim-gte-1.0-and-lt-3
Open

dependabot[bot] wants to merge 1 commit into
mac-local-mlx-q4from
dependabot/pip/backend/pydantic-ai-slim-gte-1.0-and-lt-3

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Nov 11, 2026

Copy link
Copy Markdown

Updates the requirements on pydantic-ai-slim to permit the latest version.

Release notes

Sourced from pydantic-ai-slim's releases.

v2.66.0 (2026-11-04)

What's Changed

🛡️ Security

  • 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 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 v2.66.0 and v1.107.10 (pydantic-ai, pydantic-ai-slim).
  • GHSA-mfx5-pc32-32m8 (high): The private_key pattern in Pydantic AI Harness's secret redaction backtracked exponentially on crafted text, so a few hundred characters that begin like a private key could occupy the event loop for minutes or longer. You are affected if you use redact_secrets or secret_data() with the private_key pattern, which is included by default, on text an attacker can influence. Fixed in pydantic-ai-harness 0.66.0.
  • GHSA-5fj9-5pjw-vpwc (medium): The cloud-metadata blocklist that URL downloads check did not include Tencent Cloud's instance metadata address 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 v2.66.0 and v1.107.10 (pydantic-ai, pydantic-ai-slim).
  • GHSA-jp94-mmr3-2pvv (medium): With OpenTelemetry instrumentation enabled for embedding models, embedding spans recorded the 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 v2.66.0 and v1.107.10 (pydantic-ai, pydantic-ai-slim). Restrict access to historical traces and rotate credentials they exposed.
  • GHSA-7494-925c-rrxv (medium): For models whose profile requires tool schemas without $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 v2.66.0 and v1.107.10 (pydantic-ai, pydantic-ai-slim).
  • GHSA-484x-x9m4-62cj (medium): Decision models (DecisionModel subclasses such as OpenAIDecisionsModel, and TypeSafeModel) resolved every $ref in a tool's argument schema again at each place it appears, so a small crafted schema could take exponential time and memory on the event loop. You are affected if you use a decision model from v2.46.0 onward with tools whose schemas an attacker can supply, most directly through an AG-UI endpoint. Fixed in v2.66.0 (pydantic-ai, pydantic-ai-slim).
  • GHSA-r879-rxgj-3g75 (medium): The Vercel AI and AG-UI adapters took time that grows with the square of the number of parts to load a submitted message, on the event loop, so a single request could delay other work in the same process. You are affected if you pass client-submitted conversations to VercelAIAdapter or AGUIAdapter. Fixed in v2.66.0 and v1.107.10 (pydantic-ai, pydantic-ai-slim).
  • GHSA-4cj4-hgwf-4hc4 (medium): When message history was serialized and loaded again, a tool result containing a JSON object in the serialized shape of one of Pydantic AI's file types was rebuilt as that file. A third party who controls data a tool returns could use this to make the application download a URL on its local network, or make the model provider read an 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, held on the server by a UI adapter, 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 v2.66.0 and v1.107.10 (pydantic-ai, pydantic-ai-slim).
  • GHSA-5ppx-9jq6-6pmw (low): allowed_domains on the local web-fetch tool, and PlaywrightBrowser egress policies whose allowlist bounds every request kind, 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 v2.66.0 and v1.107.10 (pydantic-ai, pydantic-ai-slim), and pydantic-ai-harness 0.66.0.
  • GHSA-mgmv-r532-pg36 (medium): An MCP capability configured with a server URL and no explicit id derived its identifier from the URL's hostname and last path segment, and the AG-UI and Vercel AI adapters sent that identifier to the frontend with MCP Apps tool results, so a credential in that segment could reach users of the chat frontend. This affects v2.57.0 up to but not including v2.60.0, and was fixed in v2.60.0; it is disclosed with this batch. Rotate MCP server credentials that were carried in the URL path.

⚠️ Compatibility Notes

🚀 Features

🐛 Bug Fixes

... (truncated)

Changelog

Sourced from pydantic-ai-slim's changelog.


description: "Pydantic AI upgrade guide and changelog: the breaking changes in each release, how to install V2, and the recommended path to migrate your code from V1."

Upgrade Guide

In September 2025, Pydantic AI reached V1 and committed to API stability: no changes that break your code until V2. V2 is now available, collecting the breaking and behavior changes that stability guarantee didn't allow. This guide is the canonical place to learn what's in V2, how to install it, and how to upgrade; for the guarantees behind these version numbers, see the Version Policy.

Deprecations

Functionality deprecated in a V2 release keeps working until V3, and using it raises a PydanticAIDeprecationWarning naming its replacement. Resolving these as they appear is the smooth path to the next major, the same way resolving V1's warnings was the smooth path to this one.

Deprecated in V2, to be removed in V3

  • Calling a [RunUsage][pydantic_ai.usage.RunUsage], as in V1's result.usage(), returns that same usage and warns. usage became a property in V2, and the call used to raise TypeError: 'RunUsage' object is not callable, which code that wraps usage accounting in except Exception turned into silently zero usage. Drop the parentheses: result.usage.
  • [RetryPromptPart][pydantic_ai.messages.RetryPromptPart] is deprecated in favor of the two parts it conflated: a retry that answers a tool call is that call's own [ToolReturnPart][pydantic_ai.messages.ToolReturnPart] with outcome='retried', and one that answers no tool call is a [RetryFeedbackPart][pydantic_ai.messages.RetryFeedbackPart]. The old part reached the model as bare user text in the second case, which the model couldn't tell from something a person wrote (#6404, #7799). Pydantic AI no longer emits it, and constructing one warns.
    • What keeps working: a 'retry-prompt' part in a serialized history loads as whichever of the two it always meant, and an instance your own code holds, including one handed back through [DeferredToolResults][pydantic_ai.tools.DeferredToolResults], is translated the same way before it reaches a model. The direct helpers send it in that new shape too. Calling [Model.request()][pydantic_ai.models.Model.request] or [Model.count_tokens()][pydantic_ai.models.Model.count_tokens] yourself skips that translation but still works: a tool-bound one goes out as that call's retried result, and a tool-less one as the user text it always rendered as. [sanitize_messages][pydantic_ai.messages.sanitize_messages] keeps client-returned retry feedback: it translates a tool-less one into the RetryFeedbackPart it always meant, keeps a 'validation_error' or 'model_retry' part as sent (it reaches the model fenced, in the user voice), and demotes a 'no_output' part, the one cause rendered in the system voice, to that same fenced, attributed user text, since a client can forge it; pass strip_system_prompts=False to keep a 'no_output' part as sent.
    • What you need to change: isinstance(part, RetryPromptPart) no longer matches, so match the two parts above instead. Each records why the retry happened, and which attempt it is against which limit, in a [RetryInfo][pydantic_ai.messages.RetryInfo] on its retry field, which tool spans also carry as pydantic_ai.tool.retry.* attributes. [ToolRetryError.tool_retry][pydantic_ai.exceptions.ToolRetryError] holds one of those two parts, so read tool_name off it only after checking for a ToolReturnPart.
    • What the model now sees: a tool retry carries the serialized validation errors or the ModelRetry message, with no N validation errors: header and no Fix the errors and try again. suffix. One that answers no call arrives in the voice its cause calls for: validation errors and a ModelRetry message in the user voice, inside a <validation_errors> or <retry_feedback> fence behind one line saying the application, not the user, is speaking, and the framework's fixed request for usable output in the system voice. On providers without a native tool error channel, a retried tool call's validation errors go in the {"error": ...} wrapper as a JSON array rather than as a string holding one, and Anthropic and Bedrock get them as one text block. Client-returned retry feedback is kept by [sanitize_messages][pydantic_ai.messages.sanitize_messages] and the UI adapters rather than stripped, and a 'no_output' part among it goes out as fenced user text rather than in the system voice. Retries in a history stored before upgrading are rendered the new way too, since rendering happens when each request goes out, so a conversation's first request after upgrading misses the provider's prompt cache from its first retry onward, once. A [decision model][pydantic_ai.models.decision.DecisionModel] judges a retried tool call as that call's tool_return, where it had a retry entry. On ag-ui-protocol below 0.1.11, [AGUIAdapter.dump_messages][pydantic_ai.ui.ag_ui.AGUIAdapter.dump_messages] now also warns on a run that retried its own output. See Retries.
    • Vercel AI dumps keep a request's part order: [VercelAIAdapter.dump_messages][pydantic_ai.ui.vercel_ai.VercelAIAdapter.dump_messages] now writes a ModelRequest as one UIMessage per run of same-role parts, in the order they were authored, instead of putting every system part first. This applies with no retries at all: a request holding an enqueued SystemPromptPart after its UserPromptPart now dumps as a user message followed by a system message, and positional message ids shift with it. The request's metadata rides on its last user message, or its last message when it has none.

Breaking Changes

Here's a filtered list of the breaking changes for each version to help you upgrade Pydantic AI.

v2.0.0 (2026-06-23)

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

v2.0.0b7 (2026-06-10)

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.

v2.0.0b6 (2026-06-04)

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:

... (truncated)

Commits
  • 7d1d3f0 Keep tool-returned mappings as mappings across message history round trips (#...
  • bc0b14f Ask again to enable a clai2 project plugin or project_hooks after the fil...
  • 4d369ad Record the requests tests send in tests/refactor_capture.py, so a refactor ...
  • ce4c9ae Bound the work of $ref inlining, decision-model fields, `MessagesBuilder.ad...
  • 0413314 Attribute douwebot inline comments to the head they were made on in `PR Revie...
  • c281f88 Fix a WarnOnCacheBusts test flake: record only the warnings its deprecation...
  • 6414dcf Bring 22 pydantic_ai message-history functions under the cognitive complexi...
  • 4946e2e Fix instrumented embedding spans missing the embeddings attribute when `inc...
  • dcaf866 Add Workspace.authority and AuthorityWorkspace for workspaces whose files...
  • 0301428 Close SqliteStepStore and SqliteMediaStore connections whose WAL switch f...
  • Additional commits viewable in compare view

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Updates the requirements on [pydantic-ai-slim](https://github.com/pydantic/pydantic-ai) to permit the latest version.
- [Release notes](https://github.com/pydantic/pydantic-ai/releases)
- [Changelog](https://github.com/pydantic/pydantic-ai/blob/main/docs/changelog.md)
- [Commits](pydantic/pydantic-ai@v1.0.0...v2.66.0)

---
updated-dependencies:
- dependency-name: pydantic-ai-slim
  dependency-version: 2.66.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added dependencies Pull requests that update a dependency file python Pull requests that update python code labels Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file python Pull requests that update python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants