Conversation
|
@JWThewes thanks for reducing the scope of the PR. I still think we have a design issue and would suggest a refactoring before landing Bedrock IAM. TL;DR This PR touches 71 files not because the feature is large, but because "agent credentials" is a transversal concern with no owning abstraction. Every new auth mode has to be threaded by hand through every layer. I think we should pause this PR, do a small behavior-preserving refactor first, then rebuild the IAM feature on top of the clean base. The expensive/security-sensitive work here is not wasted — it gets re-homed, not thrown away. OK, only ~20 of the 71 are hand-written product code (the rest is ~13 test files, 7 Terraform, 8 zero-line PNG screenshots, 3 dependency/lockfile, and docs). The problem is those ~20: roughly half are edits to existing files just to thread a new
One more risk signal: the shared seams everything depends on — Target arcihtectureIntroduce one new module ( The interface every provider implements CredentialProvider {
id // 'bedrock' | 'kiro' | 'bedrock-iam'
parameterName, inputField, setField // storage descriptor (was PROVIDER_CONFIG)
normalizeBinding(raw) // replaces: normalizeCredentialBinding + the IAM authType branch
prepareEnv(cred, ctx) // replaces: auth-resolver + spawn + mcp-secret-resolver + clients env branches
display(cred) // replaces: intents/index.js + 2 frontend display branches
redeem(claims, ctx) // replaces: credential-broker's STS/IAM branch
}
PR 1 — Prep refactor (behavior-preserving, backend-only)Migrates the two existing homogeneous providers behind the registry. No behavior change; existing tests stay green. Small diffs. New (3 files)
Edited (3–4 files, mostly shrinking)
Tests (1–2 files) — add coverage on the currently-untested seams ( ≈ 7–9 files, small diffs, no frontend / Terraform / deps.
PR 2 — Bedrock IAM feature (on the clean base)The hard security logic from the current #452 lifts over almost verbatim, but now lands as one new provider file instead of being threaded through ~15 existing files. New files (mostly lifted from #452 as-is)
Edited (small)
≈ 12–14 files, but the core code delta is one new provider file — versus ~15 edited files today. Expected outcome
Note: this refactor does not shrink the diff. The total across PR 1 + PR 2 is about the same as #452's source footprint (~20 files) — the 71 was always inflated by tests, screenshots, Terraform, and the lockfile, none of which change. So the pitch is not "fewer files." It is that the same work becomes safer today and cheaper tomorrow: a mechanical refactor reviewed apart from the security-sensitive feature, a structural fix for the HIGH env-leak finding, coverage on untested seams, and a next backend auth mode that costs ~one file. @JWThewes What do you think ? |
What changes
AWS deployments can now use IAM roles for Bedrock inference instead of distributing Bedrock API keys. Platform admins choose the authentication mode and can point the platform or an individual space at a dedicated inference role, including a role in another AWS account and region.
Credential lifetime and isolation
IAM defines access; the credential broker uses STS AssumeRole to obtain one-hour temporary credentials. A signed handoff binds each invocation to its execution, provider, role, and region. The runtime cannot assume roles directly, and issued inference sessions explicitly deny further role assumption.
Each invocation exposes an authenticated loopback AWS credential endpoint to its CLI. Credentials and renewal authorization stay in memory. Refresh begins five minutes before expiry, retries transient failures while the current credentials remain valid, and keeps the same CLI process alive. Answering a parked stage after several hours obtains a fresh invocation grant and fresh credentials for its pinned role.
If credentials expire, an independent watchdog stops that invocation's process group, attempts the normal session persistence and Git checkpoint, and reports
bedrock_credentials_expiredthrough the existing durable stage callback. The separate, non-sliding eight-hour invocation authorization limit reportsbedrock_authorization_expired. Other invocations continue independently; there is no key fallback or automatic restart.Related fixes found during verification
cli_failedeven though STS role assumption succeeded. The regression test launches real child processes for all four CLIs.dynamodb:ConditionCheckItemon the execution table for workflow checkpoints. Live investigation found this application-role permission missing independently of inference IAM.Screenshots and live verification
Captured from the existing dev deployment on September 10, 2026. Account identifiers are redacted; browser chrome and unrelated content are cropped. These screenshots show the live configuration and observed results, not proof that every change at this PR head is deployed. No configuration or IAM permissions were changed while preparing this PR.
Platform authentication selection
Setup wizard: connection details, generated policies, and platform verification
The live platform check succeeded in
us-east-1and discovered 27 Claude inference profiles.Space inheritance and cross-account/cross-region configuration
flappy-birdinherits the platform role inus-east-1.casita-thewesuses a space role in a different AWS account andeu-north-1. Its live check successfully assumed the role and discovered 21 Claude inference profiles.Connection checks verify STS and model discovery; they do not invoke models or prove every selected model's inference permissions or Codex availability.
Existing flappy-bird inference and graph enrichment evidence
The inspected Codex intent is pinned to platform IAM. Its intent-capture and reverse-engineering stages produced 12 artifacts; persisted metrics show 12 successful graph-enrichment inference calls. The screenshot shows reverse-engineering awaiting human review. Its separate Quorum failures motivated the working-directory fix above; this is not a claim that those failures have already been fixed in the deployment.
Validation
brace-expansion,js-yaml,hono, andqs; their lockfile entries are identical tomain. The local hook treats these as advisory; this PR does not resolve them.Coverage includes mode selection and key-run compatibility, platform-admin authorization, signed grant/renewal binding, role isolation, AWS credential endpoint authentication, all three Bedrock CLI configurations, application MCP identity, three hours of simulated uninterrupted renewal without replacing the child process, transient/hung renewal failures, process-group termination, typed callbacks, independent invocation cancellation, and paused-stage resumption.
The space-deletion integration test now verifies that IAM configuration is removed with the keys. DynamoDB Local test startup disables telemetry so it does not depend on an outbound telemetry request completing.
Long-duration behavior is tested with a simulated clock rather than a three-hour live soak. Composer uses the shared tested inference path but was not independently exercised in the live space verification. Live screenshots are not an end-to-end validation of all three CLIs.
Rollout
Deploy the application, broker, runtime, and Terraform changes together. Rebuild/publish managed environments from the updated base before assigning them to IAM spaces. An absent platform setting preserves API-key mode for existing deployments. AWS admins apply the wizard's generated policies, verify the connection, enable IAM, and select models available in the target account/region. The application generates IAM setup instructions; it does not provision roles or attach policies itself.
See the setup and lifecycle guide for configuration, revocation behavior, and operational limits.