Source · release
Pydantic AI 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
ModelFallbackcapability (also buildable from agent specs) moves to another model on failure, with a per-attemptprepare_model_requesthook,RetryModelRequest, andsticky=Trueto keep a conversation on the model that answered. A newfirst_event_timeoutsetting falls back when a stream never starts. BoxdSandbox: runsCoder,Shell,FileSystem, and other harness capabilities inside a boxd machine instead of the local host.ArtifactScanner: scansMemoryandSkillscontent 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_capabilityloads capabilities on demand;ModelResponse.model_idrecords which model answered. - Evals: plain functions work as evaluators; experiment spans record CI provenance
(OpenTelemetry
vcs.*andcicd.*attributes). - Compatibility:
json-repairis now optional (needed byCoderandRepairToolArguments);Codertools 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.