Skip to main content
Vulnerability Database/CVE-2026-107291

CVE-2026-107291: Pydantic AI Information Disclosure Flaw

CVE-2026-107291 is an information disclosure vulnerability in Pydantic AI that exposes sensitive agent data through OpenTelemetry instrumentation. This article covers technical details, affected versions, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-107291 Overview

CVE-2026-107291 is an information disclosure vulnerability in Pydantic AI, a Python agent framework for building Generative AI applications and workflows. The flaw affects the OpenTelemetry instrumentation layer, where the InstrumentationSettings(include_content=False) redaction flag fails to suppress all sensitive content. Even with redaction enabled, exception messages, stack traces, error status descriptions, and model_request_parameters containing runtime instructions or prompted_output_template values are exported to telemetry backends. The issue affects versions 0.3.4 through 1.107.6 and 2.44.0, and is tracked under [CWE-212: Improper Removal of Sensitive Information Before Storage or Transfer].

Critical Impact

Agent tool feedback, provider error bodies, runtime instructions, and structured-output templates leak to telemetry readers despite the include_content=False configuration intended to prevent such exposure.

Affected Products

  • Pydantic AI versions 0.3.4 through 1.107.5 (Python package)
  • Pydantic AI version 2.x prior to 2.44.0 (Python package)
  • Deployments configured with InstrumentationSettings(include_content=False) exporting to OpenTelemetry backends

Discovery Timeline

  • 2026-10-08 - CVE-2026-107291 published to NVD
  • 2026-10-13 - Last updated in NVD database

Technical Details for CVE-2026-107291

Vulnerability Analysis

Pydantic AI integrates with OpenTelemetry to emit spans and events describing agent execution, model requests, and tool invocations. The InstrumentationSettings(include_content=False) option exists so operators can forward observability data to shared telemetry backends without exposing prompt content, model outputs, or tool arguments. The redaction logic was applied to message attributes but not uniformly across all span fields.

As a result, several code paths continued to emit sensitive content: exception.message and exception.stacktrace events, span error status descriptions, and the model_request_parameters attribute set on model request and realtime spans. These fields can embed tool feedback, upstream provider error bodies that echo prompts, runtime system instructions, and the prompted_output_template used for structured outputs.

Root Cause

The root cause is inconsistent enforcement of the content-exclusion contract across instrumentation sites. Exception recording helpers and the model request span did not consult the include_content flag before serializing error details or request parameters, bypassing the redaction expected by consumers of the setting.

Attack Vector

The issue does not grant new access to agent data. Any party already authorized to read the configured telemetry backend, such as an observability platform, log store, or tracing UI, can view the leaked content. Operators who assumed include_content=False provided a hard redaction boundary are the primary impacted population.

python
# Patch excerpt: pydantic_ai_slim/pydantic_ai/_instrumentation.py
# Imports Span, Status, StatusCode so exception recording honors the
# same include_content rule on model request and realtime spans.

from opentelemetry import context as otel_context
from opentelemetry.baggage import get_baggage
from opentelemetry.trace import INVALID_SPAN, Span, SpanKind, Status, StatusCode, get_current_span
from opentelemetry.util.types import AttributeValue
from pydantic import ConfigDict, TypeAdapter
from pydantic_core import PydanticSerializationError, to_json

Source: Pydantic AI Commit 4e013c5

python
# Patch excerpt: pydantic_ai_slim/pydantic_ai/capabilities/instrumentation.py
# Replaces ad-hoc set_error_status with record_uncaught_errors to prove
# that content fields are swept before export.

    get_instructions,
    open_model_request_span,
    record_exception as _record_exception,
    record_uncaught_errors as _record_uncaught_errors,
    serialize_any,
)
from pydantic_ai._utils import UNSET, Unset
from pydantic_ai.exceptions import ApprovalRequired, CallDeferred, ToolRetryError

Source: Pydantic AI Commit 7ee27e3

Detection Methods for CVE-2026-107291

Indicators of Compromise

  • Telemetry spans from Pydantic AI services containing exception.message or exception.stacktrace events with embedded prompt text, tool arguments, or provider payloads.
  • Spans with a model_request_parameters attribute that includes instructions or prompted_output_template strings on affected versions.
  • Error status descriptions on model request or realtime spans that quote user content despite include_content=False being configured.

Detection Strategies

  • Inventory Python environments and extract the installed pydantic-ai version to flag releases between 0.3.4 and the fixed 1.107.6 or 2.44.0 builds.
  • Query the observability backend for spans produced by Pydantic AI service names and inspect exception and parameter fields for sensitive strings.
  • Correlate telemetry access logs against the user population that should legitimately see raw agent content, and treat anything outside that scope as leakage.

Monitoring Recommendations

  • Enable access auditing on tracing and logging backends receiving Pydantic AI telemetry so reads of exception events are attributable.
  • Add continuous checks that assert include_content=False deployments do not emit non-empty exception.stacktrace or model_request_parameters payloads.
  • Alert on dependency drift when a service downgrades Pydantic AI below the patched versions.

How to Mitigate CVE-2026-107291

Immediate Actions Required

  • Upgrade Pydantic AI to version 1.107.6 on the 1.x branch or 2.44.0 on the 2.x branch.
  • Rotate secrets, API keys, and credentials that may have appeared in agent prompts, tool outputs, or provider error bodies exported to telemetry.
  • Review retention policies on affected telemetry backends and purge spans containing leaked content where feasible.

Patch Information

The vulnerability is resolved in Pydantic AI Release v1.107.6 and Pydantic AI Release v2.44.0. The fixes are described in Pydantic AI Security Advisory GHSA-4x9p-g9wm-8q7f and implemented across pull requests #8403, #8404, #8408, #8428, and #8429. The patches route exception recording through a central helper that honors the include_content flag on model request and realtime spans and sweeps model_request_parameters before export.

Workarounds

  • Restrict access to telemetry backends to the smallest viable group until patched versions are deployed.
  • Disable OpenTelemetry instrumentation on Pydantic AI agents handling sensitive content if upgrading is not immediately possible.
  • Strip or filter exception.* events and model_request_parameters attributes at the OpenTelemetry collector before forwarding spans to shared backends.
bash
# Upgrade affected Pydantic AI installations to a patched release
pip install --upgrade 'pydantic-ai>=1.107.6,<2.0.0'
# or, on the 2.x branch
pip install --upgrade 'pydantic-ai>=2.44.0'

# Verify the installed version
python -c "import pydantic_ai; print(pydantic_ai.__version__)"

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.