← Blog

Bind Amazon Bedrock Async Output to an Approved S3 Policy

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

Amazon Bedrock StartAsyncInvoke requires an outputDataConfig and currently represents it as a union with an S3 output member. An authenticated submission gateway can validate the selected output location before the request reaches AWS, but durable authorization still belongs in IAM, S3 bucket policy, and KMS policy after submission. This guide binds the destination to caller, model, tenant, and data class while keeping later AWS execution outside DeepInspect scope.

AI Security Solutionsai-securityllm-securitycloud-securitypolicy-enforcementidentity-and-authorizationarchitecture
Bind Amazon Bedrock Async Output to an Approved S3 Policy

Amazon Bedrock StartAsyncInvoke accepts the model input now and writes the result later. Its request requires outputDataConfig, and the current API shape represents that field as a union with an S3 output configuration. The destination therefore crosses two control planes. An authenticated HTTP policy can decide which S3 location the caller may select at submission time. IAM and the S3 bucket policy must continue enforcing that destination after the POST has returned. The KMS policy must continue enforcing it too.

TL;DR

  • Resolve the async output bucket and prefix from trusted route policy. Resolve its owner and encryption requirements there too.
  • Rebuild outputDataConfig after caller authentication; reject unapproved destinations before AWS credentials are attached.
  • Bind destination policy to the model and tenant. Bind it to the data class and client token too. Include the final request digest in that binding.
  • Keep post-submit S3 writes under IAM and bucket policy controls. Keep them under KMS controls too. The submission proxy cannot govern later AWS data-plane activity.

StartAsyncInvoke makes output configuration mandatory

The Amazon Bedrock Runtime StartAsyncInvoke API reference documents an HTTP POST to /async-invoke. The request requires outputDataConfig. It also requires modelId and modelInput. It accepts an optional client request token plus tags. A successful response returns an invocationArn.

AWS describes outputDataConfig as the location where output will be stored. The separate AsyncInvokeOutputDataConfig API reference defines the object as a union, so only one member can be specified or returned. Its documented member is s3OutputDataConfig, a storage location for output data in an S3 bucket.

Those provider facts establish the request shape and identify S3 as the current output mechanism. They do not decide which enterprise bucket or prefix a finance or support workflow may use. A production service needs that authorization in local route policy and AWS resource policy.

Destination choice is an authorization decision

Accept a business operation such as claims-summary-async, then resolve the S3 destination on the server. Route policy should identify the exact bucket and allowed key prefix. It should define the expected owner account when available in the selected S3 configuration and the required encryption posture. It should also specify the destination AWS account and Region. The model set and caller roles belong in the same policy. Avoid presenting a free-form S3 URI as harmless configuration.

Parse the destination with an S3-aware library. Compare the bucket exactly and apply prefix checks only on path boundaries. Preserve key case and reject ambiguous encodings or suffixes. Rebuild the outbound outputDataConfig from accepted components before SigV4 signing.

Keep input classification in the decision. A destination approved for public product copy should never receive output derived from payroll records merely because both calls use the same model. The per-route AI policies guide provides the structure for joining the caller and operation in one decision. The provider route and model belong in that decision, along with data policy.

My blunt opinion is that an account-wide output bucket with caller-selected prefixes is a data-routing bypass wearing a storage label.

Prefixes need tenant and purpose boundaries

Design output prefixes around opaque tenant IDs and named workload purposes. A useful policy record can bind the opaque tenant-7f2a and claims-summary identifiers to a release identifier without exposing a customer name or prompt detail. Allocate one normalized prefix and reject sibling or parent paths.

An approved tenant-7f2a/claims/ prefix must reject tenant-7f2a/claims-archive/ and another tenant's path. It must also reject the bucket root. Apply one versioned normalization function during policy compilation and request evaluation.

Tags can carry correlation metadata but should exclude model input and customer text. They should also exclude access tokens and regulated identifiers. Bind permitted keys and values to route policy.

Use the optional clientRequestToken to make repeated submission of one logical invocation idempotent. Persist the token and destination tuple before attempt one. Persist the model ID and canonical request digest too. A retry that changes the output prefix should become a local conflict. The safe idempotent LLM retries guide covers the ambiguous-response case in detail.

AWS policies enforce the later write

The HTTP gateway can reject an unapproved destination in StartAsyncInvoke. Its authority ends after the routed submission reaches Bedrock, which writes output without passing later data-plane actions through the same HTTP decision point.

Constrain the AWS identity and resource policies involved in that write. Grant only required S3 actions over the approved bucket and prefix. Restrict principals and accounts in bucket policy. Restrict transport and destination scope there too. Apply KMS policy when the bucket uses a customer-managed key.

S3 retention and replication need separate owners. Event notifications and downstream readers need separate owners too. An approved output destination says where Bedrock may write; reader authorization remains separate.

The AWS Bedrock security guide explains the larger shared boundary between request authorization and AWS account controls. Use the gateway for the submitted choice. Use AWS policy for durable access.

Audit evidence should join request and destination

Create an invocation record before sending the POST, then retain the caller, operation, model ID, destination account, bucket, and normalized prefix. Record the expected owner, encryption policy reference, tag set, client token, route-policy version, and final request digest. Store modelInput only under a separate retention decision.

After HTTP success, attach the returned invocationArn. Preserve each transport attempt so an unknown outcome can be retried under the original token and destination. The local operation ID connects the provider ARN to business purpose and destination approval.

On the review screen, render the bucket as a blue cylinder with its full prefix beside it in monospace. Put the tenant ID and model ID below. Mark a changed path segment in red so a one-directory escape is immediately visible.

The AI audit log schema guide supplies route, identity, policy, and correlation fields for this evidence.

Destructive tests must cross the storage boundary

Begin with an authenticated request that resolves to one approved model and S3 destination. Capture the final wire body and assert the complete outputDataConfig immediately before signing. Then mutate one property per fixture.

  • Replace the approved bucket with another bucket in the same account.
  • Move the prefix one directory above its approved root.
  • Substitute a neighboring tenant identifier.
  • Change key case or add an encoded path separator.
  • Select the correct bucket under an unexpected owner account.
  • Pair the destination with an unapproved model or caller role.
  • Reuse the client token after changing the prefix or model input digest.
  • Add an unapproved tag containing customer text.
  • Drop the HTTP response, then retry with the original destination and token.

Finally, attempt a direct S3 write outside the prefix and require AWS to deny it.

Run the final test against AWS policy. It proves that later S3 activity has an independent enforcement owner.

DeepInspect

DeepInspect can inspect authenticated user or agent HTTP calls deliberately routed to StartAsyncInvoke. For each submitted S3 output location, the gateway can resolve or allowlist the destination and bind it to identity, model, tenant, and data policy. A destination change can then be rejected, while the returned invocation ARN remains attached to the final request evidence.

AWS owns asynchronous model execution and the later S3 write. The application and cloud platform teams own IAM and bucket policy. They also own KMS and retention. Event consumers and direct-access paths remain their responsibility. S3 traffic after submission and HTTP calls that bypass the proxy remain outside DeepInspect's enforcement boundary.

Book a technical deep dive at deepinspect.ai.

Frequently asked questions

Can a caller choose any S3 bucket accepted by the API?

Provider syntax and enterprise authorization answer different questions. Resolve or allowlist the bucket and prefix under the authenticated route and model. Bind that choice to the tenant and data class. Reject every other destination before signing the outbound request.

Does outputDataConfig protect the S3 object after submission?

No. It tells Bedrock where to store output. IAM permissions and S3 bucket policy govern the object after the asynchronous write begins. KMS policy and retention controls continue governing it. Reader authorization remains separate.

Should the output prefix contain a customer name?

Use opaque tenant and workload identifiers. Human names and prompt-derived text spread sensitive context into request logs and provider metadata. They also spread it into S3 inventory and event notifications. Operator screenshots can expose it too.

What should be retained after StartAsyncInvoke succeeds?

Retain the caller, route, model, approved destination tuple, owner, and encryption references. Keep the client token, request digest, policy version, attempt records, HTTP outcome, and returned invocationArn. Store model input under a separate data-retention decision.