CVE-2026-107291

CVE-2026-107291 is a low-severity security vulnerability in pydantic-ai (pip), affecting versions >= 0.3.4, < 1.107.6. It is fixed in 1.107.6, 2.44.0.

Does this CVE actually affect you?

Kodem shows which CVEs are reachable and running in your applications, so you fix what's exploitable, not just what's listed.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence, not another scanner.

Summary

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 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.

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 (gen_ai.input.messages, gen_ai.tool.call.arguments, gen_ai.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.

Who Is Affected

You are affected if you enabled instrumentation with include_content=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 include_content=False.

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 prompted_output_template within model_request_parameters, on spans emitted by Pydantic AI in your telemetry pipeline (for example with an OpenTelemetry Collector processor). Setting include_model_request_parameters=False alongside include_content=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.

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 include_content=False exists for.

Affected versions

pydantic-ai (>= 0.3.4, < 1.107.6) pydantic-ai (>= 2.0.0b1, < 2.44.0) pydantic-ai-slim (>= 0.3.4, < 1.107.6) pydantic-ai-slim (>= 2.0.0b1, < 2.44.0)

Security releases

pydantic-ai → 1.107.6 (pip) pydantic-ai → 2.44.0 (pip) pydantic-ai-slim → 1.107.6 (pip) pydantic-ai-slim → 2.44.0 (pip)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

Upgrade to a patched version. With include_content=False, exception events now record only the exception type, error statuses carry no description, and model_request_parameters 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 model_request_parameters.

Frequently Asked Questions

  1. What is CVE-2026-107291? CVE-2026-107291 is a low-severity security vulnerability in pydantic-ai (pip), affecting versions >= 0.3.4, < 1.107.6. It is fixed in 1.107.6, 2.44.0.
  2. Which packages are affected by CVE-2026-107291?
    • pydantic-ai (pip) (versions >= 0.3.4, < 1.107.6)
    • pydantic-ai-slim (pip) (versions >= 0.3.4, < 1.107.6)
  3. Is there a fix for CVE-2026-107291? Yes. CVE-2026-107291 is fixed in 1.107.6, 2.44.0. Upgrade to this version or later.
  4. Is CVE-2026-107291 exploitable, and should I be worried? Whether CVE-2026-107291 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  5. What actually determines whether CVE-2026-107291 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  6. How do I fix CVE-2026-107291?
    • Upgrade pydantic-ai to 1.107.6 or later
    • Upgrade pydantic-ai to 2.44.0 or later
    • Upgrade pydantic-ai-slim to 1.107.6 or later
    • Upgrade pydantic-ai-slim to 2.44.0 or later

Other vulnerabilities in pydantic-ai

Stop the waste.
Protect your environment with Kodem.