GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(bedrock): run Bedrock models with a saved AWS credential by waleedlatif1 · Pull Request #9932 · simstudioai/sim

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Agent, Router, and Evaluator blocks (and Translate) can now sign AWS Bedrock calls with a saved workspace AWS credential: access keys, an assumed IAM role, or a keyless OIDC role. The new AWS Authentication choice follows the Vertex service-account pattern. It is opt-in in the shared LLM credential fields: getProviderCredentialSubBlocks({ bedrockSavedCredential: true }) plus BEDROCK_SAVED_CREDENTIAL_INPUTS, and only blocks that forward the credential to their call opt in.
  • One rule decides the auth mode. A block uses a saved credential only when bedrockAuthMode is credential, 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.
  • The credential is checked for the run's user and pinned to the workflow's workspace. It resolves through the existing resolveAuthorizedAwsCredential / resolveAwsSessionCredentials, and the provider signs with that session (including sessionToken) 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.
  • Client caching: an STS session (assumed or keyless role) is new on every resolve, so its Bedrock client is built for that one request and never enters the shared provider-client cache. The Bedrock runtime's default HTTP/2 handler uses an isolated session per request and closes it when the response ends, so a per-request client leaves no socket behind. A long-lived saved key pair is cached under credential id + a digest of the key material, with no raw secrets in the key. Inline-key and default-chain behavior and cache keys are unchanged.
  • The session is never forwarded to a fallback on another provider. Native conversation continuation binds to the credential, not to per-run session keys.
  • Save-time validation reuses the existing AWS credential check (sts:GetCallerIdentity / AssumeRole). The region still goes through validateAwsRegion.
  • llm_chat gains one optional hidden bedrockCredential param. Tool metadata is regenerated.
  • Guardrails and Pi are unchanged: their fields, inputs, and catalog/Copilot schema stay exactly as before. Guardrails evaluates provider credential conditions without values, so its Bedrock fields never render; that bug was already there and this PR leaves it alone. Pi has no Bedrock provider.

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

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other: ___________

Testing

  • Unit tests cover:
    • Bedrock provider credential selection, and role sessions not evicting other cached clients.
    • Agent, router, and evaluator handlers: session signing, fail-closed, no cross-provider leak, blank-id refusal.
    • The LLM operation against the real resolver: session signing, 401 on refusal, 400 on an unusable credential.
    • Conversation binding.
    • Block field visibility for legacy and credential modes, and that the auth-mode rule agrees with what is serialized.
    • Only blocks that forward the credential (agent, router, router v2, evaluator, translate) offer it. Guardrails and Pi neither show nor accept it, and the default shared fields keep access keys only.
  • Integration (real Postgres): bedrock-credential.integration.ts covers 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.
  • Reviewers: focus on providers/bedrock/index.ts credential selection and caching, and lib/internal/llm/bedrock-credential.ts authorization.
  • Backward compatibility: blocks saved before this change have no auth mode, keep showing and using their access keys, and serialize exactly as before. Blocks that don't opt in keep their pre-change schema.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Screenshots/Videos

N/A

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
waleedlatif1 added 15 commits November 11, 2026 19:17
@waleedlatif1
feat(bedrock): sign with a saved AWS credential's session when one is…
7b92aca
… 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.
@waleedlatif1
feat(bedrock): authorize and resolve a saved AWS credential for Bedro…
e88ac2e
…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.
@waleedlatif1
fix(bedrock): bind native conversation continuation to the saved AWS …
8f03506
…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.
@waleedlatif1
feat(bedrock): sign agent, router, and evaluator Bedrock calls with a…
1605a7d
… 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.
@waleedlatif1
feat(bedrock): accept a saved AWS credential in the LLM chat and guar…
5f05a82
…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.
@waleedlatif1
feat(bedrock): offer a saved AWS credential in the shared LLM model c…
adc2d7a
…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.
@waleedlatif1
test(bedrock): keep the LLM operation credential test free of type er…
58b3ec3
…rors
@waleedlatif1
fix(bedrock): refuse a block set to a saved AWS credential whose ID r…
514fce9
…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.
@waleedlatif1
docs(bedrock): document signing Bedrock model calls with a saved AWS …
4f55cd3
…credential
@waleedlatif1
fix(bedrock): build role-session Bedrock clients per request instead …
bdd2bc9
…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.
@waleedlatif1
fix(bedrock): decide the AWS auth mode with one rule for fields and s…
6deea26
…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.
@waleedlatif1
fix(bedrock): refuse an unauthorized saved AWS credential with 401 li…
16ca7ae
…ke Vertex
@waleedlatif1
revert(bedrock): drop the unreachable guardrails saved-credential plu…
2812736
…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.
@waleedlatif1
docs(bedrock): cover inference-profile IAM scope and role session lif…
9ac7f1a
…etime
@waleedlatif1
fix(bedrock): offer the saved AWS credential only on blocks that forw…
d8cf00e
…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.
@vercel

vercel Bot commented Nov 12, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Nov 12, 2026 12:34pm UTC

Request Review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@greptile-apps

greptile-apps Bot commented Nov 12, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issues were found.

Summary

Adds saved AWS credentials for Bedrock calls from Agent, Router, Evaluator, and Translate.

  • Bedrock blocks can choose a saved AWS credential instead of access keys.
  • Workflow blocks and llm_chat resolve saved AWS credentials for Bedrock calls.
  • Bedrock uses saved credentials without caching short-lived role sessions.

Previous threads were unnumbered, so they have no previousFindings entries. waleedlatif1 intentionally kept llm_chat.bedrockCredential hidden because Translate forwards it internally; Greptile accepted that explanation and withdrew the finding. The declaration-only test was deleted and replaced with behavior checks. The three handler tests now share one credential mock.

Review used the full PR range because the previous and current commits had different merge bases with the target commit. Tests and runtime checks were not run.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Block selects saved AWS credential] --> B[Check acting user and workspace]
  B --> C{Credential allowed and usable?}
  C -->|No| D[Fail without using other keys]
  C -->|Yes| E[Resolve AWS signing credentials]
  E --> F{Temporary session token?}
  F -->|Yes| G[Build request-only Bedrock client]
  F -->|No| H[Cache client by credential and key digest]
  G --> I[Call Bedrock]
  H --> I
Loading

Reviews (2) · Last reviewed commit: "fix(bedrock): address review on saved AW..." · Reviewed by Greptile

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

greptile-apps[bot]
greptile-apps Bot reviewed Nov 12, 2026
View reviewed changes
Comment thread apps/sim/tools/llm/chat.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/sim/blocks/bedrock-saved-credential.test.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/sim/executor/handlers/evaluator/handler.test.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@vercel
vercel Bot deployed to Preview November 12, 2026 11:56
View deployment
cubic-dev-ai[bot]
cubic-dev-ai Bot reviewed Nov 12, 2026
View reviewed changes

@cubic-dev-ai cubic-dev-ai Bot left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 30 files

Turn on auto-fix | Re-trigger cubic

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/sim/executor/handlers/agent/handler.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/sim/lib/internal/llm/bedrock-credential.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/sim/lib/internal/llm/bedrock-credential.integration.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/sim/providers/conversation-history.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/sim/lib/internal/llm/operations.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/sim/blocks/blocks/translate.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/sim/lib/internal/llm/operations.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

waleedlatif1 added 2 commits November 12, 2026 04:28
@waleedlatif1
Merge remote-tracking branch 'origin/staging' into feat/bedrock-saved…
f631f2a
…-aws-credential

# Conflicts:
#	apps/sim/tools/generated/tool-metadata.ts
@waleedlatif1
fix(bedrock): address review on saved AWS credential signing
eb0e862
- 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

waleedlatif1 commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1

waleedlatif1 commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

cubic-dev-ai[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cubic-dev-ai[bot]
cubic-dev-ai Bot reviewed Nov 12, 2026
View reviewed changes

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 34 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vercel
vercel Bot deployed to Preview November 12, 2026 12:34
View deployment

This branch was successfully deployed

1 active deployment
Preview — eb0e8628 Deployed Nov 12, 2026 by vercel[bot]
View deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@greptile-apps greptile-apps[bot] greptile-apps[bot] left review comments
@cubic-dev-ai cubic-dev-ai[bot] cubic-dev-ai[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@waleedlatif1
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.