CVE-2026-107293: Pydantic ai Retry Prompt Content Is Not Vulnerability

LOW
Advisory Identifier: GHSA-3gh4-cghq-f8v4
CWE-532 CWE-212
Published
Advisory Summary

CVE-2026-107293 is a LOW retry prompt content is not vulnerability (CWE-532: Insertion of Sensitive Information into Log File) affecting Pydantic ai libraries in the PyPI ecosystem. The issue involves retry prompt content is not redacted when `include_content=false`. Remediation is available by upgrading affected packages to version 2.27.1, 1.107.4.

CVE-2026-107293 at a Glance

CVE Identifier CVE-2026-107293
GHSA Identifier GHSA-3gh4-cghq-f8v4
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-532: Insertion of Sensitive Information into Log File
Affected Product Pydantic ai
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix CVE-2026-107293

To remediate this vulnerability, upgrade all affected Pydantic ai dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

pydantic-ai fixed: 2.27.1
pip install pydantic-ai>=2.27.1
pydantic-ai-slim fixed: 1.107.4
pip install pydantic-ai-slim>=1.107.4
pydantic-ai-slim fixed: 2.27.1
pip install pydantic-ai-slim>=2.27.1
pydantic-ai fixed: 1.107.4
pip install pydantic-ai>=1.107.4
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show pydantic-ai

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-107293, inspect your installed packages using pip:

pip show pydantic-ai

Analyze the terminal output to locate any version of Pydantic ai in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.27.1), your application is affected.

Note: The pip show pydantic-ai command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-532: Insertion of Sensitive Information into Log File, where the product writes sensitive information to a log file. In Pydantic ai, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary Pydantic AI's OpenTelemetry instrumentation supports `InstrumentationSettings(include_content=False)` to exclude message content — user prompts, model completions, tool call arguments and responses — from exported telemetry, so that agents can be monitored without sending sensitive content to the observability backend. Retry prompts — the feedback messages Pydantic AI sends back to the model when its output fails validation or an output validator raises `ModelRetry` — were not covered by this setting when they were not associated with a tool call, as with structured output modes that don't use tool calls (e.g. `NativeOutput` or `PromptedOutput`) and output validators applied to text output. Their full content was recorded on model request spans even with `include_content=False`. Since validation feedback can quote invalid values from the model's response, message content that the setting was configured to withhold could reach the telemetry backend. ### Details Retry prompts without an associated tool call were serialized into span message attributes (such as `gen_ai.input.messages` and `pydantic_ai.all_messages`) as regular text parts, and this path did not apply the `include_content` check that every other message part applies. Retry prompts tied to a tool call, and all other message content, were redacted correctly. ### 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. The disclosed content is limited to retry feedback: validation error details, which can quote invalid values from the model's output, or output-validator `ModelRetry` messages. ### Who Is Affected You are affected if you enabled instrumentation with `include_content=False` and your agent can produce retry prompts outside of tool calls: it uses a structured output mode that doesn't rely on tool calls (such as `NativeOutput` or `PromptedOutput`), or output validators on text output. You are not affected if you don't set `include_content=False`, or if all of your agent's retries come from tool calls (including the default tool-based structured output mode), which were redacted correctly. ### Remediation Upgrade to a patched version; retry prompt content now honors `include_content=False` like all other message content. If you rely on this setting, consider reviewing previously exported traces for retry prompt content that should not have been recorded. ### Workaround for Unpatched Versions If you cannot upgrade, scrub or drop the message attributes (`gen_ai.input.messages`, `gen_ai.output.messages`, `pydantic_ai.all_messages`) in your telemetry pipeline (for example with an OpenTelemetry Collector processor), or use tool-based structured output modes, whose retry feedback honors `include_content=False`. ### Credits Reported privately by the University of Sydney Security Research Team (Liyi Zhou, Ziyue Wang, Strick, Maurice, Chenchen Yu), and later independently discovered and reported publicly, with a fix, by @sean-kim05.

CVE-2026-107293 Affected Pydantic ai Versions

4 component(s)
Fixed Versions:
2.27.11.107.4
Product / Package Ecosystem Affected Versions Fixed Version
pydantic-ai
PyPI
≥ 2.0.0b1
< 2.27.1
2.27.1
pydantic-ai-slim
PyPI
≥ 0.3.4
< 1.107.4
1.107.4
pydantic-ai-slim
PyPI
≥ 2.0.0b1
< 2.27.1
2.27.1
pydantic-ai
PyPI
≥ 0.3.4
< 1.107.4
1.107.4

References

Frequently Asked Questions

What is CVE-2026-107293?
CVE-2026-107293 is a security vulnerability in Pydantic ai involving retry prompt content is not redacted when `include_content=False` under CWE-532: Insertion of Sensitive Information into Log File.
Which Pydantic ai versions are affected?
Affected versions include releases prior to 2.27.1, 1.107.4 across affected packages: pydantic-ai, pydantic-ai-slim.
What version fixes CVE-2026-107293?
Upgrading to 2.27.1, 1.107.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pydantic-ai affected?
Yes, pydantic-ai is affected in releases prior to 2.27.1, 1.107.4. Upgrade your dependency to 2.27.1, 1.107.4 or later.
Is pydantic-ai-slim affected?
Yes, pydantic-ai-slim is affected in releases prior to 1.107.4, 2.27.1. Upgrade your dependency to 1.107.4, 2.27.1 or later.
What CWE is associated with CVE-2026-107293?
CVE-2026-107293 is classified under CWE-532: Insertion of Sensitive Information into Log File (The product writes sensitive information to a log file.).
How can I check PyPI dependencies for CVE-2026-107293?
Run the dependency tree command: 'pip show pydantic-ai'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-3gh4-cghq-f8v4",
  "modified" : "2026-10-08T17:16:32Z",
  "published" : "2026-10-08T17:16:32Z",
  "aliases" : [ "CVE-2026-107293" ],
  "summary" : "Pydantic AI OpenTelemetry instrumentation: retry prompt content is not redacted when `include_content=False`",
  "details" : "### Summary\n\nPydantic AI's OpenTelemetry instrumentation supports `InstrumentationSettings(include_content=False)` to exclude message content — user prompts, model completions, tool call arguments and responses — from exported telemetry, so that agents can be monitored without sending sensitive content to the observability backend.\n\nRetry prompts — the feedback messages Pydantic AI sends back to the model when its output fails validation or an output validator raises `ModelRetry` — were not covered by this setting when they were not associated with a tool call, as with structured output modes that don't use tool calls (e.g. `NativeOutput` or `PromptedOutput`) and output validators applied to text output. Their full content was recorded on model request spans even with `include_content=False`. Since validation feedback can quote invalid values from the model's response, message content that the setting was configured to withhold could reach the telemetry backend.\n\n### Details\n\nRetry prompts without an associated tool call were serialized into span message attributes (such as `gen_ai.input.messages` and `pydantic_ai.all_messages`) as regular text parts, and this path did not apply the `include_content` check that every other message part applies. Retry prompts tied to a tool call, and all other message content, were redacted correctly.\n\n### Impact\n\nThis 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. The disclosed content is limited to retry feedback: validation error details, which can quote invalid values from the model's output, or output-validator `ModelRetry` messages.\n\n### Who Is Affected\n\nYou are affected if you enabled instrumentation with `include_content=False` and your agent can produce retry prompts outside of tool calls: it uses a structured output mode that doesn't rely on tool calls (such as `NativeOutput` or `PromptedOutput`), or output validators on text output. You are not affected if you don't set `include_content=False`, or if all of your agent's retries come from tool calls (including the default tool-based structured output mode), which were redacted correctly.\n\n### Remediation\n\nUpgrade to a patched version; retry prompt content now honors `include_content=False` like all other message content. If you rely on this setting, consider reviewing previously exported traces for retry prompt content that should not have been recorded.\n\n### Workaround for Unpatched Versions\n\nIf you cannot upgrade, scrub or drop the message attributes (`gen_ai.input.messages`, `gen_ai.output.messages`, `pydantic_ai.all_messages`) in your telemetry pipeline (for example with an OpenTelemetry Collector processor), or use tool-based structured output modes, whose retry feedback honors `include_content=False`.\n\n### Credits\n\nReported privately by the University of Sydney Security Research Team (Liyi Zhou, Ziyue Wang, Strick, Maurice, Chenchen Yu), and later independently discovered and reported publicly, with a fix, by @sean-kim05.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pydantic-ai"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.3.4"
      }, {
        "fixed" : "1.107.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pydantic-ai"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0b1"
      }, {
        "fixed" : "2.27.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pydantic-ai-slim"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.3.4"
      }, {
        "fixed" : "1.107.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pydantic-ai-slim"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0b1"
      }, {
        "fixed" : "2.27.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/pydantic/pydantic-ai/security/advisories/GHSA-3gh4-cghq-f8v4"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pydantic/pydantic-ai/pull/7357"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pydantic/pydantic-ai/commit/fe9dbed7b7ccf7e7128b5786886e4441f6f5594f"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pydantic/pydantic-ai"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pydantic/pydantic-ai/releases/tag/v2.27.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-212", "CWE-532" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-10-08T17:16:32Z",
    "nvd_published_at" : null
  }
}