Pydantic AI Harness before 0.59.0 does not enforce UsageLimits.tool_calls_limit on nested tool calls made from run_code in the CodeMode toolset, so a sandboxed program (or prompt-injected content steering it) can call tools through run_nested_call() without the pre-call check. This is a medium-severity issue (CVSS 4.8, high attack complexity) with no EPSS score, no KEV listing, no public exploit and no Nuclei template, so mass exploitation is unlikely today. The real exposure is cost and side effects: agents wired to expensive APIs or tools that write, send or delete can exceed the operator's limits, which many teams treat as their main guardrail against runaway spend. The package has about 505 downstream dependents and 16 other CVEs, so it sits in a lot of agent stacks and is worth tracking. Upgrade to 0.59.0 or later, and in the meantime enforce quotas outside the agent, at the tool, API-gateway or provider-billing layer, rather than relying on the framework counter.
What is the risk?
Low-to-medium. CVSS 4.8 reflects network reachability with high complexity, no privileges or user interaction, and limited integrity and availability impact. Exploitation needs the CodeMode toolset to be enabled and a way to influence the code the agent runs, such as direct user access or indirect prompt injection. There is no known active exploitation, KEV listing, public exploit or scanner template, and EPSS data is unavailable. Risk rises sharply where the exposed tools have real-world side effects or cost, because the bypass removes the safeguard operators set for them.
How does the attack unfold?
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| Pydantic AI | pip | — | No patch |
| Pydantic AI | pip | < 0.59.0 | 0.59.0 |
How severe is it?
What is the attack surface?
What should I do?
1 step1) Upgrade pydantic-ai-harness to 0.59.0 or later (fix in pydantic/pydantic-ai PR #10362, commit eb27b2b). 2) Until patched, disable the CodeMode toolset or remove costly and side-effecting tools from agents that use it. 3) Enforce limits independently of the framework: provider-side budgets, API gateway rate limits, per-tool quotas and idempotency controls. 4) Require human approval for destructive or high-cost tools. 5) Detect by alerting on tool-call counts per run that exceed the configured tool_calls_limit, on spend anomalies, and on bursts of calls from a single run_code execution. 6) Treat untrusted content reaching agents with CodeMode as a prompt-injection risk and sanitize or isolate it.
What does CISA's SSVC say?
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2026-114386?
Pydantic AI Harness before 0.59.0 does not enforce UsageLimits.tool_calls_limit on nested tool calls made from run_code in the CodeMode toolset, so a sandboxed program (or prompt-injected content steering it) can call tools through run_nested_call() without the pre-call check. This is a medium-severity issue (CVSS 4.8, high attack complexity) with no EPSS score, no KEV listing, no public exploit and no Nuclei template, so mass exploitation is unlikely today. The real exposure is cost and side effects: agents wired to expensive APIs or tools that write, send or delete can exceed the operator's limits, which many teams treat as their main guardrail against runaway spend. The package has about 505 downstream dependents and 16 other CVEs, so it sits in a lot of agent stacks and is worth tracking. Upgrade to 0.59.0 or later, and in the meantime enforce quotas outside the agent, at the tool, API-gateway or provider-billing layer, rather than relying on the framework counter.
Is CVE-2026-114386 actively exploited?
No confirmed active exploitation of CVE-2026-114386 has been reported, but organizations should still patch proactively.
How to fix CVE-2026-114386?
1) Upgrade pydantic-ai-harness to 0.59.0 or later (fix in pydantic/pydantic-ai PR #10362, commit eb27b2b). 2) Until patched, disable the CodeMode toolset or remove costly and side-effecting tools from agents that use it. 3) Enforce limits independently of the framework: provider-side budgets, API gateway rate limits, per-tool quotas and idempotency controls. 4) Require human approval for destructive or high-cost tools. 5) Detect by alerting on tool-call counts per run that exceed the configured tool_calls_limit, on spend anomalies, and on bursts of calls from a single run_code execution. 6) Treat untrusted content reaching agents with CodeMode as a prompt-injection risk and sanitize or isolate it.
What systems are affected by CVE-2026-114386?
This vulnerability affects the following AI/ML architecture patterns: agent frameworks, code-executing agents (CodeMode), tool-calling LLM pipelines, multi-tool orchestration.
What is the CVSS score for CVE-2026-114386?
CVE-2026-114386 has a CVSS v3.1 base score of 4.8 (MEDIUM). The EPSS exploitation probability is 0.35%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0034.002Agentic Resource ConsumptionAML.T0050Command and Scripting InterpreterAML.T0051.001IndirectAML.T0053AI Agent Tool InvocationCompliance Controls Affected
What are the technical details?
Original Advisory
Pydantic AI Harness before 0.59.0 fails to enforce UsageLimits.tool_calls_limit on nested tool calls dispatched from run_code in the CodeMode toolset. Users or prompt-injected content can make the sandboxed program invoke tools via run_nested_call() without check_before_tool_call, exceeding operator limits on costly or side-effecting tools.
Exploitation Scenario
An organization runs an internal research agent with CodeMode and a paid enrichment API, with tool_calls_limit set to 20. An attacker plants instructions in a web page or document the agent ingests, telling it to write a program that loops over thousands of lookups. The program runs in run_code and calls the tool through run_nested_call(), skipping the pre-call limit check. The agent makes thousands of paid or side-effecting calls in one run, exhausting budget and quotas, or repeatedly triggering a write action such as creating records or sending messages, until an external control stops it.
Weaknesses (CWE)
CWE-770Allocation of Resources Without Limits or ThrottlingPrimaryCWE-770Allocation of Resources Without Limits or ThrottlingCWE-770 — Allocation of Resources Without Limits or Throttling: The product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated.
- [Requirements] Clearly specify the minimum and maximum expectations for capabilities, and dictate which behaviors are acceptable when resource allocation reaches limits.
- [Architecture and Design] Limit the amount of resources that are accessible to unprivileged users. Set per-user limits for resources. Allow the system administrator to define these limits. Be careful to avoid CWE-410.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:LReferences
- github.com/pydantic/pydantic-ai/blob/v2.58.0/src/pydantic_ai_harness/pydantic_ai_harness/code_mode/_toolset.pytechnical-description
- github.com/pydantic/pydantic-ai/commit/eb27b2b89fe76ae23ee9b6fc9eb4b227a4967949patch
- github.com/pydantic/pydantic-ai/pull/10362issue-trackingpatch
- github.com/pydantic/pydantic-ai/releases/tag/v2.59.0release-notes
- pypi.org/project/pydantic-ai-harness/0.59.0/product
- vulncheck.com/advisories/pydantic-ai-harness-before-0.59.0-codemode-tool-call-limit-bypass-via-run-codethird-party-advisory
- github.com/advisories/GHSA-3589-pxp7-3gj8
- nvd.nist.gov/vuln/detail/CVE-2026-114386
- pypi.org/project/pydantic-ai-harness/0.59.0
Timeline
Related Vulnerabilities
CVE-2026-255808.6pydantic-ai: SSRF allows internal network access
Same package: pydantic-aiCVE-2026-1072867.5Pydantic AI: stream slot leak enables remote DoS
Same package: pydantic-aiCVE-2026-542496.8Pydantic AI: UploadedFile refs leak cloud storage
Same package: pydantic-aiCVE-2026-487826.8pydantic-ai: SSRF IPv6 bypass exposes cloud IAM creds
Same package: pydantic-aiCVE-2026-256405.4pydantic-ai: Path Traversal enables file access
Same package: pydantic-ai