← Blog

Allowlist Bedrock Additional Response Field Paths

Parminder Singh
Parminder Singh··6 min read
Summarize with AI

Amazon Bedrock Converse can surface model-native response fields requested through additionalModelResponseFieldPaths. Each entry is an RFC 6901 JSON Pointer, with AWS limits on count and path length. A production route should allowlist exact pointers by model, reject caller-controlled roots and wild guesses, verify required returned fields, and retain requested, returned, and missing paths as separate evidence.

Platform & Architectureai-securityllm-securitycloud-securityarchitecturepolicy-enforcementaudit
Allowlist Bedrock Additional Response Field Paths

Amazon Bedrock Converse normally returns a normalized response envelope. A request can also ask Bedrock to surface model-native fields by listing JSON Pointer paths in additionalModelResponseFieldPaths. Those values control which provider-specific response data appears under additionalModelResponseFields. They belong in server-owned route configuration, because an arbitrary caller-controlled path expands the response contract without review.

I would allowlist exact leaf paths per model version. A generic pass-through turns a useful compatibility feature into an undocumented data-export switch.

TL;DR

  • Permit exact RFC 6901 pointers for the selected Bedrock model or inference profile, rather than accepting caller-supplied paths.
  • Enforce AWS's current maximum of 10 paths and 1-to-256-character length constraint, plus narrower route limits where needed.
  • Treat a valid but absent path as a distinct state because Converse can silently ignore it.
  • Validate and classify the returned additionalModelResponseFields object before any native value reaches downstream code.

Converse accepts a bounded JSON Pointer list

The Amazon Bedrock Converse API reference defines additionalModelResponseFieldPaths as an array of strings. AWS permits as many as 10 members and sets each string's length between 1 and 256 characters. The values select additional model fields that Bedrock returns inside additionalModelResponseFields.

Each string uses JSON Pointer syntax. The current AWS reference says an empty or incorrectly structured pointer produces HTTP 400. A syntactically valid pointer whose target is absent from the model response is ignored by Converse.

Policy must distinguish a returned match from silent absence. It must also record when the request never named the path. Preserve all three outcomes in the decision record. An empty additionalModelResponseFields object cannot tell an investigator which case occurred unless the outbound path set was also recorded.

AWS's Converse user guide gives /stop_sequence as an example for Anthropic Claude. It also explains that most model-native fields are dropped by default to produce a normalized envelope.

JSON Pointer validation is only the first gate

RFC 6901 defines how a pointer addresses a value inside a JSON document. The IETF JSON Pointer standard uses slash-separated reference tokens and defines ~0 for a literal tilde plus ~1 for a literal slash. A valid pointer can still be wrong for the selected model, too broad for the application, or irrelevant to the route.

Validate in this order:

  1. Require an array of unique strings.
  2. Enforce the AWS count and length constraints.
  3. Parse every string as RFC 6901 syntax and reject an empty pointer locally.
  4. Compare the exact decoded pointer with the route allowlist.
  5. Bind the allowlist to the exact model ID or inference profile.
  6. Serialize the final request once and inspect the path list before egress.

Avoid admitting paths by prefix because approving /usage should never make every future child under that object acceptable by default. List the precise leaves the application consumes and review any new field through a route change.

The LLM API parameter allowlisting guide provides the larger outbound reconstruction pattern.

Path policy binds to the model contract

Model-native response shapes vary across Bedrock models. A path reviewed for one Anthropic model can be absent or mean something different on another destination. Store the allowlist beside the model identifier, application route, expected JSON type, sensitivity class, required or optional status, and downstream consumer.

For each approved pointer, define:

  • Exact encoded pointer and decoded tokens
  • Model or inference profile binding
  • Expected returned JSON location and value type
  • Required, optional, or diagnostic-only status
  • Local size and depth limits for the returned value
  • Redaction and retention policy
  • Missing-field disposition
  • Schema review date and fixture identifier

Caller identity can narrow this further. A diagnostic route available to a platform engineer may expose one approved native field that an end-user chat route never requests. The server resolves that distinction after authentication. Browser input should carry no direct path-selection authority.

The per-route AI policies guide shows how identity, operation, and destination can select one reviewed provider contract.

Silent absence requires an explicit decision

AWS says a valid pointer is ignored when the requested field is absent. If the field is required to interpret completion, billing, safety, or a downstream parser, hold the response and raise a compatibility event. If the field is diagnostic-only, delivery may continue with a warning under route policy.

Never substitute a guessed default. A missing Boolean should remain missing rather than becoming false. A missing string should stay absent rather than becoming an empty string. Guessed values turn provider silence into invented evidence.

Record the requested pointer set, the keys actually returned, missing required paths, missing optional paths, parser schema version, model destination, and local disposition. Keep the raw native object in restricted evidence when retention policy permits. A digest and structural summary can support lower-exposure logs.

On an operator screen, show requested paths as blue chips and returned paths as white chips directly below them. Leave a visible hatched slot for every missing required path. That small visual makes silent absence obvious without printing the native values.

Returned native fields need an inbound allowlist

Outbound path approval controls what the request asks Bedrock to surface. Require additionalModelResponseFields to have the expected JSON shape and accept only keys produced by the approved path manifest.

Validate each returned value against its expected type, depth, and local size limit. Preserve unknown siblings for restricted investigation and block any downstream branch that assumes a reviewed schema. Avoid flattening model-native values into the normalized Converse envelope, because a name collision can overwrite fields such as stopReason or usage in application code.

The generic stopReason is authoritative only for the normalized field AWS defines at that location. A native /stop_sequence value can add detail for an approved model, but it should sit beside the normalized reason rather than replacing it. The Bedrock stop reason response policy covers the delivery decision for that generic enum.

The AI audit log schema guide provides common identity, destination, policy, and correlation fields for the resulting decision record.

Release tests prove encoding and absence behavior

Begin with every approved pointer against a provider stub or an approved AWS test environment for the exact model. Confirm the final outbound list and the returned native object.

Add request fixtures:

  • Empty pointer and malformed pointer
  • More than 10 members
  • Path longer than 256 characters
  • Duplicate pointers
  • Unknown but syntactically valid pointer
  • Pointer approved for another model

Add response and middleware fixtures for encoded ~0 and ~1 tokens. Cover a valid path missing from the response, a required field with the wrong JSON type, and an unexpected native sibling. Include an oversized or deeply nested value under local policy, plus middleware that adds a path after validation.

For each fixture, assert the caller response, outbound request, provider-call count, requested and returned path evidence, missing-field set, and final delivery disposition. Test ConverseStream too, because AWS places additional native response fields on the final messageStop event for streaming responses.

DeepInspect

DeepInspect can enforce this path allowlist on authenticated user or agent HTTP requests deliberately routed to Amazon Bedrock. It can bind exact pointers to the selected route and model, rebuild the outbound list, validate returned native fields, and record requested, returned, and missing paths before response delivery.

AWS owns the native model response and Converse extraction behavior. Application owners approve path meaning, sensitivity, downstream parsing, and missing-field dispositions. Direct Bedrock calls, local inference, STDIO traffic, and HTTP paths that bypass the proxy are outside DeepInspect's enforcement boundary.

Book a technical deep dive at deepinspect.ai.

Frequently asked questions

How many additional response field paths can Converse accept?

The current Converse API reference permits 0 through 10 array members. Each pointer string has a documented length of 1 through 256 characters. Applications can set a smaller route limit and should label it as local policy.

What happens when a valid pointer targets a missing field?

AWS says Converse ignores the pointer. The application should compare requested paths with returned fields and apply its own missing-field disposition. Required evidence can hold delivery, while optional diagnostic data can produce a warning.

Should the client choose additionalModelResponseFieldPaths?

A production route should resolve an exact server-owned list after authentication and model selection. Caller-controlled paths change the response schema and can expose native fields that the application never reviewed for sensitivity or parser safety.

Does this field control the model's text format?

AWS says it controls which model-native response fields Converse surfaces. Text-output formatting belongs to other request and model features. A response-field path allowlist should never be presented as a structured-output guarantee.