[GH-ISSUE #4841] [BUG]: AWS Bedrock - API Key in Docker #3049

Closed
opened 2026-02-22 18:32:25 -05:00 by yindo · 0 comments
Owner

Originally created by @timothycarambat on GitHub (Jan 8, 2026).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/4841

Originally assigned to: @timothycarambat on GitHub.

How are you running AnythingLLM?

Docker (local)

What happened?

When using the API Key method in AWS Bedrock, you actually need to use an API key and an IAM to sign the request. This is pretty stupid since this ultimately becomes the same as just using a low-privilege IAM without an API key.

AWS Diagram:
Image


Proposed Fix

When using the AWS Bedrock API key method in the bedrock/utils.js

function createBedrockRuntimeClient(authMethod, credentials) {
  const clientOpts = {
    region: process.env.AWS_BEDROCK_LLM_REGION,
  };
  if (authMethod === "apiKey") {
    clientOpts.token = credentials;
    clientOpts.authSchemePreference = ["httpBearerAuth"];
  } else {
    clientOpts.credentials = credentials;
  }
  return new BedrockRuntimeClient(clientOpts);
}

AWS does the following list of checks -https://github.com/aws/aws-sdk-js-v3/blob/f5048a6665591d98e2c21c9ef9cd179a904006dd/packages/credential-provider-node/src/defaultProvider.ts#L31-L45

We should return a graceful and obvious error here instead of trying infintely to detect or compensate for this fallback tree.

Are there known steps to reproduce?

Pull in any image from Docker. Use a known working api key that was provisioned by the AWS account.
When using Bedrock with credentials "API Key" see that every message fails with could not load credentials from any providers

Originally created by @timothycarambat on GitHub (Jan 8, 2026). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/4841 Originally assigned to: @timothycarambat on GitHub. ### How are you running AnythingLLM? Docker (local) ### What happened? When using the API Key method in AWS Bedrock, you actually need to use an API key **and** an IAM to sign the request. This is pretty stupid since this ultimately becomes the same as just using a low-privilege IAM without an API key. AWS Diagram: <img width="1080" height="993" alt="Image" src="https://github.com/user-attachments/assets/4f43b0de-b5c8-45aa-a225-62e6f818951d" /> --- Proposed Fix When using the AWS Bedrock API key method in the bedrock/utils.js ```nodejs function createBedrockRuntimeClient(authMethod, credentials) { const clientOpts = { region: process.env.AWS_BEDROCK_LLM_REGION, }; if (authMethod === "apiKey") { clientOpts.token = credentials; clientOpts.authSchemePreference = ["httpBearerAuth"]; } else { clientOpts.credentials = credentials; } return new BedrockRuntimeClient(clientOpts); } ``` AWS does the following list of checks -https://github.com/aws/aws-sdk-js-v3/blob/f5048a6665591d98e2c21c9ef9cd179a904006dd/packages/credential-provider-node/src/defaultProvider.ts#L31-L45 We should return a graceful and obvious error here instead of trying infintely to detect or compensate for this fallback tree. ### Are there known steps to reproduce? Pull in any image from Docker. Use a known working api key that was provisioned by the AWS account. When using Bedrock with credentials "API Key" see that every message fails with `could not load credentials from any providers`
yindo added the bugcore-team-only labels 2026-02-22 18:32:25 -05:00
yindo closed this issue 2026-02-22 18:32:25 -05:00
yindo changed title from [BUG]: AWS Bedrock - API Key in Docker to [GH-ISSUE #4841] [BUG]: AWS Bedrock - API Key in Docker 2026-06-05 14:50:01 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#3049