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.

By 0xScorPionSon

7 min read

Pydantic AI v2.77.0 & v2.74.0: 6 Security Fixes, Breaking Changes & Upgrade Guide

Pydantic AI v2.77.0 security fixes, MCP validation, and durable execution infographic

Executive Summary

  • Featured packages & exact versions: pydantic-ai (v2.77.0, released November 27, 2026 on PyPI and GitHub Releases), alongside companion packages pydantic-ai-slim (v2.77.0), pydantic-ai-harness (v0.74.0+), and pydantic-evals (v2.74.0 / v1.107.11 LTS).
  • 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-ai 2.58.0–2.73.0 or pydantic-ai-harness 0.24.0–0.73.0 should upgrade immediately to pick up 6 GHSA security fixes shipped in v2.74.0, while auditing v2.75.0–v2.77.0 breaking changes around stream completion states, 1-indexed file reads, and ValueError cost 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 (5 with assigned CVEs), added pydantic_ai.computer_use (ComputerTool) and ComputerUse() harness desktop support across Docker, Daytona, E2B, Modal, Kubernetes, and OpenSandbox, introduced CDPBrowser, and updated GPT-6.2 prompt caching behavior.
  • v2.75.0 (November 25, 2026): Lowered workspace instruction authority in RepoContext, Skills, and Memory below 'operator', lowered MCP capability instructions via with_authority(), added ModelEmptyResponseError / ModelInvalidResponseError fallback support, and adjusted gemini-2.5-flash thinking_budget=128 ahead of Google's December 1, 2026 reroute to gemini-3.5-flash-lite.
  • v2.76.0 (November 26, 2026): Added GoogleInteractionsModel, CodeMode(allow_final_output=True), UpdateTools for realtime sessions, DeprecatedModelWarning for gemini-2.5-pro / gemini-2.5-flash, and changed FileSystemToolset.read_file(..., offset=N) to 1-indexed offsets (offset=0 now raises).
  • v2.77.0 (November 27, 2026): Added SQLite, Postgres, and MongoDB backends for ConversationStore (renaming SqliteConversationStore to SqliteSessionStore), added compact_history() and RunContext.request_compaction() with CompactionStartEvent / CompactionEndEvent, introduced thinking_summary, and raised genai-prices>=0.2.4 for 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 --> G

Before bumping pyproject.toml, check these five breaking or behavioral changes documented in the Pydantic AI GitHub Releases:

  1. Truncated stream state (v2.77.0, #14086): The final stream_response() yield now reports state='incomplete' when an Anthropic, Google, or OpenAI Responses stream ends before its terminal event. Code checking response.state != 'incomplete' to detect the final chunk—or state == 'complete' to detect stream end—must be updated.
  2. cost() exception type (v2.77.0, #14715): ModelResponse.cost(), EmbeddingResult.cost(), and ImageGenerationResult.cost() now raise ValueError('Model name is required to calculate price') instead of AssertionError.
  3. 1-indexed FileSystemToolset.read_file (v2.76.0, #13250): Passing offset=0 now raises an error; update any Python calls from offset=N to offset=N + 1.
  4. In-memory compaction history (v2.76.0, #13211): Carrying result.conversation into the next run with SummarizingCompaction or RelevanceCompaction now re-summarizes the full history each run. Pass result.all_messages() as message_history= to carry compacted history forward.
  5. Strict GPT-5.4 / GPT-5.6 tool validation (v2.77.0, #14887): Sending tools with reasoning enabled on OpenAIChatModel for GPT-5.4 or GPT-5.6 now raises ModelRequestRejectedError client-side before the HTTP request, rather than ModelHTTPError (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

  1. Pin exact versions in pyproject.toml: Upgrade to pydantic-ai==2.77.0 (or pydantic-ai-slim==2.77.0), pydantic-ai-harness>=0.74.0, and pydantic-evals>=2.74.0 (or 1.107.11 if staying on 1.x).
  2. Audit PlaywrightBrowser & OTel setups: If you ran pydantic-ai 2.58.0–2.73.0 with ElevenLabs realtime tracing, rotate any secret__ credentials that may have been logged in historical spans, and verify whether any agent relies on WebRTC/WebSocketStream inside PlaywrightBrowser (disabled by default in 0.74.0+).
  3. Grep for breaking patterns: Run grep -rn "read_file(.*offset" . to convert 0-indexed offsets to 1-indexed, replace except AssertionError around .cost() with ValueError, and check stream_response() consumers for state == 'incomplete'.
  4. Drain durable runs before upgrading: Because v2.75.0 and v2.77.0 change recorded realpath calls and with_authority() MCP framing, let in-flight Temporal or DBOS workflows finish (or deploy under a new worker version) before rolling out 2.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

  1. 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)
  2. PyPI Package Registry (Published November 27, 2026): pydantic-ai 2.77.0 · PyPI
  3. Tim McAllister — AI Vulnerability and CVE Watch (Published November 25, 2026): AI vulnerability and CVE watch
  4. Blocksize AI Workshop (Published November 28, 2026): AI Agent Frameworks 2026: Claude Agent SDK, OpenAI Agents SDK, LangGraph and CrewAI by the Numbers
  5. pepy.tech PyPI Telemetry (Checked November 2026): pydantic-ai · 218.8M downloads on PyPI

More on Packages

Packages

OpenClaw 2026.12.1-beta.3 (Dec 1, 2026): Email Trigger Auth, LanceDB Memory Fixes, and npm Gateway Hardening

Released December 1, 2026, OpenClaw 2026.12.1-beta.2 and beta.3 tighten security and Gateway stability across the MIT-licensed AI assistant npm package (395.5k GitHub stars). Key fixes include requiring authenticated sender mailboxes to match allowlisted addresses on email triggers (#206758), keeping webhook deliveries alive during crash-loop safe mode, and preventing Doctor lint from writing into LanceDB directories.

8 min read

Packages

Q-CTRL Fire Opal FTQC (Dec 1, 2026): fo-synth-core, Qiskit & CUDA-Q Clifford+T Compiler Packages

Released December 1, 2026 on GitHub and PyPI, Q-CTRL's Fire Opal FTQC Synthesizer ships as three modular Rust-backed Python packages—fo-synth-core, fo-synth-qiskit, and fo-synth-cudaq—to compile single- and two-qubit unitaries into Clifford+T sequences. In Q-CTRL's benchmarks, the synthesizer cuts T-gate counts by over 3x compared to RSGridSynth and runs up to 96x faster than PyGridSynth.

8 min read

Packages

MuJoCo 4.1.0 (Dec 1, 2026): Portable 4-Wide SIMD, 2.5x Hand Speedups, and Split Python Packaging

Released December 1, 2026, MuJoCo v4.1.0 replaces its legacy AVX-only double-precision BLAS header with a portable 4-wide SIMD layer (mjtNum4) spanning AVX/FMA, ARM NEON, and WebAssembly SIMD128. Across DeepMind's mjbench suite, CPU stepping averages ~1.4x faster—reaching ~2.1x on ALOHA and ~2.5x on Shadow Hand (ARM64)—alongside split Python packaging (mujoco-core vs. mujoco-studio).

9 min read

Tell us what is not working

A thirty-minute call, no deck and no obligation. You will leave with a straight answer about whether this is worth building - including if that answer is no.

Start a project

Direct line

hello@codebumble.net
Dhaka, Bangladesh  :   local timeCalls in English or Bangla