Skip to content
trendoviz

Pydantic AI adds agent controls, security fixes

Pydantic AI releases v2.69.0 through v2.71.0 expanded agent orchestration, tool governance and sandbox options, while also addressing two high-severity denial-of-service advisories in the harness. The sequence also renamed and reorganised several harness packages and capabilities, raising the maintenance cost of upgrades.

58 out of 100Emerging7D: Insufficient history ProvisionalPublished

Overview

Pydantic AI shipped three releases in three days: v2.69.0 on 2026-11-16, v2.70.0 on 2026-11-17 and v2.71.0 on 2026-11-18. The v2.69.0 and v2.71.0 release commits were signed with GitHub's verified signature [1][3]. The changes cluster around four areas: controlling what agents can do, routing models and peers, running tools in varied execution environments, and classifying failures so callers can react to them [1][2][3].

The harness received particular attention, including peer messaging, sandbox backends, permissions, budget reporting and deferred-tool approvals [1][3]. The v2.70.0 release also disclosed two high-severity advisories affecting pydantic-ai-harness, both fixed in harness version 0.70.0 [2].

Why it matters

The clearest pattern is a shift toward run-time controls rather than model access alone. v2.69.0 added DetectLoops, GraphBuilder.add_reachable() for opt-in recursive node registration, and Coder(autonomy=...) with trimmed default instructions [3]. v2.70.0 added StreamGuardrail to screen streamed text, thinking and tool-call parts before the caller sees them, RetryOnModelErrors for transient API errors, PruneToolResults, and a separate on_model_error policy for failed sub-agents [2]. v2.71.0 added PermissionRule to allow, ask about or deny tool calls and shell commands, ReportRemainingBudget, RequireVerification for coding agents, and DeferredToolRequests.validated_args so approvers can see the arguments a deferred call will run with [1].

For multi-agent workflows, peer messaging arrived in v2.69.0 and was extended in v2.71.0 so Peers(network) can join an InMemoryPeerNetwork under the agent's name [1][3]. v2.70.0 added the ability to resume a finished sub-agent task from message_task [2].

Error handling became more explicit across the sequence: v2.69.0 introduced ModelQuotaExceededError for Anthropic's tier spend cap and user-set spend limits, ModelContextWindowExceededError for Mistral 3059 prompt-too-long errors, and ModelHTTPError or ModelAPIError for gave-up transport statuses [3]. v2.71.0 added ModelTimeoutError for provider HTTP 408 responses [1].

Opportunities

  • Governed coding workflows. WindowsWorkspace, KubernetesSandbox, E2BSandbox(network=) and BoxdSandbox(secrets=) provide multiple execution targets, while RequireVerification can return a coding agent to its checks after an unverified edit [1][3].
  • Approval-based tool use. Deferred tool handling now exposes validated_args to approvers, and PermissionRule can ask about specific calls or shell commands [1].
  • Model routing and multi-agent services. ModelRouter routes agent runs, while peer networking and sub-agent task resumption support coordination across agents [1][2].
  • Hosted infrastructure integrations. Harness FileSystem and Shell tools gained support for Azure Durable Task and Render, and Skills can read bundled files with ${SKILL_DIR} substitution [2].
  • Audit-friendly histories. ToolBridge keeps the tool list fixed behind tool_search, tool_describe and tool_call so the prompt cache holds for large or changing tool sets, and PromptInjectionDefender verdicts are recorded as prompt_injection flagged spans [1][2].

The release notes do not show existing demand for these building blocks, so these remain technical options rather than validated market opportunities.

Risks

  • Harness denial-of-service exposure. GHSA-m4cr-m4qc-9hh3 described a quadratic-time ANSI escape-sequence removal pattern in ToolOutputLimits when strip_ansi=True was set, allowing attacker-influenced tool output of a few hundred kilobytes to occupy the event loop for tens of seconds to minutes [2]. GHSA-5m5q-5qj4-gx9h described quadratic-time backtracking in the jwt secret-redaction pattern used by redact_secrets or secret_data(), which could similarly block the event loop on attacker-influenced text [2]. Both were fixed in pydantic-ai-harness 0.70.0, but the notes do not state whether earlier harness versions were affected [2].
  • Compatibility churn. Renamed packages, capabilities and constants, plus the listed breaking RetryPromptPart change from v2.60.0, require migration work [1][3]. The notes do not say whether the RetryPromptPart change affects the main package or only harness usage [3].
  • Wider testing surface. New gateways, model variants, sandboxes and durability backends expand the combinations that teams must validate [1][2][3].
  • Secret-handling exposure. Shell(secret_env=) masks injected secrets in what tools return, and secret redaction is available, but the disclosed redaction advisory shows that these patterns require active maintenance [1][2].
  • Cost controls are unquantified. SpendLimits Budget resolves usd/tokens ceilings per scope from the run context, and ReportRemainingBudget reports remaining limits and spend budgets, but the release notes provide no pricing data or measured savings [1][2].

Context

Pydantic AI is a Python framework for building agents that work with multiple models and interfaces. Its harness layer adds capabilities for tool execution, workspaces, sandboxes and run governance, and it now includes capabilities for permissions, budgets, prompt-injection verdicts, secret masking and deferred-tool approvals [1][2].

The releases added support for GoogleModel variants Gemini 4 Hydrogen and Gemini 4 Neon, but the release notes do not describe the API surface of either identifier, so their behavioural differences are unknown [1][3]. Providers also expanded beyond direct vendor APIs: v2.71.0 added StavProvider for the Stav European inference gateway and Otari as an OpenAI-compatible gateway [1].

Several names and packages changed in the same period. DockerSandbox became DockerContainer with the old name retained as a deprecated alias, BubblewrapSandbox became BubblewrappedWorkspace, and harness subagents, filesystem and spend packages were renamed to their capability names [3]. PeerNetwork was renamed to PeerConnection, and the DEPRECATED_ANTHROPIC_MODELS constant was deprecated because Pydantic AI no longer uses it [1].

Known, claimed, inferred

Hypothesis: Across these three releases, Pydantic AI appears to be differentiating on operational control for agent runtimes rather than on model access alone. The evidence supports this through the addition of permission rules, stream screening, secret masking, budget reporting, loop detection, deferred-tool approvals with visible arguments, explicit failure categories and peer networking [1][2][3]. The release notes contain no adoption figures, benchmark results or independent evaluations, so this is a directional reading of the feature set rather than evidence of market traction.

Tool governance has also moved closer to the execution layer. Permissions can govern calls and shell commands, deferred approvals expose the arguments to be run, and stream guardrails can screen output before it reaches the caller [1][2]. Multi-agent coordination similarly gained explicit policy controls: separate handling of sub-agent model errors, resumable finished tasks, and labelled cross-model history [1][2].

Error classification appears to be a deliberate compatibility layer. Distinct exceptions now cover quota ceilings, context-window overflow, timeouts and gave-up transports, which lets callers respond by category rather than by parsing provider messages [1][3]. The evidence does not quantify how these classifications affect recovery rates.

The v2.70.0 advisories complicate the safety narrative. Both high-severity issues shared the same failure shape, quadratic-time pattern matching on attacker-influenced text that could block the event loop for tens of seconds to minutes, and both were fixed in pydantic-ai-harness 0.70.0 [2]. That pattern indicates that output-processing code became part of the runtime's security boundary [2].

Limitations & uncertainties

  • The release-note text for all three versions is truncated, so the complete feature and bug-fix lists are missing [1][2][3].
  • The notes contain no adoption figures, benchmark results, independent evaluations, pricing data or measured usage savings. Features such as ToolBridge, DetectLoops, ModelRouter and the sandbox options therefore cannot be compared for effectiveness or cost [1][2][3].
  • The API differences between Gemini 4 Hydrogen and Gemini 4 Neon are not described [1][3].
  • The advisories state impact and fixed versions for pydantic-ai-harness 0.70.0, but do not identify which earlier harness versions were affected [2].
  • It is not stated whether the v2.69.0 breaking RetryPromptPart change affects users of the main pydantic-ai package or only harness-related usage [3].
  • No deprecation timeline or roadmap is given for the renamed harness packages, capabilities and constants [1][3].
  • v2.71.0 is labelled "Latest" on its release page, but the evidence does not independently confirm that it was the current stable version at the latest retrieval date [1].

Evidence & sources

The key statements of this analysis, labeled by type, with the sources they rely on. Trendoviz does not run product tests.

  • Primary-source or vendor statementPydantic AI released v2.69.0, v2.70.0 and v2.71.0 on 2026-11-16, 2026-11-17 and 2026-11-18 respectively.[1][2][3]
  • Primary-source or vendor statementThe sequence added operational controls including DetectLoops, StreamGuardrail, PermissionRule, ReportRemainingBudget and deferred-tool approvals that expose validated arguments to approvers.[1][2][3]
  • Primary-source or vendor statementMulti-agent coordination gained peer messaging, an InMemoryPeerNetwork option for Peers, sub-agent error policy and resumption of finished sub-agent tasks.[1][2][3]
  • Primary-source or vendor statementv2.70.0 disclosed two high-severity advisories in pydantic-ai-harness, both involving quadratic-time processing of attacker-influenced text that could block the event loop, with fixes in harness 0.70.0.[2]
  • Primary-source or vendor statementThe releases introduced new sandbox and workspace backends including WindowsWorkspace, KubernetesSandbox, E2BSandbox(network=) and BoxdSandbox(secrets=), and renamed several harness packages and capabilities.[3]
  • HypothesisThese releases appear to position Pydantic AI around operational safety and harness capability rather than model access alone, although the release notes provide no adoption or performance measurements to confirm that direction.[1][2][3]

Sources

  1. 1
    pydantic/pydantic-ai v2.71.0 (2026-11-18)
    ●github.comretrieved Nov 19, 2026
  2. 2
    pydantic/pydantic-ai v2.70.0 (2026-11-17)
    ●github.comretrieved Nov 18, 2026
  3. 3
    pydantic/pydantic-ai v2.69.0 (2026-11-16)
    ●github.comretrieved Nov 18, 2026

Updates & corrections

  1. First published · published automatically after passing every check

Found an error? Report it.