Hot AI News

Claude on Amazon Bedrock can now be forced to return valid JSON

Amazon Bedrock now enforces JSON schemas during generation for Anthropic's Claude models, on both of its endpoints, and adds strict tool use for agents.

Claude on Amazon Bedrock can now be forced to return valid JSON
Image: Amazon

Amazon has made structured outputs generally available for all Anthropic Claude models on Amazon Bedrock. According to the AWS Machine Learning Blog, the schema is enforced during token generation, so responses are valid JSON that matches the structure a developer defines.

Schema enforcement at generation time, on both endpoints

AWS says the feature works on both the bedrock-runtime and bedrock-mantle endpoints, wherever the model is available. It relies on constrained decoding: the model is prevented from emitting tokens that would break the schema, instead of having its output checked afterward. AWS describes this as a shift from probabilistic to deterministic formatting.

The glass Amazon Spheres on Amazon's Seattle headquarters campus, seen from the street in bright sunlight.
Photo: SounderBruce / Wikimedia Commons, CC BY-SA 4.0

Two mechanisms are offered. The JSON Schema output format controls the shape of a response and suits data extraction, reports and API responses. Strict tool use validates the arguments of a tool call against its schema, which AWS positions for agentic workflows and function calling.

On bedrock-runtime, the schema goes into output_config.format of an InvokeModel request as a JSON object, not a string. For strict tool use on bedrock-mantle, a developer sets strict: true on the tool definition. AWS’s own example uses the Anthropic SDK’s AnthropicBedrockMantle client.

AWS lists several practical consequences: no JSON.parse() errors, enforced field types, required fields always present, and no retry logic for schema violations. It also says that limiting output to the schema’s fields reduces output tokens and can lower inference costs in high-volume workloads. The post gives no figures for that saving.

Advertisements

Limits that decide whether your schema qualifies

Every object must set additionalProperties: false, or the schema is rejected. Supported features include the basic types, enum, const, anyOf, allOf (with limitations), internal $ref references and common string formats such as date-time, email and uuid. Arrays accept minItems only with values 0 and 1.

Several keywords are accepted but not enforced, and the request still succeeds: recursive schemas, external references, numeric limits such as minimum and maximum, and string length limits. AWS tells developers to validate these in their own code. That caveat matters for anyone hoping to drop validation entirely.

Two cases can still yield non-conforming output: a refusal on safety grounds, and a response cut off at max_tokens. AWS recommends checking the stop reason on every response. Its examples do this before parsing.

The first request with a new schema may be slower, because Bedrock compiles a grammar artifact. That grammar is cached per account for 24 hours. Changing the schema’s structure triggers a recompile, while changing only names or descriptions does not. The feature also works with batch inference and streaming, and with cross-Region inference on bedrock-runtime.

The post’s examples use Claude Sonnet 5.5 for lead extraction and Claude Haiku 5.5 for support ticket classification, with enums fixing the category, priority and sentiment labels. It does not list per-model or per-Region availability, nor any extra price. Whether schema-constrained requests cost more, or slow down on very complex schemas, is not established in the announcement.

Bedrock catches up with Anthropic’s own API

The announcement is a delayed arrival rather than a new capability for Claude. Anthropic’s own documentation describes the same two features, JSON outputs through output_config.format and strict tool use. Third-party write-ups date Anthropic’s public beta to November 2025, behind a beta header and initially for Sonnet 4.5 and Opus 4.1. The same naming on Bedrock suggests developers can reuse request shapes between the two.

Bedrock itself began with other model families. A February 2026 launch, covered by Classmethod and listed in the Bedrock User Guide, brought structured outputs to selected serverless models from Mistral, Qwen and DeepSeek, along with strict tool use. Claude now joins that list, which makes the feature available across a wider part of the Bedrock catalog.

The pattern fits Bedrock’s recent emphasis on machine-readable results. Amazon recently put TwelveLabs’ Pegasus 1.5 on Bedrock to turn long videos into timestamped JSON, and the platform has been adding third-party models such as Grok 4.7. For teams building agents on bedrock-mantle, guaranteed tool arguments remove one common failure point. Those claims about reliability come from AWS and have not been independently tested.

Sign Up for the Daily AI Pulse

One email a day. All the stories that matter.

Alex CarterAI News & Big Tech Correspondent

Alex Carter writes for Aiholics, keeping readers updated on the fast-paced world of AI and Big Tech.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may also like