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

Published Oct 8, 2026
·
Updated

Summary

Pydantic AI's OpenTelemetry instrumentation supports InstrumentationSettings(includecontent=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 modelrequestparameters 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.

Details

Content reaches these places because of what they carry rather than through any single missing check, which is why the setting was applied correctly to the message attributes (genai.input.messages, genai.tool.call.arguments, genai.tool.call.result, and so on) while these paths were not: the exception recording and the status description came from the OpenTelemetry SDK's defaults, and the instructions and output template were serialized as part of the request's parameters rather than treated as content.

Impact

This does not grant an attacker any new access to the agent or its data: the content is only visible to whoever can read the exported telemetry. The exposure matters when traces are exported to a destination whose audience is broader or less trusted than the agent's own data — a third-party observability vendor or a shared backend — which is the scenario includecontent=False exists for.

Who Is Affected

You are affected if you enabled instrumentation with includecontent=False. Instructions are exported on every successful run, so no failure is needed to be affected; the exception paths additionally require a tool to raise, or a model, embedding or image generation request to fail. Realtime sessions are affected the same way, through the errors their provider connections report. GHSA-3gh4-cghq-f8v4 stated that retries coming from tool calls were redacted correctly; that was true of the retry prompt in the message attributes but not of the exception event on the tool span. You are not affected if you don't set includecontent=False.

Remediation

Upgrade to a patched version. With includecontent=False, exception events now record only the exception type, error statuses carry no description, and modelrequestparameters is exported without its instruction content or output template. If you rely on this setting, consider reviewing previously exported traces for exception events, for error status descriptions, and for modelrequestparameters.

Workaround for Unpatched Versions

If you cannot upgrade, scrub the exception.message and exception.stacktrace event attributes, the error status description, and the instruction parts and promptedoutputtemplate within modelrequestparameters, on spans emitted by Pydantic AI in your telemetry pipeline (for example with an OpenTelemetry Collector processor). Setting includemodelrequestparameters=False alongside includecontent=False removes both, at the cost of the rest of that attribute.

Credits

Reported privately by @BrianWillows, whose report covered the exception events on tool and agent run spans. The remaining paths were found while fixing it, by a test that drives content through every channel at once and checks the whole exported trace.

Other sources

Pydantic AI is a Python agent framework for building applications and workflows with Generative AI. From 0.3.4 until 1.107.6 and 2.44.0, OpenTelemetry instrumentation configured with InstrumentationSettings(includecontent=False) can still export sensitive agent content through exception.message and exception.stacktrace events, error status descriptions, and modelrequestparameters containing instructions or the promptedoutputtemplate. The exposed data is available to readers of the configured telemetry backend and can include tool feedback, provider error bodies, runtime instructions, and structured-output templates even though message attributes are redacted. This issue does not grant new access to agent data, and deployments that do not use includecontent=False are not affected by the setting bypass. This issue is fixed in versions 1.107.6 and 2.44.0.

— MITRE

Affected Software

5 affected componentsFixes available
pypi/pydantic-ai>=0.3.4<1.107.6, >=2.0.0<2.44.0
pip/pydantic-ai-slim>=2.0.0b1<2.44.0
2.44.0
pip/pydantic-ai-slim>=0.3.4<1.107.6
1.107.6
pip/pydantic-ai>=2.0.0b1<2.44.0
2.44.0
pip/pydantic-ai>=0.3.4<1.107.6
1.107.6

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/pydantic-ai-slim to a version that resolves this vulnerability.

    Fixed in 2.44.0
  2. Upgrade

    Upgrade pip/pydantic-ai-slim to a version that resolves this vulnerability.

    Fixed in 1.107.6
  3. Upgrade

    Upgrade pip/pydantic-ai to a version that resolves this vulnerability.

    Fixed in 2.44.0
  4. Upgrade

    Upgrade pip/pydantic-ai to a version that resolves this vulnerability.

    Fixed in 1.107.6
  5. Upgrade

    Upgrade Pydantic AI to a version that resolves this vulnerability.

    Fixed in 1.107.6
  6. Upgrade

    Upgrade Pydantic AI to a version that resolves this vulnerability.

    Fixed in 2.44.0
  7. Configuration

    Set include_model_request_parameters=False alongside include_content=False to omit instruction content and the prompted_output_template from model_request_parameters.

    Pydantic AI OpenTelemetry instrumentation include_model_request_parameters = false
  8. Compensating control

    If you cannot upgrade, scrub exception.message and exception.stacktrace event attributes, the error status description, and the instruction parts and prompted_output_template within model_request_parameters from Pydantic AI spans in the telemetry pipeline, for example with an OpenTelemetry Collector processor.

Event History

Oct 8, 2026
CVE Published
via MITRE·04:22 PM
Data Sourced
via MITRE·04:22 PM
DescriptionWeakness
Advisory Published
via GitHub·04:48 PM
Data Sourced
via GitHub·04:48 PM
DescriptionWeaknessAffected Software
Data Sourced
via NVD·05:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Who is exposed to this issue?

Deployments using Pydantic AI OpenTelemetry instrumentation with InstrumentationSettings(include_content=False) are exposed if their agents generate exceptions on tool, agent run, model request, embedding, image generation, or realtime session spans. The intended content-exclusion setting does not prevent exception messages and stack traces from being exported.

2

What content can be disclosed through telemetry?

Exception events can include exception messages and stack traces. This may expose tool arguments and results quoted in ModelRetry or ToolFailed feedback, full messages from exceptions raised by tool code, and provider error responses associated with failed model requests, embeddings, or image generation.

3

Does disabling content collection protect exception telemetry?

No. Although include_content=False is honored for message attributes, the described exception events exported content regardless of that setting.

4

How can I determine whether exported telemetry may contain affected data?

Review exported OpenTelemetry spans for exception events and inspect their exception messages and stack traces, particularly for tool, agent run, model request, embedding, image generation, and realtime session spans. Tool retry failures are especially relevant because the final run error's chained stack trace can repeat feedback sent to the model.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203