---
id: "CVE-2026-114386"
kind: "vulnerability"
aliases: ["CVE-2026-114386", "GHSA-3589-pxp7-3gj8"]
title: "Pydantic AI Harness tool-call limit bypass in nested CodeMode calls"
severity: "medium"
cvss: 6.3
epss: 0.00346
exploited: false
status: "open"
category: "ai-tooling"
products: [{"name": "pydantic-ai-harness", "fixed": ["0.59.0"], "affected": "< 0.59.0", "ecosystem": "pypi"}]
ecosystems: ["pypi"]
tags: ["ai-agents", "ai-tooling", "codemode", "cwe-770", "pydantic-ai", "python"]
not_affected_if: ["not-using-codemode", "version-0.59.0-or-later"]
published_at: "2026-10-21T13:18:28+00:00"
first_seen_at: "2026-10-23T20:59:05+00:00"
updated_at: "2026-10-23T21:57:28+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-3589-pxp7-3gj8", "first_seen_at": "2026-10-23T20:59:05+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-114386", "first_seen_at": "2026-10-23T21:57:28+00:00"}]
---

# Pydantic AI Harness tool-call limit bypass in nested CodeMode calls

Pydantic AI Harness before 0.59.0 does not enforce the tool-call limit on tools invoked from nested calls inside its CodeMode sandbox. A user or prompt-injected content can make the sandboxed program call tools beyond the operator's configured limit, including costly or side-effecting ones.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- pypi:pydantic-ai-harness affected < 0.59.0 fixed 0.59.0

## How to check

Check whether the project pins pydantic-ai-harness below 0.59.0 (e.g. pip show pydantic-ai-harness or grep it in requirements/lock files).

## Fix

Upgrade pydantic-ai-harness to 0.59.0 or later.

## Timeline

- 2026-10-23T20:59:05+00:00 ghsa https://github.com/advisories/GHSA-3589-pxp7-3gj8
- 2026-10-23T21:57:28+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-114386

## From the sources

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.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
