← Blog

Validate the Service Tier Returned by Amazon Bedrock

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

Amazon Bedrock Converse can return a serviceTier object whose type is priority, default, flex, or reserved. Production clients should preserve the requested and returned values, reject malformed response shapes, and route an unexpected or unknown value to review. The field is response evidence, not proof of entitlement, availability, fallback behavior, performance, or billing.

Platform & Architectureai-securityllm-securitycloud-securityarchitecturepolicy-enforcementaudit
Validate the Service Tier Returned by Amazon Bedrock

Amazon Bedrock Converse can return serviceTier.type beside the model output, metrics, and stop reason. AWS currently defines four valid values for that object: priority, default, flex, and reserved. A client that requests one value and discards the returned object loses a provider-supplied fact about the completed call. A client that treats the value as a billing receipt invents meaning the API datatype does not state.

I would keep both values because that small decision turns a vague latency complaint into a record an operator can inspect.

TL;DR

  • Capture requested and returned serviceTier.type as separate fields for every Converse call.
  • Accept only priority, default, flex, or reserved under the current schema, while retaining unknown future values for review.
  • Treat a missing, malformed, or unexpected value according to explicit route policy instead of silently relabeling it.
  • Use the response as invocation evidence. It does not, by itself, prove entitlement, availability, fallback, performance, or billing treatment.

The response contains a typed service-tier object

The Amazon Bedrock Converse API reference shows serviceTier in both the request and HTTP 200 response. In each location, the object contains a type string. The separate ServiceTier datatype lists the valid values as priority, default, flex, and reserved.

That documented surface supports a narrow validation contract. Parse the response body only after a successful transport exchange, require serviceTier to be an object when your route expects the field, and require type to be a string. Compare the returned value with the schema version your client understands. Preserve the original token before normalization so a future AWS value remains visible.

The response field belongs beside the returned stopReason, model output, request identifier captured from HTTP headers, and local route decision. It should never overwrite the requested value. Request intent and provider response answer different questions.

The LLM API parameter allowlisting guide explains the same principle on the outbound side: approved parameters should survive serialization as a reviewed contract.

Response evidence has a deliberately narrow meaning

The response schema supplies no standalone statement that a returned value proves account entitlement, regional availability, a fallback path, a latency objective, or a billing category. Those claims need their own current AWS documentation and account evidence.

Build the record around what the call actually exposes:

  • Requested service-tier type, including omission
  • Returned raw type and normalized known value
  • Bedrock Region and runtime endpoint
  • Requested model or inference resource
  • HTTP status and provider request identifier
  • Local policy version and authenticated caller
  • Response validation disposition

If a cost investigation starts later, join this record to authoritative billing and account data rather than treating the enum as an invoice line. If a performance investigation starts, use observed timing plus the applicable service documentation.

My blunt opinion is that naming a database column actual_billing_tier from this one field is reckless. Call it returned_service_tier_type, because that is what the evidence says.

Requested and returned values need separate policy states

A strict equality check can be useful, but the result needs more than a Boolean. Define explicit states such as expected match, unexpected known value, unknown value, missing field, wrong JSON type, and response parse failure. Each state should lead to a documented action.

For a high-assurance route, an unexpected known value can hold the output and alert the service owner. A lower-risk route may deliver the output while recording a warning. That choice belongs to local policy. AWS's enum alone supplies no universal fail-open or fail-closed rule.

An omitted request deserves its own state in the record. If the outbound request omitted serviceTier, store that fact rather than inventing default as the requested value. The response can still be retained exactly as received. If your acceptance contract requires a response value, enforce that local requirement explicitly and version it.

Unknown future values need forward-compatible handling. Preserve the raw string, classify it as unknown under the current parser, and stop any downstream logic that assumes one of four meanings. Coercing an unknown token to default creates false evidence and hides schema drift.

The per-route AI policies guide shows how the application can assign different dispositions without spreading provider-specific branches through business code.

Validation belongs after deserialization and before delivery

The response path should validate structure before the model output reaches the user or agent. Start with the HTTP status and media type. Parse JSON with a library that rejects malformed input, then inspect the expected response object. Validate the service-tier member without modifying the provider payload retained for restricted evidence.

A practical decision sequence is:

  1. Correlate the response with the pending operation and authenticated route.
  2. Confirm the expected content type and parse the JSON body.
  3. Read serviceTier.type without applying a guessed default.
  4. Classify the value against the current four-value schema.
  5. Compare request intent with returned evidence under the active policy.
  6. Record the disposition before releasing the output.

On the operations screen, show requested and returned values in adjacent labeled cells. Color only the local disposition badge. Coloring reserved green would visually imply approval or success that AWS does not define on the datatype page.

Keep response validation distinct from prompt and output safety checks. It says nothing about the truth, safety, or authorization of generated content.

Destructive fixtures expose silent coercion

Use a provider stub or captured response fixture so every branch can run in a release test. Begin with each of the four documented values. Then mutate the response to remove serviceTier, remove type, set type to null, replace the string with an array, and supply a future-looking value such as experimental.

Add request-response combinations. Request priority and return default. Omit the request field and return flex. Request reserved and return an unknown value. The expected outcome should come from the route's versioned acceptance policy, rather than an assumption embedded in the test fixture.

Also test an HTTP error, malformed JSON, and a response that passes service-tier validation but carries a terminal application outcome your client rejects. A valid tier token must never bypass stop-reason or content validation.

The release artifact should show the fixture name, raw requested value, raw returned value, parser schema version, decision, and delivery outcome. The AI audit log schema guide provides a useful base for keeping provider facts separate from local conclusions.

DeepInspect

DeepInspect can validate serviceTier.type on Bedrock responses deliberately routed through its authenticated user or agent HTTP proxy. It can preserve request intent, the raw returned token, route identity, policy version, and local disposition before the response is delivered.

AWS remains responsible for the service-tier value it returns and for its account, service, and billing records. Application owners define mismatch handling and retain any evidence outside the proxy. Direct Bedrock calls, local inference, STDIO traffic, and HTTP paths that bypass DeepInspect stay outside this enforcement boundary.

Book a technical deep dive at deepinspect.ai.

Frequently asked questions

What values can Bedrock return in serviceTier.type?

The current AWS ServiceTier datatype lists priority, default, flex, and reserved. Clients should recognize those exact values under a versioned schema and preserve any unknown future string for review rather than mapping it to a familiar value.

Does a returned priority value prove that the account was entitled to priority service?

The ServiceTier datatype defines the returned string, while entitlement requires separate authoritative evidence. Preserve the response value and reconcile account configuration through the AWS controls and documentation that govern the service in your Region.

Should a mismatch always block the model response?

AWS does not define a universal application disposition for a request-response mismatch on the datatype page. Your route policy should decide if an unexpected known value blocks delivery, allows delivery with an alert, or enters review. Record that policy version with the event.

Can serviceTier replace latency and billing telemetry?

The field should sit beside observed latency and authoritative billing records. It identifies the type returned in the response. Performance analysis needs timestamps and the relevant service terms, while cost analysis needs billing evidence tied to the account and invocation.