Skip to content

Framework Update: Pydantic AI v2.71.0

Nov 20, 20265 min
TL;DRPydantic AI v2.71.0's biggest change is a batch of more than ten new harness primitives: Goal keeps a run going until it actually meets a defined completion check, WrapUpAtLimits and ReportRemainingBudget handle wrapping up before usage limits hit, and PermissionRule and RequireVerification turn permissions and verification into rules. The one breaking change is PeerNetwork being renamed to PeerConnection.

Look up & save

Loading dictionary…

中文版

Release Info

ItemValue
FrameworkPydantic AI
Versionv2.71.0
Previous versionv2.70.0
Release date2026-11-18
Release Notesv2.71.0
GitHubpydantic/pydantic-ai
Stars21.3k

Why this release matters

Last release (v2.70.0) was about fixing two security vulnerabilities; this one shifts the focus back to features, and it adds more primitives in one go than any recent release. Nearly all of them sit under the harness, and they share one theme: letting a long-running task that nobody is watching know how much budget it has left, when it should wrap up, and whether it should handle an error itself instead of letting the whole run silently fail or get cut off mid-task. Set alongside the sandboxing and security work covered in the v2.69.0 and v2.70.0 articles, this release fills in a different gap — an agent managing its own execution state — and across all three releases a single thread shows through: the harness is turning from "the shell that runs the agent" into "an execution environment the agent can query and depend on." The one breaking change is a class rename with a small blast radius.

Key changes

  • Goal: keeps an unattended run going until a caller-defined completion check passes, instead of stopping after a fixed number of turns → a long-running task can be set to stop only once it actually meets the goal, not once it hits a turn or token limit
  • WrapUpAtLimits: lets an agent produce a final answer when it's about to hit a usage limit, instead of raising UsageLimitExceeded outright → a long task no longer comes away with nothing usable just because it hit the limit
  • ReportRemainingBudget: reports the remaining usage limit and spend budget to the model before every call → the model itself can decide to wrap up early or compress its answer, rather than waiting for an external hard cutoff
  • PermissionRule: decides whether to allow, ask about, or deny a tool call or shell command by rule → permission logic no longer needs a pile of conditionals; a declarative rule set does the job
  • RequireVerification: sends a coding agent back to run its checks (tests, lint) when it tries to finish before verifying its own edits → stops output that looks done but was never actually verified from being treated as finished
  • ToolBridge: keeps the tool list fixed behind tool_search, tool_describe and tool_call, so it doesn't shift as the actual number of tools changes → when there are many tools, or they're added routinely, the prompt cache doesn't get invalidated just because the tool list changed
  • ReportToolErrors: sends an unhandled tool exception back to the model as a failed tool result instead of ending the run outright → a single tool error no longer wastes an entire long-running task
  • ReportStaleFiles: proactively tells the model when a workspace file it read has changed or been deleted, instead of letting it keep reasoning over stale content
  • LabelCrossModelHistory: flags which turns in a conversation's history came from a different model → when a new model picks up a long conversation, it knows which context wasn't its own
  • ModelRouter: routes requests within the same agent run to different models by rule → simple steps can go to a cheap model, reserving the expensive one for steps that actually need it

The diagram below groups this batch of new primitives into three categories, each with one representative example:

Pydantic AI v2.71.0's new harness primitives, by category
Pydantic AI v2.71.0's new harness primitives, by categoryThis release's harness additions fall into three categories — budget and wrap-up, permission and verification, and tools and context — each shown with one representative primitive; the full list is in the text above. Harness primitives 3 categories added in v2.71.0 Budget & wrap-up how much is left, when to stop Permission & verification allow, ask, or deny by rule Tools & context errors and staleness reported back Goal runs until it meets the goal PermissionRule allow / ask / deny ToolBridge fixed tool list

Simplified; each category shows only one representative primitive. See "Key changes" above for the complete list.

Breaking Changes

  • PeerNetwork is renamed to PeerConnection, and Peers(network) now joins an InMemoryPeerNetwork under the agent's name
    • Affected: multi-agent code that imports PeerNetwork directly or depends on that class name

There are no other breaking changes to existing call patterns this release; everything else is a new capability or an internal performance fix.

Migration Guide

Upgrading from 2.70.x to 2.71.0

pip install --upgrade pydantic-ai==2.71.0
# Old (<=2.70.x)
from pydantic_ai.multi_agent import PeerNetwork
network = PeerNetwork(agents=[agent_a, agent_b])

# New (2.71.0+)
from pydantic_ai.multi_agent import PeerConnection
network = PeerConnection(agents=[agent_a, agent_b])

The rest of this release's new harness primitives (Goal, PermissionRule, ReportRemainingBudget, and so on) are purely additive: they don't affect existing code unless you opt in, so a plain upgrade is all it takes.

Compared to other frameworks

The same week, CrewAI 1.15.44 shipped one single feature — saving files as versioned, shareable artifacts — and LangGraph 1.2.23 shipped bug fixes only, with no new features. Pydantic AI, by contrast, added over a dozen primitives in one release, all focused on an agent managing its own execution state. That's a different bet than CrewAI's role-based high-level API or LangGraph's fine-grained graph-level control: Pydantic AI is betting on whether an agent can run unattended for a long time, and actually reach its goal without going off the rails — and right now, no other framework has filled in that gap in this much detail.

Today's takeaway

I used to think the differences between frameworks were mostly about the development interface — declarative, graph-based, or role-based. Seeing Pydantic AI pack in over a dozen primitives that sound almost trivial on their own — Goal, ReportRemainingBudget, RequireVerification — made something click: once an agent genuinely has to run unattended for a long time, the real difference shifts from "how do you define the agent" to "can the agent itself tell how much longer it can run, and whether it's actually done." These primitives fill exactly that gap, and this is the clearest commitment to it I've seen from any framework so far.

References