What happened
The stripping runs on the event loop before the capability reduces the output, so the output size limits do not bound the work. The advisory characterises the attacker as able to place text in content a tool returns, and the fix resolves the quadratic ANSI-stripping pattern.
Why it matters
Agents routinely run untrusted tool output. A malicious tool or MCP result can induce a single-process denial of service that stalls every concurrent agent run and inference request served by that harness process — a low-effort availability attack in the agent runtime layer.
Attack vector
When strip_ansi=True, ToolOutputLimits strips ANSI escape sequences with a pattern that is quadratic in line length. A tool result of a few hundred kilobytes crafted with many unterminated escape sequences occupies the event loop for tens of seconds to minutes, delaying every other request and agent run in the process.
Affected systems
pydantic-ai-harness with ToolOutputLimits (named OverflowingToolOutput before 0.13.0) and strip_ansi=True; fixed in 0.70.0
Mitigation
Upgrade pydantic-ai-harness to 0.70.0 or later, or leave strip_ansi at its default False. On Pydantic AI v1 (cannot upgrade past 0.4.0) upgrade to v2 plus harness 0.70.0 or disable strip_ansi.