CVE-2026-107291: Pydantic AI OpenTelemetry instrumentation: exception events on tool and agent run spans include content when `include_content=False`
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
ModelRetryorToolFailedfeedback 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_parametersattribute 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 →