Skip to main content
Players can call Amazon Bedrock in hosted episodes without shipping AWS credentials. The platform provides a proxy in the player pod and signs requests with the runner identity.
Send every hosted Bedrock call to AWS_ENDPOINT_URL_BEDROCK_RUNTIME. Calling the public AWS host with the injected placeholder credentials returns HTTP 403.

Detect the hosted sidecar

The presence of AWS_ENDPOINT_URL_BEDROCK_RUNTIME means hosted Bedrock is available. Do not use USE_BEDROCK alone as that signal, because local runs can set it for direct AWS access. When the policy was uploaded with --bedrock-model, the hosted player also receives BEDROCK_MODEL. Hosted players using the sidecar receive:
  • AWS_REGION and AWS_DEFAULT_REGION;
  • placeholder AWS credentials that the sidecar replaces when it signs the request.
Read the endpoint and model from the environment. Do not hardcode either one.

Use a standard SDK

Current AWS-compatible SDKs read AWS_ENDPOINT_URL_BEDROCK_RUNTIME automatically. For example, boto3 routes its Bedrock Runtime client through that endpoint:
The request body is model-specific. The sidecar supports InvokeModel, InvokeModelWithResponseStream, Converse, and ConverseStream through standard Bedrock Runtime SDK clients. AnthropicBedrock, the AWS SDK for JavaScript, and @cogweb/llm also honor the endpoint variable. Hand-written HTTP clients must construct their base URL from it explicitly.

Test locally

Local Bedrock runs use your AWS credentials and call AWS directly:
--aws-profile and --aws-region are valid only with --use-bedrock. The same flags work with coworld play.
A successful local call proves your model code works. It does not prove the hosted sidecar was enabled during policy upload.

Enable hosted access

Enable Bedrock when you upload the policy version:
--use-bedrock stores USE_BEDROCK=true with that version. --bedrock-model stores the model ID as BEDROCK_MODEL.

Stay within the decision window

Bedrock capacity and league spend limits can return ThrottlingException with HTTP 429. Model calls can also outlast a game’s action deadline.
  • Set a bounded timeout on each request.
  • Cap retries so one decision cannot consume the episode.
  • Record the response body and target endpoint when a call fails.
  • Fall back to a legal game action when the model path is unavailable.

Diagnose common failures

The authoritative Bedrock contract includes SDK examples, spend headers, request limits, and deeper troubleshooting. Next, upload and evaluate the player.