Repository navigation
feat(llm-helper): AWS Bedrock as the second backend - the SDK's Bedrock client, IAM credentials, the anthropic. model prefix, no server-side fallbacks - #111
Merged
Conversation
…ck client, IAM credentials, the anthropic. model prefix, no server-side fallbacks llm.backend: 'bedrock' builds AnthropicBedrockMantle from @anthropic-ai/bedrock-sdk (a dev dependency beside @anthropic-ai/sdk) over the AWS credential chain (or a Bedrock API key in AWS_BEARER_TOKEN_BEDROCK), with the region from llm.aws.region or AWS_REGION - without one the helper answers 503 AWS region missing instead of starting a call. A bare model id is sent with the anthropic. prefix, an id already spelled for Bedrock as written; server-side refusal fallbacks are never sent there; a call whose credential chain is empty is a 503 AWS credential missing by name, as thrown or as the cause of the SDK's connection error; llm.health reports the region and resolves the chain the way a call would, without spending a token. The backend seam carries it (backendFor; the backend is now built asynchronously), so the routes and the contract are unchanged; the shared vector file gains three Bedrock cases (66, byte-identical with the Python pack) and the client, region and credential checks are pinned by tests that run with no AWS environment at all. The secret guard read the lock file's @aws-sdk/credential-providers package name as a credential assignment; a human-audited .agent/secret-scan-ignore exempts package-lock.json, the guard's documented hatch for a generated file.
acn-ericlaw
added a commit
that referenced
this pull request
Oct 14, 2026
… (the Python twin #43); the live drive pending Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
acn-ericlaw
added a commit
that referenced
this pull request
Oct 14, 2026
…e drive is the thread's remaining step Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
AWS Bedrock as the LLM helper's second backend, selected with
llm.backend: 'bedrock':AnthropicBedrockMantlefrom@anthropic-ai/bedrock-sdk(a dev dependency beside@anthropic-ai/sdk, installed next to it outside this repository) over the AWS credential chain through IAM, or a Bedrock API key inAWS_BEARER_TOKEN_BEDROCK; the region fromllm.aws.regionorAWS_REGION(without one,503 AWS region missinginstead of a call); theanthropic.prefix for a bare model id, an id already spelled for Bedrock sent as written; no server-side refusal fallbacks (Bedrock offers none); a call whose credential chain is empty a503 AWS credential missingby name, as thrown or as the cause of the SDK's connection error;llm.healthreportingregionand resolving the chain the way a call would, without spending a token.The seam the helper was built with carries it:
backendFor(name, client)gives a route its model spelling, its fallback support and its credential check, and nothing else in the module knows which route answered; the backend is now built asynchronously, since the Bedrock package is imported only when it is selected. The routes and the contract are unchanged. The shared vector file gains three Bedrock cases (66, byte-identical with the Python twin mercury-python #43, whose harness installs its fake under the named backend's shape the same way); the Bedrock client, its region and credential checks are pinned by tests that run in a process with no AWS environment at all.Why
The AI SDLC epic resumes with AWS Bedrock as its first sprint: enterprise security policies forbid a vendor API key, so the AI node's access to the models rides the cloud platform's own credential chain - the concept doc's Q2, absorbed at client construction only, the engines untouched. The open thread
llm-helper-bedrock-iamdescribed exactly this shape; this PR builds it. The live drive - a wrong credential first, then real calls through an engine - needs an account with Bedrock model access and follows separately.A note on the secret guard
The pre-commit secret guard read the lock file's
@aws-sdk/credential-providerspackage name (a dependency of the Bedrock SDK, 23 occurrences) as a credential assignment and blocked the commit. A human-audited.agent/secret-scan-ignorenow exemptspackage-lock.json, the guard's documented last-resort hatch for a generated file that cannot be restructured; the guard names the exemption on every run, and the file holds registry URLs and integrity hashes only.Gates
npm test(the build andnode --test) 190 green - no token spent, no credential neededCo-Authored-By: Claude Fable 5.1 noreply@anthropic.com
🤖 Generated with Claude Code