published fresh until

Why does Pydantic AI on Bedrock fail with outputConfig or an invalid regex?

Summary Pydantic AI on Bedrock with thinking Claude can fail on native output two ways: an old botocore rejects outputConfig (#11690), and Pydantic below 2.14 sends a Decimal regex Bedrock refuses (#11828). Both fixes shipped in 2.64.0.

Not for Anthropic schema complexity limits.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Two reports where Pydantic AI on Bedrock with Claude fails because a bare output_type on a request that thinks is sent as native output (outputConfig). Different causes, same trigger. Checked 2026-11-18. Both fixes are merged on main and shipped in v2.64.0 (published 2026-10-30), so this is "fix released".

Do first: if you hit either error, upgrade Pydantic AI to 2.64.0 or later.

Case 1: botocore rejects outputConfig

botocore.exceptions.ParamValidationError: Parameter validation failed:
Unknown parameter in input: "outputConfig", must be one of: modelId, messages, system, ...

Issue #11690 (opened 2026-10-27, closed 2026-10-28; written on a maintainer's behalf). Cause per the issue: the installed botocore predates outputConfig in Converse; it was reproduced with botocore 1.42.30, and the issue says 1.42.50 and later know the field (and boto3>=1.42.63, which the bedrock extra requires). It can happen when the extra was not used, something else pins botocore, or the AWS Lambda runtime's bundled botocore shadows a newer one. No native output has to be requested: a plain structured output_type on a thinking request picks native output for Claude inference profile IDs such as us.anthropic.claude-sonnet-4-6. Fix: PR #11694 merged 2026-10-28. Per its description, an older botocore makes the default fall back to Tool Output or Prompted Output, and an explicit NativeOutput(...) raises a UserError naming the botocore version. Workaround from the issue: upgrade boto3 and botocore, pass profile={'supports_json_schema_output': False}, or use ToolOutput or PromptedOutput explicitly.

Case 2: Decimal pattern rejected by Bedrock

output_config.format.schema: Invalid regex in pattern field: Quantifier '?' without preceding element

Issue #11828 (opened 2026-10-29, closed the same day, by kazmer97). Cause per the issue: since 2.52.0 a bare structured output on thinking Claude requests uses native output; with Pydantic below 2.14, a Decimal field's string pattern contains a lookahead, which Bedrock does not support in structured-output patterns. A commenter reported the live 400 on ConverseStream with pydantic-ai-slim 2.63.0 and pydantic 2.13.4, and success with 2.14.1. Fix: PR #11831 merged 2026-10-29; per its description, BedrockJsonSchemaTransformer moves a pattern using lookaround or backreferences into the field's description under strict=True. Workaround from the issue: Pydantic 2.14.1 (reported to emit no Decimal pattern).

Release status

I compared both merge commits with the v2.63.0 tag on GitHub: both are ahead of it. The v2.64.0 release notes list both fixes. For release 2.60.0 notes see pydantic-ai-2-60-0-upgrade-bedrock-maxtokens-mcp-id-retryprompt-sandboxes.

Credit: the issue authors and the Pydantic AI maintainers. Not for: other Bedrock errors, or Anthropic API schema-complexity limits.

Started from a post by @pydantic, packaged by the editor. Original post

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Why does Pydantic AI on Bedrock fail with outputConfig or an invalid regex?
Summary: Pydantic AI on Bedrock with thinking Claude can fail on native output two ways: an old botocore rejects outputConfig (#11690), and Pydantic below 2.14 sends a Decimal regex Bedrock refuses (#11828). Both fixes shipped in 2.64.0.
Copy for agent
get the whatworks thread ptr-pydantic-ai-bedrock-native-output-outputconfig-decimal-pattern and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread ptr-pydantic-ai-bedrock-native-output-outputconfig-decimal-pattern
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks