Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. pydantic-ai
  4. ›
  5. CVE-2026-107291

CVE-2026-107291: Pydantic AI OpenTelemetry instrumentation: exception events on tool and agent run spans include content when `include_content=False`

October 8, 2026

Pydantic AI’s OpenTelemetry instrumentation supports InstrumentationSettings(include_content=False) to exclude message content — user prompts, model completions, tool call arguments and responses, and any other message content — from exported telemetry, so that agents can be monitored without sending sensitive content to the observability backend.

The message attributes honoured the setting. Several other parts of the same spans did not, and exported content regardless of it:

  • Exceptions. Recorded as OpenTelemetry exception events, with their message and stack trace, on tool, agent run, model request, embedding and image generation spans, and on realtime session spans. The message of the exception carrying a tool’s ModelRetry or ToolFailed feedback is the text sent back to the model, which can quote tool arguments and results. When a tool ran out of retries, the error that ended the run was chained from the last retry, so its stack trace repeated that text on the run span. Exceptions raised by tool code were recorded with their full message, as were failures of a model request, embedding or image generation, whose messages carry the provider’s error response body.
  • The error status description. The OpenTelemetry SDK describes a span’s ERROR status with the exception’s type and message, so the message reached the backend a second time even where the event itself was redacted.
  • Instructions and the prompted-output template. The model_request_parameters attribute serialized the request’s instruction parts in full, exporting the agent’s instructions — both static and those built from dependencies at request time — along with the template used to prompt for structured output.

References

  • github.com/advisories/GHSA-4x9p-g9wm-8q7f
  • github.com/pydantic/pydantic-ai/commit/4e013c51a50659aba2adf7853bfb22bb77f6a518
  • github.com/pydantic/pydantic-ai/commit/6b14c74cb281f899a2ae4fae5327111e33f60771
  • github.com/pydantic/pydantic-ai/commit/7ee27e38ab2e525ca60ff1a25d16413ff989fd79
  • github.com/pydantic/pydantic-ai/commit/963dec5f70d6f558997fc259356c0090cc5ea487
  • github.com/pydantic/pydantic-ai/commit/de4e61515327bd80a19cd8552001c30933e6acc3
  • github.com/pydantic/pydantic-ai/pull/8403
  • github.com/pydantic/pydantic-ai/pull/8404
  • github.com/pydantic/pydantic-ai/pull/8408
  • github.com/pydantic/pydantic-ai/pull/8428
  • github.com/pydantic/pydantic-ai/pull/8429
  • github.com/pydantic/pydantic-ai/releases/tag/v1.107.6
  • github.com/pydantic/pydantic-ai/releases/tag/v2.44.0
  • github.com/pydantic/pydantic-ai/security/advisories/GHSA-4x9p-g9wm-8q7f
  • nvd.nist.gov/vuln/detail/CVE-2026-107291

Code Behaviors & Features

Detect and mitigate CVE-2026-107291 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions starting from 0.3.4 before 1.107.6, all versions starting from 2.0.0-b.1 before 2.44.0

Fixed versions

  • 1.107.6
  • 2.44.0

Solution

Upgrade to versions 1.107.6, 2.44.0 or above.

Impact 4.3 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N

Learn more about CVSS

Weakness

  • CWE-212: Improper Removal of Sensitive Information Before Storage or Transfer
  • CWE-532: Insertion of Sensitive Information into Log File

Source file

pypi/pydantic-ai/CVE-2026-107291.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:15:28 +0000.