On this page · 7 sections
  1. ToolOutputLimits strip_ansi and tool output an attacker can influence
  2. The jwt pattern in secret redaction on text an attacker can influence
  3. Pydantic AI Harness versions affected by each advisory and the fixed release
  4. Upgrade steps for Pydantic AI Harness and Pydantic AI v1 users
  5. Also in this release
  6. How to check whether a Pydantic AI Harness install is affected
  7. Sources

Warning

Two high-severity advisories affect Pydantic AI Harness: GHSA-m4cr-m4qc-9hh3 in the ToolOutputLimits ANSI stripping, and GHSA-5m5q-5qj4-gx9h in the jwt pattern of secret redaction. Both are quadratic-time flaws that can occupy the event loop, and both are fixed in pydantic-ai-harness 0.70.0.

ToolOutputLimits strip_ansi and tool output an attacker can influence #

The Pydantic AI v2.70.0 release notes, published 2026-11-17, list this flaw under Security. With strip_ansi=True, the ToolOutputLimits capability removed ANSI escape sequences with a pattern whose time grew quadratically with line length. A tool result of a few hundred kilobytes with many unterminated escape sequences could therefore hold the event loop for tens of seconds to minutes.

You are affected if you set strip_ansi=True and run tools whose output an attacker can influence, such as shell commands, file reads, web pages a tool loads or MCP servers. The GHSA-m4cr-m4qc-9hh3 advisory names the capability as OverflowingToolOutput before 0.13.0, so older code may use that name.

Note

Background: Stripping runs on the event loop before the capability reduces the output, so its own size limits do not bound it. The assumed attacker can place text in content a tool returns. GHSA-m4cr-m4qc-9hh3 describes this mechanism.

The jwt pattern in secret redaction on text an attacker can influence #

The GHSA-5m5q-5qj4-gx9h advisory says the jwt pattern backtracked in time quadratic in the length of the scanned text, so a few hundred kilobytes of crafted text could delay the process for tens of seconds to minutes. The pattern is included by default, so you are affected if you use redact_secrets or secret_data() on text an attacker can influence. The advisory lists user prompts checked by InputGuardrail, tool results checked by ToolGuardrail, and model output checked by OutputGuardrail.

Note

Background: Synchronous guards run on the event loop, so a slow pattern delays every other request and agent run in the process. The advisory describes the attacker as someone who can send a prompt to the agent or place text in content a tool returns. GHSA-5m5q-5qj4-gx9h gives this detail.

The fix changes what the pattern matches. The release notes say:

The fixed pattern no longer matches a JWT whose header segment contains -eyJ

Pydantic AI v2.70.0 release notes

Pydantic AI Harness versions affected by each advisory and the fixed release #

AdvisoryAffected pydantic-ai-harness versionsFixed inSeverity and CVSS
GHSA-m4cr-m4qc-9hh3 (ToolOutputLimits strip_ansi)>= 0.4.0, <= 0.69.00.70.0High; CVSS 3.1 base score 7.5, CWE-1333, as listed in the pydantic/pydantic-ai advisory
GHSA-5m5q-5qj4-gx9h (jwt secret redaction)>= 0.16.0, <= 0.69.00.70.0High; CVSS 3.1 base score 7.5, CWE-1333, as listed in the pydantic/pydantic-ai advisory

Both advisories list the same CVSS 3.1 base score of 7.5 and CWE-1333. The two advisories name different starting versions, so an install from 0.4.0 up to 0.16.0 (excluding 0.16.0) is in the ToolOutputLimits range only, while the jwt advisory covers 0.16.0 and later up to 0.69.0.

An earlier advisory from the same project is separate from this fix. GHSA-mgmv-r532-pg36, rated medium with a CVSS 3.1 base score of 6.5 in the pydantic/pydantic-ai advisory, covers a credential in an MCP server URL path reaching chat frontends through MCP Apps events. It affects pydantic-ai and pydantic-ai-slim from 2.57.0 before 2.60.0 and is patched in 2.60.0. The same advisory states that GHSA-xv4x-g8mx-ch56 covered the same identifier in traces, while the frontend channel remained exposed until 2.60.0, so upgrading to 2.58.0 or 2.59.0 did not address it.

Upgrade steps for Pydantic AI Harness and Pydantic AI v1 users #

  1. Upgrade the harness to 0.70.0 or later: pip install --upgrade "pydantic-ai-harness>=0.70.0"
  2. Until the upgrade, leave strip_ansi at its default, False, if you have it set to True.
  3. Until the upgrade, if you use redact_secrets or secret_data(), name the patterns you need with secret_data(only=[...]) so that jwt is left out.
  4. On Pydantic AI v1, the harness cannot be upgraded past 0.4.0. Upgrade to Pydantic AI v2 and pydantic-ai-harness 0.70.0, or leave strip_ansi off.

Also in this release #

The release notes list these changes under Compatibility Notes, so review them before upgrading:

  • Forward service_tier to xAI and record the served tier in provider_details (#13524)
  • Add huggingface_logprobs and huggingface_top_logprobs to HuggingFaceModelSettings (#6855)
  • Let Skills read bundled files with read_files=True and substitute ${SKILL_DIR} placeholders (#13678)
  • Let a harness SpendLimits Budget resolve its usd / tokens ceiling per scope from the run context (#13644)
  • Add CapabilityPart, a request part for what a capability tells the model (#11935)
  • Judge file input by media type with supported_image_media_types, supported_audio_media_types and supported_video_media_types (#12419)

Other changes in the release:

  • Add RetryOnModelErrors capability to retry the same model on transient model API errors (#11932)
  • Make the CodeMode speculation scan of streamed code linear in its length (#13697), and check long DetectLoops parts in linear time (#13682)
  • Spill each ToolOutputLimits call separately when one run reuses a tool_call_id (#12677)
  • Cap provider SDK extras below the next major version that has not been tested (#13316)

The complete list is in the Pydantic AI v2.70.0 release notes.

How to check whether a Pydantic AI Harness install is affected #

Check the installed harness version first. Any version from 0.4.0 through 0.69.0 is in the ToolOutputLimits range, and any version from 0.16.0 through 0.69.0 is in the jwt range.

Bash
pip show pydantic-ai-harness

Then search your code for strip_ansi=True, OverflowingToolOutput, redact_secrets and secret_data(. A secret_data() call without only=[...] keeps jwt, because that pattern is included by default.

The Sentinel’s Call

If your harness is between 0.4.0 and 0.69.0 and you set strip_ansi=True or use jwt redaction on attacker-influenced text, upgrade to 0.70.0 first, since both advisories are rated high. Until then, leave strip_ansi at False or name patterns with secret_data(only=[...]). On Pydantic AI v1, the harness cannot move past 0.4.0, so the upgrade to v2 or turning strip_ansi off is the only path. The other changes in v2.70.0 can follow in a normal upgrade once the compatibility notes are reviewed.

Our judgement, drawn only from the facts and sources above.

Verified We installed Pydantic AI Harness 0.70.0 from PyPI and ran it on Nov 18, 2026.

  • Pydantic AI Harness 0.70.0 python -c 'import importlib.metadata as m; print(m.version("pydantic-ai-harness"))'

    0.70.0

    Full output and environment
    python:3.12-slimsha256:5e2bdb1b0d54…
    $ python -c 'import importlib.metadata as m; print(m.version("pydantic-ai-harness"))'
    0.70.0
    $ python -c 'import pydantic_ai_harness; print("import ok")'
    import ok

Isolated container: official image, network off, read-only, no host files. How we check

Upgrade Check 0.69.0 → 0.70.0

Check your code
Pydantic AI Harness0.69.00.70.0
Installs and runs✓✓
Strip ANSI escapes from crafted tool outputone 20 KB line of unterminated OSC escapes, the GHSA-m4cr-m4qc-9hh3 shape524.4 ms0.15 ms3,427× faster
Strip ANSI escapes from a colored log4,000 lines1.13 ms3.34 ms2.96× slower
Redact JWTs in crafted text40 KB token-like run without dots, the GHSA-5m5q-5qj4-gx9h shape263.9 ms0.43 ms609× faster
No measurable differenceImport, Redact JWTs in ordinary text
pydantic-ai-slim2.69.02.70.0
pydantic-graph2.69.02.70.0
Size on disk50.6 MB51.4 MB
Public API12 new, 8 changed
Removed and changed names
  • pydantic_ai_harness.ArtifactScanner changed
  • pydantic_ai_harness.ArtifactScanner.__init__ changed
  • pydantic_ai_harness.PydanticAIDocs changed
  • pydantic_ai_harness.PydanticAIDocs.__init__ changed
  • pydantic_ai_harness.RepoContext changed

Measured Nov 18, 2026 in isolated containers, median of 11 alternating runs; differences under 10% are not reported. How we check

Sources

  1. Release v2.70.0 (2026-11-17) · pydantic/pydantic-ai · GitHub github.com · Nov 17, 2026
  2. GHSA-5m5q-5qj4-gx9h: Harness JWT redaction can take quadratic time, blocking the event loop github.com · Nov 18, 2026
  3. GHSA-m4cr-m4qc-9hh3: Harness `ToolOutputLimits` ANSI stripping can take quadratic time, blocking the event loop github.com · Nov 18, 2026
  4. GHSA-mgmv-r532-pg36: A credential in an MCP server URL path could reach chat frontends through MCP Apps events github.com · Nov 4, 2026

Next reading

Edited and approved by Jarosław Krzemiński. Spotted a mistake? Report a correction or read the corrections policy.