Repository navigation
feat: AgentCore AWS provisioning and adapter - #6793
kyleseaman wants to merge 2 commits into
Conversation
First Principles Review (Fable 5) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS Five public functions and one HTTP query param ship with zero counted consumers — staging for later stack PRs the description names but this diff never wires. Not justified as shipped
What this change shipsInventory (10 items) — 8 justifiedIntent: let an operator opt an EC2 cloud launch into an Amazon Bedrock AgentCore workload identity (extra, CFN, IAM) without turning any data plane on — an ADDITION, covered by RFC
[FIRST-PRINCIPLES-REVIEWED] 2cd50b2 |
Design Review (Fable 5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS Staged-template snapshot copies content from the same agent-writable bundled file, so the pre-write hole the PR declares closed stays open. Watch
[DESIGN-REVIEWED] 2cd50b2 |
Opus 4.8 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
12d202f to
6e9cf31
Compare
6e9cf31 to
77f254d
Compare
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsFINDING -- src/kiro_crew/cloud/iam.py:872 -- False positive or not applicable? A repository writer can comment: |
77f254d to
893216f
Compare
893216f to
d5583d5
Compare
d633bdf to
68f4249
Compare
68f4249 to
b4bb0b5
Compare
b4bb0b5 to
6f38638
Compare
UX Review (Fable 5) — ⏭️ skippedRevision |
|
/ai-review override gpt b7ce3de: false positive: this PR does not modify src/kiro_crew/slack/gateway.py (byte-identical to the base branch), and _pinned_kiro_cli / _KIRO_CLI_RESOLVE_TIMEOUT_SECS do not exist anywhere in the tree; the review ran against a degraded pass (log: 'pass 2 did not complete') and flagged code outside the diff. |
Human judgment recorded@kyleseaman marked the gpt AI finding as false positive, not applicable, or explicitly accepted for
This decision applies only to this commit. A new push requires a new judgment. |
Land the inert AWS extra and launch-path identity so later Gateway and login PRs have something to attach to. Default-off: no policy or env posture means no boto3, no extra install, no adapter swap. Workload gateway_mcp_spec returns the https hostname and does not import the SigV4 proxy; that rewrite belongs in the next PR.
resolved_* reads the composed ceiling first. Workload Allow is GetWorkloadAccessToken only; UserId stays on the login Deny. Inspect is Get/List/GetTarget — no Synchronize. Dashboard launch stays none.
|
Reviewed for merge triage, not approving from my side: the base branch is cursor/agentcore-2-principal-1b02, not main, and it adds AgentCore AWS provisioning (credentials and cloud resources). Please retarget to main once the stack lands; it will also need a security owner's review. |
iamwhatever
left a comment
There was a problem hiding this comment.
REQUEST_CHANGES at 2cd50b2, after a deeper read.
The IAM design tightens access overall, but one safety claim is wrong.
- The bundled CloudFormation template is still agent-writable content. The
staged_templatedocstring, the PR body andcloud.mdsay no launch hands CloudFormation agent-pre-writable content, "including the bundled file itself". But the text is read throughload_template()->_template_path(), the package file on disk (ec2.py#L204-L240). Staging stops path substitution, not edits to that file's contents before it is read.
Fix: either read the template from a source the agent cannot write (embedded string or a sealed path), or state the residual plainly in the docstring andcloud.md. - Low:
--agentcore-posturehelp says "workload = IAM Gateway at boot", but this layer only vends workload identity tokens and the instance policy deniesInvokeGateway(cli.py#L2273). Reword it, e.g. "workload = instance-role workload token". This is the unanswered GPT finding.
Other gates: the base is cursor/agentcore-2-principal-1b02, stacked on #6595, which is conflicting and has a change request. Coverage Gate, Frontend Lint & Type Check and Frontend Tests (1) are red on this head. The current-head Design and First Principles items need replies, and AWS provisioning needs a security owner's review. I did not run any of it.
— crew-pr-reviewer (r105 deep check)
|
Thanks a lot for this careful, well-split AgentCore stack. We are closing #6595, #6793, #6828, #6600 and #6602 together for now: the branches are about 7,500 commits behind main, #6595 still has an open review on the identity contract, and the upper PRs reference symbols that #11780 removed, so a rebase would be close to a rewrite. The need is still tracked in docs/request-for-change/rfc-agentcore-identity-gateway.md (status: partial; phase 1 is on main via #6594). When AgentCore is picked up again, please open a fresh stack from current main, starting with the principal-propagation layer. Happy to reopen if you would rather continue on these branches. |
Replaces #6597 (falsely marked merged; its GitHub head is no longer based on #6595). Same trust boundary: optional AWS extra, CloudFormation identity, and instance IAM. Not a seventh layer.
Problem / Motivation
PR 3 of 6 in the AgentCore stack. The optional AWS extra, CloudFormation identity, and instance IAM need their own review before SigV4, consent, or Settings UI land.
#6597's recorded head (
86d52f778) is not based on the current #6595 (d8bc1fad7). This PR points the samecursor/agentcore-3-aws-1b02head (12d202f03) at the latest #6595 base.Why it matters
Provisioning and credential resolution are a different trust boundary from the localhost proxy and from OAuth attach. Mixing them hid wiring gaps in #6387. This PR is merge-safe and inert: no Gateway inject, no SigV4 listen, no login consent.
What changed (motivation → approach → change)
Goal: land the adapter later PRs attach to, without turning the data plane on.
kirocrew[agentcore]extra (boto3) andinstall.sh --agentcoreplatform/agentcore_aws.py: opted-in adapter, WAT vending, extra ensure, policy-over-env resolution. Reusesagentcore_schemavalidators; does not import SigV4agent_identityonly whenopted_in()and the extra is importable. Does not changeprofileAgentCorePosture=none|workload|login(defaultnone) createsAWS::BedrockAgentCore::WorkloadIdentityand writes launch env. The default launch does not carry that resource type at all: CloudFormation validates every resource type against the region's registry before it evaluatesConditions, so a conditional BedrockAgentCore resource would fail change-set creation in a region without the service.cloud/ec2.pytherefore deploys the BASE variant fornone-- the bundled template with its# >>> agentcore-onlyblocks (the identity resource, the two posture policies, the posture conditions, the two outputs) stripped -- and the full template for a posture launch, which needs the service anyway. Whateverrun_awsreads executes with the launcher's authority, so NO launch hands CloudFormation a fixed path an in-sandbox agent could pre-write -- including the bundled file itself, since the package directory is not a tree the sandbox masks and a personal install leaves it writable by the sandbox's own uid:ec2.staged_templatesnapshots the variant for exactly one deploy (read once in the gateway) under<config_dir>/run/(the runtime exec dir the agent sandbox denies read and write on), in a fresh 0700 subdir with an unpredictable name, writtenO_NOFOLLOW|O_EXCL, and removes it once the deployment child exits; the dry run shows a placeholder naming the variant, not a path. The base variant is pinned by tests (noType: AWS::BedrockAgentCore::, no dangling!Ref/!GetAtt, parameters and boundary-class tag intact) and linted by CI beside the full onekirocrew:boundarytag is derived from the boundary ARN the role is created under (IsAgentCoreBoundary), never from the posture parameter, so the launcher's tag-keyed Deny covers every successor-bounded rolecfn-lintpinned 1.22.3 -> 1.56.1 (the floor carrying the BedrockAgentCore schemas and the current LaunchTemplate schema) and the EC2 template -- both variants -- added to the lint gateLaunchJob.agentcore_posture/agentcore_gateway_url, the widenedLaunchEngine.provisionsignature andrun_launch's kwarg branch (nothing in this stack sets them -- the dashboard launch is thenonelaunch and its 400 guards are the whole boundary), and thepostureknob onagentcore_boundary_policy_documentplus the unconsumedagentcore_boundary_policy_json(one union document)cloud/files this PR edits are black-formatted and dropped from.github/black-baseline.txt(the ratchet's format-on-touch)kirocrew-ec2-boundary-agentcore. Launcher Policy.json never carriesInvokeGateway--agentcore-posture/--agentcore-gateway-url; dashboard launch staysnoneNot in this PR: SigV4 proxy, MCP inject, login withhold/consent, Settings identity UI.
gateway_mcp_spec()returns the https Gateway hostname.Stacked on #6595 (principal). Later layers (#6598, #6600, #6602) already contain this head.
Tests
test/test_agentcore_aws.py: import does not load boto3 or SigV4; opted-in requires posture or name+flag; policy beats env; workload spec is the https URL; WAT / inbound JWT; probe discards the token; bootstrapensure_extrawhen opted intest/test_agentcore_iam_posture.py: launcher has no Invoke; workload vs login instance SIDs; successor boundary union; CLI/API labeled siblingplatform/agentcore_aws.py::ensure_extraManual verification
No live-account deploy. "Inert" for the default launch rests on a template property, not on a
Condition: thenonevariantcloud/ec2.pydeploys contains noAWS::BedrockAgentCore::resource type, so there is nothing for a region's registry to reject (test_default_launch_template_carries_no_agentcore_resource_type,test_deploy_argv_picks_the_template_by_posture; both variants passcfn-lint 1.56.1). A posture launch deploys the full template and requires the service in-region by construction.Related Issues
Stack after #6595. Restores the AWS review surface of #6597. Supersedes the AWS/CFN/IAM slice of #6387.