# CVE-2026-114386: Pydantic AI Harness UsageLimits.tool_calls_limit enforcement bypass in CodeMode

Source: https://junglewise.ai/threats/cve-2026-114386-pydantic-ai-harness-before-0-59-0-fails-to-enforce-usagelimits  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-10-21. Updated: 2026-10-21  
License: CC BY 4.0 with a link back

CVE-2026-114386 · Severity: medium · CVSS 4.8 · Published 2026-10-21

Pydantic AI Harness, a framework for building AI agents with sandboxed code execution, fails to enforce tool call limits on nested tool calls made from within executed code. An attacker or prompt-injected content can bypass usage limits on expensive or side-effecting tools, allowing unlimited invocations of operations that should be capped, such as external API calls or state-modifying actions.

Vendors: [Pydantic](https://junglewise.ai/threats/vendors/pydantic), [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2026-114386 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-114386 being exploited in the wild.

**How severe is CVE-2026-114386?** Medium severity, with a CVSS score of 4.8, published 21 October 2026.

**Which products and versions are affected?** Pydantic AI Harness before 0.59.0; pydantic-ai-harness (PyPI) < 0.59.0, ECOSYSTEM:introduced=0,fixed=0.59.0.

**Is there a fix for CVE-2026-114386?** Yes. pydantic-ai-harness (PyPI): upgrade to 0.59.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-114386 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-114386?** Check whether you run Pydantic AI Harness or pydantic-ai-harness (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- pydantic-ai-harness (PyPI): upgrade to 0.59.0 or later

  ```sh
  pip install "pydantic-ai-harness>=0.59.0"
  ```


## Technical details

The vulnerability exists in the CodeMode toolset where nested tool calls dispatched via run_nested_call() from the run_code function skip the check_before_tool_call validation that enforces the tool_calls_limit. An attacker can craft sandboxed code that repeatedly invokes restricted tools without decrementing the remaining call budget, bypassing the UsageLimits quota mechanism. The fix adds pre-call validation to track nested tool invocations against the limit, raising UsageLimitExceeded when exceeded.

## Affected products

- Pydantic AI Harness before 0.59.0

## Identifiers

- CVE-2026-114386
- GHSA-3589-pxp7-3gj8

## Timeline

- 2026-10-21: disclosed
- 2026-10-20: patched

## References

- [https://github.com/pydantic/pydantic-ai/blob/v2.58.0/src/pydantic_ai_harness/pydantic_ai_harness/code_mode/_toolset.py](https://github.com/pydantic/pydantic-ai/blob/v2.58.0/src/pydantic_ai_harness/pydantic_ai_harness/code_mode/_toolset.py)
- [https://github.com/pydantic/pydantic-ai/commit/eb27b2b89fe76ae23ee9b6fc9eb4b227a4967949](https://github.com/pydantic/pydantic-ai/commit/eb27b2b89fe76ae23ee9b6fc9eb4b227a4967949)
