← Blog

Allowlist the Exact Model ID on Every Bedrock Route

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

Amazon Bedrock InvokeModel places modelId in the request path, but that value can identify several kinds of inference target. A production route should resolve an authenticated operation to one exact approved ID or ARN, reject caller-controlled substitutions before egress, pair the route rule with AWS IAM, and preserve the requested target and policy version in every decision record.

Platform & Architectureai-securityllm-securitycloud-securityarchitecturepolicy-enforcementzero-trust
Allowlist the Exact Model ID on Every Bedrock Route

Amazon Bedrock InvokeModel puts modelId directly in POST /model/{modelId}/invoke. That path can identify several target classes. AWS accepts base and imported models, inference profiles, prompt versions, and provisioned resources. Marketplace endpoints and custom deployments also qualify. A route that accepts any syntactically valid value gives the caller more destination authority than the application intended.

My blunt opinion is that a provider token with broad Bedrock access is an operational convenience, never a model authorization policy.

TL;DR

  • Resolve each authenticated application operation to an exact server-owned Bedrock model ID or ARN.
  • Bind each allowlist entry to the AWS account, Region, endpoint, and inference mode. Store its policy version with it rather than matching a friendly model-family prefix.
  • Use AWS IAM as a second boundary. Cover both bedrock:InvokeModel and bedrock:InvokeModelWithResponseStream where denial must include Converse.
  • Record the original request and resolved target separately. Do the same for the IAM principal, route decision, and provider result.

Model ID selects more than a foundation model

The Amazon Bedrock InvokeModel API reference defines modelId as a required URI parameter. Its meaning changes with the target. A base model can use a model ID or ARN. An inference profile accepts its ID or ARN. Prompt management requires a prompt-version ARN. Provisioned throughput and imported models use their respective resource identifiers, as do custom model deployments.

That variety is useful, but it defeats a shallow check such as startsWith("anthropic."). An inference profile may represent cross-Region routing. A prompt ARN binds a managed prompt resource. A custom deployment carries an account-scoped resource identity. The route policy should classify the target form first, then compare the complete normalized value with the form approved for that operation.

AWS maintains the current base model ID catalog. Treat the catalog as discovery input. Presence in the catalog shows that AWS recognizes a model; it says nothing about your application's approval.

The route manifest owns destination selection

Build an immutable manifest during deployment. Each application operation should resolve to one reviewed Bedrock target and its surrounding request contract. Keep raw modelId overrides out of caller input.

A useful manifest entry contains:

  • Application route and authenticated role
  • AWS partition and account, plus Region and Bedrock Runtime hostname
  • Exact model ID or ARN plus classified resource type
  • Permitted invocation API and streaming mode
  • Approved project identifier and guardrail binding, plus service tier where applicable
  • Request schema version and local body limits
  • IAM role or workload principal expected on egress
  • Policy version and approver, plus activation time and rollback reference

The LLM API parameter allowlisting guide covers reconstruction of the wider outbound request. Here, modelId is a destination field even though Bedrock places it inside the URL path.

At runtime, authenticate the caller, select the operation, load the manifest entry, and construct the Bedrock request from that entry. Compare the final serialized path with the approved target immediately before egress. This last comparison catches middleware that rewrites the URL after the initial policy decision.

Exact matching prevents family and resource drift

Prefix and substring rules are brittle because Bedrock identifiers contain provider names and model families, plus versions and Regions. They also contain accounts and resource types in different combinations. Approving a family prefix can admit a later version without review. Approving every ARN in one account can mix provisioned capacity with custom or imported resources that carry different operational assumptions.

Normalize only representation details with documented equivalence. Preserve the original value alongside the canonical comparison key. Never replace an inference profile with a base model merely because both names contain the same family token.

The manifest can allow several exact targets for a controlled failover route, but each target needs its own Region and evidence. It also needs its own resource type. The per-route AI policies guide shows how identity and operation select a narrow destination set without exposing provider routing controls to the caller.

On an operator screen, put the application route in a white label and the exact modelId in a monospace blue strip. Put the IAM role beneath it. A red outline should surround the full unexpected identifier. Truncating the ARN to its final token hides the account and resource-type fields investigators need.

IAM supplies a separate provider boundary

Route enforcement and AWS IAM answer different questions. The route policy decides which authenticated user or agent may send this request to this approved target. IAM decides which Bedrock actions the AWS principal may perform on provider resources.

AWS's identity-based policy examples explain an important denial detail. To deny inference on selected modelId resources, policy must deny both bedrock:InvokeModel and bedrock:InvokeModelWithResponseStream. AWS says this also denies access through the corresponding Converse actions.

Use least-privilege IAM resource statements where the target supports them, then test the effective policy with the actual runtime principal. Keep the route manifest narrower when one workload role serves several application operations. IAM configuration is in the AWS control plane; the request gateway should consume its approved evidence rather than claiming to configure or replace it.

Release tests mutate the complete target

Start with one permitted request for every manifest entry. Capture the authenticated identity, selected operation, final host and path, and AWS principal. Also capture the provider request identifier and response status. Store the active manifest digest with them.

Then mutate one destination field at a time:

  • A different base model version from the same provider
  • A valid model in another family
  • An inference profile substituted for a base model
  • A prompt ARN or custom deployment ARN on the wrong operation
  • The approved resource in another Region or account
  • A malformed, empty, encoded, or oversized path value
  • Middleware that changes modelId after policy evaluation
  • Streaming invocation when only non-streaming access was approved

Assert that rejected cases produce zero Bedrock calls. Run IAM negative tests independently, including direct SDK calls with the workload principal. The gateway test proves route enforcement, while the direct test proves the provider boundary. Preserve both results in the release record.

DeepInspect

DeepInspect can enforce the model ID route allowlist on authenticated HTTP traffic deliberately routed through its proxy to Amazon Bedrock. It can bind caller context to an exact destination manifest, reconstruct the outbound path, block substitutions before egress, and write a per-decision audit record containing the requested and resolved target.

AWS owns Bedrock IAM, resource availability, inference profiles, and the model response. Application and cloud teams approve the manifest and IAM policy. Direct Bedrock calls, local inference, STDIO traffic, and HTTP requests that bypass the proxy are outside DeepInspect's enforcement boundary.

Book a technical deep dive at deepinspect.ai.

Frequently asked questions

Is every Bedrock base model ID safe to allow?

No. AWS's catalog identifies supported base model IDs and their properties. Your route manifest still decides the exact model and version. It also decides the Region and operation the application may use. Catalog membership is provider metadata, not enterprise authorization.

Should an inference profile share an allowlist entry with its base model?

Give the profile its own entry. An inference profile is a distinct invocation target and can represent routing behavior that differs from a direct base-model call. Preserve the profile ID or ARN requested on the wire rather than rewriting the evidence to a related base model.

Can IAM replace the route allowlist?

IAM constrains the AWS principal. A shared workload role may still serve callers with different application permissions. The route allowlist binds the authenticated user or agent to an application operation. It evaluates the request context against a narrower target before the provider call.

What should happen when AWS adds a new model version?

Keep it blocked until the team reviews its identifier, Region availability, request schema, and IAM coverage. The review should also cover safety configuration and application behavior. Add a new manifest entry and test it. A family prefix should never turn catalog publication into automatic production authorization.