Packages
Pydantic AI v2.77.0 & v2.74.0: 6 Security Fixes, Breaking Changes & Upgrade Guide
Between November 24 and November 27, 2026, Pydantic shipped four rapid releases—culminating in pydantic-ai v2.77.0—that patch 6 GHSA/CVE vulnerabilities across PlaywrightBrowser, OpenTelemetry tracing, and online evals while introducing SQLite/Postgres/MongoDB session stores and history compaction hooks. Here is what changed, which breaking API diffs to watch, and how to upgrade safely.
7 min read
Pydantic AI v2.77.0 & v2.74.0: 6 Security Fixes, Breaking Changes & Upgrade Guide
Executive Summary
- Featured packages & exact versions:
pydantic-ai(v2.77.0, released November 27, 2026 on PyPI and GitHub Releases), alongside companion packagespydantic-ai-slim(v2.77.0),pydantic-ai-harness(v0.74.0+), andpydantic-evals(v2.74.0/v1.107.11LTS). - Runtime, license & verification date: MIT License; requires Python 3.11+ (tested through Python 3.15). All version numbers, CVEs, and download figures in this guide are verified as of December 1, 2026.
- AI & agent relevance: Pydantic AI provides typed structured outputs, multi-provider model routing, MCP capabilities, and durable execution across nine engines (
Temporal,DBOS,Prefect,Restate,AWS Lambda,Airflow,Absurd,pgtask,Azure Durable Task). - Primary upgrade takeaway: Teams running
pydantic-ai2.58.0–2.73.0orpydantic-ai-harness0.24.0–0.73.0should upgrade immediately to pick up 6 GHSA security fixes shipped inv2.74.0, while auditingv2.75.0–v2.77.0breaking changes around stream completion states, 1-indexed file reads, andValueErrorcost checks.
Adoption Telemetry & Version Changelog
According to pepy.tech (checked late November 2026), pydantic-ai has accumulated 218,833,710 total downloads on PyPI, including 7,028,543 downloads in the last 30 days. Independent ecosystem tracking by Blocksize (published November 28, 2026) and PythonResources (published November 14, 2026) notes that PyPI download totals include CI/CD rebuilds and transitive installs, and that Pydantic AI downloads fluctuated significantly across 2026 (20.5M/month in August 2026 per Kernel vs. ~7.0M/30d in late November 2026) as teams shifted between pydantic-ai, pydantic-ai-slim, and vendor SDKs.
Four-Day Release Sprint (v2.74.0 to v2.77.0)
v2.74.0&v1.107.11(November 24, 2026): Patched 6 GHSA security advisories (5with assigned CVEs), addedpydantic_ai.computer_use(ComputerTool) andComputerUse()harness desktop support across Docker, Daytona, E2B, Modal, Kubernetes, and OpenSandbox, introducedCDPBrowser, and updatedGPT-6.2prompt caching behavior.v2.75.0(November 25, 2026): Lowered workspace instruction authority inRepoContext,Skills, andMemorybelow'operator', lowered MCP capability instructions viawith_authority(), addedModelEmptyResponseError/ModelInvalidResponseErrorfallback support, and adjustedgemini-2.5-flashthinking_budget=128ahead of Google's December 1, 2026 reroute togemini-3.5-flash-lite.v2.76.0(November 26, 2026): AddedGoogleInteractionsModel,CodeMode(allow_final_output=True),UpdateToolsfor realtime sessions,DeprecatedModelWarningforgemini-2.5-pro/gemini-2.5-flash, and changedFileSystemToolset.read_file(..., offset=N)to 1-indexed offsets (offset=0now raises).v2.77.0(November 27, 2026): Added SQLite, Postgres, and MongoDB backends forConversationStore(renamingSqliteConversationStoretoSqliteSessionStore), addedcompact_history()andRunContext.request_compaction()withCompactionStartEvent/CompactionEndEvent, introducedthinking_summary, and raisedgenai-prices>=0.2.4for Gemini 4 Hydrogen and Carbon pricing.
Security Patches, Breaking Changes & Internals
The most urgent reason to upgrade from any pre-2.74.0 release is the batch of 6 GHSA advisories resolved in v2.74.0 (and backported where applicable to pydantic-evals 1.107.11), independently summarized in Tim McAllister's AI Vulnerability Watch (November 25, 2026).
Security Advisories Patched in v2.74.0
| Advisory / CVE | Severity | Affected Package & Versions | Root Cause & Risk | Fixed Version |
|---|---|---|---|---|
GHSA-wm3r-gc4c-q7qg (CVE-2026-136639) |
Medium | pydantic-ai-harness (<=0.73.0) |
PlaywrightBrowser private-address block did not refuse IPv6 site-local (fec0::/10) |
pydantic-ai-harness 0.74.0 |
GHSA-p2q8-3252-77c3 (CVE-2026-136640) |
Medium | pydantic-ai-harness (0.24.0–0.73.0) |
IPv6 transition forms (NAT64 embedded metadata, ISATAP) bypassed private-address block | pydantic-ai-harness 0.74.0 |
GHSA-g87v-g79r-whvj (CVE-2026-136638) |
Medium | pydantic-ai-harness (0.24.0–0.73.0) |
Backslash in URL query parsed as empty host, bypassing allowed_domains/blocked_domains |
pydantic-ai-harness 0.74.0 |
GHSA-mj96-6529-3cpf |
Medium | pydantic-ai-harness (<=0.73.0) |
PlaywrightBrowser egress policy omitted WebRTC, WebTransport, WebSocketStream, and FedCM |
pydantic-ai-harness 0.74.0 |
GHSA-gm2p-369w-rcgv (CVE-2026-136642) |
Medium | pydantic-ai / pydantic-ai-slim (2.58.0–2.73.0) |
OpenTelemetry spans recorded ElevenLabs secret__ dynamic variables & extra body even with include_content=False |
pydantic-ai 2.74.0 |
GHSA-7xcv-6766-v6v5 (CVE-2026-136643) |
Medium | pydantic-evals |
Inbound OpenTelemetry baggage could overwrite unset gen_ai.evaluation.result attributes (error.type, score.value) |
pydantic-evals 2.74.0 & 1.107.11 |
(Note: Two earlier high-severity ReDoS flaws in ToolOutputLimits strip_ansi=True [GHSA-m4cr-m4qc-9hh3] and JWT secret redaction [GHSA-5m5q-5qj4-gx9h] were also patched in pydantic-ai-harness 0.70.0 on November 17, 2026.)
Breaking API Diffs & Behavioral Shifts (v2.74.0–v2.77.0)
flowchart LR
A[Pre-2.74.0 App] --> B{Audit Breaking Diffs}
B --> C[stream_response: state == 'incomplete' on truncated streams]
B --> D[cost: catches ValueError instead of AssertionError]
B --> E[FileSystemToolset: read_file offset is 1-indexed]
B --> F[ConversationStore: SqliteSessionStore + Postgres/MongoDB]
C --> G[Upgrade to pydantic-ai 2.77.0]
D --> G
E --> G
F --> GBefore bumping pyproject.toml, check these five breaking or behavioral changes documented in the Pydantic AI GitHub Releases:
- Truncated stream state (
v2.77.0,#14086): The finalstream_response()yield now reportsstate='incomplete'when an Anthropic, Google, or OpenAI Responses stream ends before its terminal event. Code checkingresponse.state != 'incomplete'to detect the final chunk—orstate == 'complete'to detect stream end—must be updated. cost()exception type (v2.77.0,#14715):ModelResponse.cost(),EmbeddingResult.cost(), andImageGenerationResult.cost()now raiseValueError('Model name is required to calculate price')instead ofAssertionError.- 1-indexed
FileSystemToolset.read_file(v2.76.0,#13250): Passingoffset=0now raises an error; update any Python calls fromoffset=Ntooffset=N + 1. - In-memory compaction history (
v2.76.0,#13211): Carryingresult.conversationinto the next run withSummarizingCompactionorRelevanceCompactionnow re-summarizes the full history each run. Passresult.all_messages()asmessage_history=to carry compacted history forward. - Strict
GPT-5.4/GPT-5.6tool validation (v2.77.0,#14887): Sending tools with reasoning enabled onOpenAIChatModelforGPT-5.4orGPT-5.6now raisesModelRequestRejectedErrorclient-side before the HTTP request, rather thanModelHTTPError(400) from the provider.
Updated Usage Example (v2.77.0 Compaction & Error Handling)
from pydantic_ai import Agent, ModelRequestRejectedError
from pydantic_ai.capabilities import MCP
agent = Agent(
"openai:gpt-6.1-sol",
instructions="Verify outputs against schema constraints.",
capabilities=[MCP("https://internal.example.com/mcp")],
)
try:
result = agent.run_sync("Summarize the latest deployment status.")
try:
estimated_cost = result.response.cost()
except ValueError:
estimated_cost = None
# Carry compacted history forward via all_messages()
next_history = result.all_messages()
except ModelRequestRejectedError as exc:
print(f"Client-side request validation failed: {exc}")
Ecosystem Comparison & Upgrade Checklist
How does pydantic-ai v2.77.0 stack up against the other leading Python agent frameworks measured in Blocksize's November 28, 2026 PyPI/GitHub study?
| Package / SDK | Verified Latest / Status (Late Nov 2026) | 30-Day PyPI Downloads | License & Runtime | MCP & Durability Support | Primary Trade-Off |
|---|---|---|---|---|---|
pydantic-ai |
v2.77.0 (Nov 27, 2026) |
7.03M (pepy.tech) |
MIT, Python >=3.11 |
Native MCP capability; 9 durable engines |
Smaller ecosystem than LangGraph; rapid minor-version churn |
langgraph |
v1.0+ line |
61.3M (Blocksize) |
MIT |
langchain-mcp-adapters; built-in graph checkpointer |
Steeper learning curve; more boilerplate for simple loops |
claude-agent-sdk |
0.2.189 (Nov 24, 2026, PyPI) |
40.0M (Blocksize) |
MIT, Python >=3.10 |
Native MCP & bundled Claude Code CLI (~178 MB wheel) |
Built for Claude models; other providers require a gateway |
openai-agents |
0.26.0 (Nov 24, 2026, GitHub) |
20.3M (Blocksize) |
MIT, Python >=3.10 |
MCP v2 Streamable HTTP; ResumableSession |
Thin orchestration; state management largely DIY |
Safe Production Upgrade Checklist
- Pin exact versions in
pyproject.toml: Upgrade topydantic-ai==2.77.0(orpydantic-ai-slim==2.77.0),pydantic-ai-harness>=0.74.0, andpydantic-evals>=2.74.0(or1.107.11if staying on1.x). - Audit
PlaywrightBrowser& OTel setups: If you ranpydantic-ai2.58.0–2.73.0with ElevenLabs realtime tracing, rotate anysecret__credentials that may have been logged in historical spans, and verify whether any agent relies on WebRTC/WebSocketStream insidePlaywrightBrowser(disabled by default in0.74.0+). - Grep for breaking patterns: Run
grep -rn "read_file(.*offset" .to convert 0-indexed offsets to 1-indexed, replaceexcept AssertionErroraround.cost()withValueError, and checkstream_response()consumers forstate == 'incomplete'. - Drain durable runs before upgrading: Because
v2.75.0andv2.77.0change recordedrealpathcalls andwith_authority()MCP framing, let in-flight Temporal or DBOS workflows finish (or deploy under a new worker version) before rolling out2.77.0.
Frequently Asked Questions (FAQ)
What is the latest version of pydantic-ai?
As of December 1, 2026, the latest stable release on PyPI and GitHub Releases is pydantic-ai 2.77.0, published on November 27, 2026. It requires Python 3.11 or newer and is licensed under the MIT License.
Which pydantic-ai versions are affected by the v2.74.0 security advisories?
The six GHSA advisories patched in v2.74.0 affect pydantic-ai-harness <=0.73.0 (PlaywrightBrowser IPv6, NAT64, backslash-query, and WebRTC/WebSocketStream egress bypasses), pydantic-ai / pydantic-ai-slim 2.58.0–2.73.0 (ElevenLabs realtime secret logging in OpenTelemetry spans), and pydantic-evals prior to 2.74.0 / 1.107.11 (OpenTelemetry baggage attribute injection).
Do I need to upgrade if I only use pydantic-evals on the 1.x branch?
Yes, if you run online evaluations with OpenTelemetry baggage propagation enabled. The maintainer backported the fix for GHSA-7xcv-6766-v6v5 (CVE-2026-136643) to pydantic-evals 1.107.11 on November 24, 2026.
How does pydantic-ai compare to claude-agent-sdk and langgraph in install size and lock-in?
pydantic-ai is lightweight (10.6 kB wheel for the meta-package, MIT license) and model-agnostic across OpenAI, Anthropic, Google, Bedrock, and local models, whereas claude-agent-sdk 0.2.189 bundles the Claude Code CLI (165.6–178.2 MB per wheel) and targets Claude models. langgraph leads PyPI downloads (61.3M/30d) for explicit graph state machines, while pydantic-ai focuses on FastAPI-style type safety and composable capabilities.
Why did v2.75.0 change gemini-2.5-flash thinking_budget?
In v2.75.0 (#14414), Pydantic AI changed thinking=False on gemini-2.5-flash via the Gemini API from thinking_budget=0 to 128 ahead of Google's scheduled December 1, 2026 reroute to gemini-3.5-flash-lite, where sending a budget of 0 triggers an HTTP 400 error.
Sources
- Pydantic AI GitHub Releases (Updated November 27, 2026): Releases · pydantic/pydantic-ai (
v2.77.0,v2.76.0,v2.75.0,v2.74.0,v1.107.11) - PyPI Package Registry (Published November 27, 2026): pydantic-ai 2.77.0 · PyPI
- Tim McAllister — AI Vulnerability and CVE Watch (Published November 25, 2026): AI vulnerability and CVE watch
- Blocksize AI Workshop (Published November 28, 2026): AI Agent Frameworks 2026: Claude Agent SDK, OpenAI Agents SDK, LangGraph and CrewAI by the Numbers
- pepy.tech PyPI Telemetry (Checked November 2026): pydantic-ai · 218.8M downloads on PyPI