If you use strip_ansi or the default jwt redaction on text an attacker can influence, a few hundred KB can block the event loop for minutes. Upgrade pydantic-ai-harness to 0.70.0.
Key takeaways · AI-distilled
pydantic-ai-agent harnessThe scaffolding around a model that turns it into a working agent — the loop, the tools it can call, and the rules for when to stop.Full definition → 0.70.0 fixes two high-severity advisories: ToolOutputLimits with strip_ansi=True and the default jwt redaction pattern ran in quadratic time, so a few hundred KB of attacker-influenced text could block the event loop for tens of seconds to minutes.
New StreamGuardrail screens each streamed text, thinking and tool-call part before the caller sees it, and the new PruneToolResults capability lets the model replace a tool result it just received with a summary.
OpenAIChatModel now raises ModelRequestRejectedError before sending tools to GPT-6 models with reasoning on. Forced tool choice on OpenRouter's qwen/qwen3.8-flash, which rejects forcing while reasoning, now falls back to 'auto' or raises.
A failed run's AgentRunError now carries the conversation, and capture_run_conversation() lets a failed turn be stored. A separate RetryOnModelErrors capability retries the same model on transient model API errors.
Terms in this piece · Glossary
agent harness — The scaffolding around a model that turns it into a working agent — the loop, the tools it can call, and the rules for when to stop.