Source · release

Pydantic AI v2.64.0

Author
Pydantic
Published
30 October 2026
Added
2 November 2026
Original
https://github.com/pydantic/pydantic-ai/releases/tag/v2.64.0

Summary

Pydantic AI 2.64.0 was released on 2026-10-30. Its main additions are a ModelFallback capability with per-attempt request hooks, a BoxdSandbox for running coding and shell capabilities in a remote machine, and security scanning of memory and skills. It also has several compatibility changes worth checking before upgrading.

Key points

  • Model fallback: the ModelFallback capability (also buildable from agent specs) moves to another model on failure, with a per-attempt prepare_model_request hook, RetryModelRequest, and sticky=True to keep a conversation on the model that answered. A new first_event_timeout setting falls back when a stream never starts.
  • BoxdSandbox: runs Coder, Shell, FileSystem, and other harness capabilities inside a boxd machine instead of the local host.
  • ArtifactScanner: scans Memory and Skills content for security issues.
  • Prompt caching: @agent.system_prompt(dynamic=True, on_change='append') appends changes instead of rewriting the cached prompt.
  • Harness: Reminder(scope='conversation') keeps reminders in history; RunContext.load_capability loads capabilities on demand; ModelResponse.model_id records which model answered.
  • Evals: plain functions work as evaluators; experiment spans record CI provenance (OpenTelemetry vcs.* and cicd.* attributes).
  • Compatibility: json-repair is now optional (needed by Coder and RepairToolArguments); Coder tools default to non-strict schemas (Coder(strict=True) to opt back in); stored response and container IDs are only sent to the endpoint that created them.
  • Upgrade with pip install -U "pydantic-ai==2.64.0".

Why it matters

Built-in fallback with a first-token timeout covers a common production failure (a provider that accepts the request but never streams), and scanning memory and skills targets a growing prompt-injection path for long-lived agents.