Repository navigation
feat(bedrock): run Bedrock models with a saved AWS credential - #9932
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
[Critical impact] The PR appears safe to merge; no new actionable issue was found. SummaryAdds saved workspace AWS credentials for Bedrock calls from Agent, Router, Evaluator, and Translate.
|
Collaborator
Author
Collaborator
Author
|
@cubic-dev-ai review this PR |
Contributor
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
… resolved A resolved saved-credential session on the provider request is used alone, passes its session token, and never falls back to inline keys or the deployment's own AWS credentials. Its client cache key names the credential and session expiry plus a digest of the key material, never a raw secret.
…ck model calls resolveBedrockCredentialSession runs the shared credential-use authorization, then loads the credential only within its workspace and only as a live AWS credential, resolving it to the stored key pair or a fresh STS session and recording the credential access.
…credential A saved credential resolves to fresh session keys every run, so the binding names the credential instead; requests without one hash exactly as before.
… saved AWS credential A block's bedrockCredential is authorized and resolved for the run's acting user within the workflow's workspace before the provider call; a failure fails the call instead of falling back. The session stays off fallbacks on another provider.
…drails operations Translate (llm_chat) and the guardrails hallucination check resolve a selected Bedrock credential for the acting user before the scoring or chat call, the same way the executor handlers do; a credential that cannot be used fails the call before any provider work.
…redential fields Agent, router, evaluator, and translate get an AWS Authentication choice for Bedrock models: access keys (the default, and what every existing block keeps) or a saved AWS credential picker, following the Vertex credential pattern.
…esolves blank A block whose AWS Authentication is a saved credential, but whose credential field resolves empty at run time (an empty reference), fell through to inline keys or the deployment's own AWS credentials. The agent, router, evaluator, and translate blocks now share one selector that refuses that case, and honors an explicit access-keys mode over a stale credential ID.
…of filling the shared client cache An assumed or keyless role resolves to a fresh STS session on every call, so a session-keyed cache entry was never read again and pushed other providers' warm clients out of the shared LRU. Long-lived saved keys stay cached. The session type now derives from AwsSessionCredentials, and authorization refusals carry a reason.
…igning A block signs with a saved AWS credential only when bedrockAuthMode is 'credential', the same rule that shows and serializes the picker. The agent test no longer leaks a persistent mock rejection.
…mbing The Guardrails block evaluates its provider credential conditions without values, so its Bedrock fields never render or serialize; the param could only arrive outside the shared auth-mode rule.
…ard it Guardrails and Pi spread the shared provider credential fields and inputs but never pass a saved credential to their call, so the AWS Authentication choice and credential picker are now opt-in. Agent, Router, Evaluator, and Translate opt in; Guardrails and Pi keep the fields and catalog schema they had before.
- Translate resolves the saved credential only for a Bedrock model, so a leftover credential choice no longer blocks a call to another provider. - A transient STS failure resolving the credential reports 503 instead of 400, using the classification the AWS tool operations already share. - llm_chat forwards the run's execution ID to the resolver, naming the role session and the credential-access audit after the run. - Native conversation binding keys a saved-credential request on the credential alone, ignoring inline keys left on the block. - Handler tests share one central mock for the Bedrock credential module; the block declaration test is replaced by Translate behavior tests. - The integration suite writes its credential-access audit inside a rollup scope and asserts it before teardown.
waleedlatif1
force-pushed
the
feat/bedrock-saved-aws-credential
branch
from
November 12, 2026 13:25
eb0e862 to
6da9081
Compare
Collaborator
Author
Collaborator
Author
|
@cubic-dev-ai review this PR |
Contributor
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
This branch was successfully deployed
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.
Summary
getProviderCredentialSubBlocks({ bedrockSavedCredential: true })plusBEDROCK_SAVED_CREDENTIAL_INPUTS, and only blocks that forward the credential to their call opt in.bedrockAuthModeiscredential, and that same rule controls which fields the block shows and serializes. Blocks saved before this change have no mode and keep their access keys.resolveAuthorizedAwsCredential/resolveAwsSessionCredentials, and the provider signs with that session (includingsessionToken) alone. A selected credential never falls back to inline keys or the deployment's own AWS credentials. A credential that can't be used, or a credential mode whose id resolves blank, fails the call. In the LLM operation, a caller who may not use the credential gets 401, the same as a Vertex refusal.sts:GetCallerIdentity/ AssumeRole). The region still goes throughvalidateAwsRegion.llm_chatgains one optional hiddenbedrockCredentialparam. Tool metadata is regenerated.Product update (if relevant)
Teams running Bedrock can drop per-block access keys and pick a workspace AWS credential, including keyless IAM roles. Docs: Agent block (AWS Bedrock auth, inference-profile IAM scope, role session lifetime) and AWS credentials guide.
Deploy notes
Roll out every worker, including the trigger bundle, before announcing the option. An older worker ignores a saved-credential selection and signs with whatever inline keys are still on the block, or, on deployments with
NEXT_PUBLIC_BEDROCK_DEFAULT_CREDENTIALS, with the deployment's own AWS chain.Type of Change
Testing
bedrock-credential.integration.tscovers a member resolving its keys, and refusal for no user, a non-member, another workspace's credential, another provider's credential, a revoked credential, and an unknown id.providers/bedrock/index.tscredential selection and caching, andlib/internal/llm/bedrock-credential.tsauthorization.Checklist
Screenshots/Videos
N/A