Skip to content

feat/agentcore 4 gateway - #6774

Closed
kyleseaman wants to merge 2 commits into
feat/agentcore-3-awsfrom
feat/agentcore-4-gateway
Closed

kyleseaman wants to merge 2 commits into
feat/agentcore-3-awsfrom
feat/agentcore-4-gateway

Conversation

@kyleseaman

Copy link
Copy Markdown
Contributor

Problem / Motivation

Why it matters

What changed (motivation → approach → change)

Tests

Manual verification

Screenshots / video

Related Issues

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Workload inbound is IAM. kiro-cli cannot sign InvokeGateway, so the
adapter rewrites gateway_mcp_spec onto a 127.0.0.1 listener and
session/new injects that live loopback URL. The unsigned hostname
never reaches the agent file. Login sidecars and consent stay out.
Loopback is same-host, so each hop carries an HMAC-bound session
token. Request-time signing requires the calling session's profile
to still permit AgentCore and the composed posture to be workload
— login uses JWT inbound, not instance IAM.
@kyleseaman
kyleseaman requested review from a team and Zedmor and removed request for a team August 29, 2026 11:40
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Aug 29, 2026
@kyleseaman

Copy link
Copy Markdown
Contributor Author

Opened by accident while trying to rename the AgentCore stack off the cursor/ prefix. The live stack remains #6594–#6602. Closing this duplicate.

@kyleseaman kyleseaman closed this Aug 29, 2026
@github-actions github-actions Bot removed the readiness: checking Automated validation is still running label Aug 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — 🟡 CONCERNS

Premise-level review of 164d6e185c1186cc73318dc1f018f80078fc2dc3 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

All evidence is gathered: the patch, the intent file (an entirely unfilled template), consumer counts for the new endpoints (zero in website/src), and the duplicated Gateway-host parsing across the two new modules. The proxy/inject work matches the stack plan the prior commit's docs promised; the dashboard catalog surface rides along undeclared. Final review follows.

First-Principles-Verdict: CONCERNS

A ~950-line, 3-endpoint dashboard catalog rides along undeclared — zero UI consumers — in a PR whose own docs describe only the SigV4 proxy.

What this change ships

Intent: let kiro-cli call the workload AgentCore Gateway by re-signing its MCP traffic through a localhost SigV4 proxy — an ADDITION (the stack step cloud.md at base explicitly deferred here).

  1. Workload Gateway MCP now works via a localhost SigV4 proxy — justified
  2. Gateway injected per session at session/new, never written to the agent file — justified
  3. Every proxy hop re-checks the calling session's profile ∩ policy, SEL-audited — justified
  4. Rebuild retracts the previously persisted managed-Gateway row; extras lose bearer keys — justified (migration + boundary)
  5. New env var KIROCREW_AGENTCORE_PROXY_PORT — undeclared; ephemeral fallback already handles a busy port
  6. New GET /api/agentcore/gateway operator catalog — rides along, undeclared, zero consumers
  7. New POST /api/agentcore/gateway/verify — duplicate of item 6, zero consumers
  8. New POST /api/agentcore/gateway/sync — rides along, undeclared, zero consumers
  9. Shared-runtime children inject under the child's own profile, not the parent's — justified
  10. ACP_BACKENDS_AGENTCORE_GATEWAY Kiro-only membership set — justified (harness-parity invariant)

Watch

  • The PR description is the untouched template — every section is an unfilled HTML comment, checklist unchecked. The whole inventory is undeclared; intent is recoverable only from the diff and prior stack docs.
  • Items 6–8 (agentcore_inspect.py 745 lines + 207-line handler + 3 routes): grep agentcore in website/src → 0 files; only tests and the RFC reference them. The RFC (docs/request-for-change/rfc-agentcore-identity-gateway.md:296) records the design, which keeps this off BLOCK, but the in-commit spec updates (cloud.md, session.md, governance.md) never mention these endpoints — they belong to the later Settings PR the route comment itself names.
  • Gateway-URL parsing now has two spellings: .gateway.bedrock-agentcore. is defined in both agentcore_sigv4.py:54 (anchored regex) and agentcore_inspect.py:39 (parse_gateway_ref, unanchored — accepts hosts the regex refuses). Count: 2. They will diverge.

Subtractions

  • Defer dashboard/handlers/agentcore_inspect.py, platform/agentcore_inspect.py, and the three system.py routes to the Settings PR that consumes them (0 consumers today).
  • At minimum drop POST /api/agentcore/gateway/verify — it is byte-identical to the GET (inspect_snapshot(include_tools=True) both), differing only in SEL verb; keep the GET.
  • Replace parse_gateway_ref's hand-rolled host parsing with agentcore_sigv4.is_agentcore_gateway_url + region_from_gateway_url, deleting the duplicate GATEWAY_HOST_MARKER.

[FIRST-PRINCIPLES-REVIEWED] 164d6e1

@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — 🟡 CONCERNS

Design-level review of 164d6e185c1186cc73318dc1f018f80078fc2dc3 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: CONCERNS

Sound proxy/inject design, but the new sync endpoint invokes an IAM verb the project's own instance policy deliberately withholds, and the PR description is empty.

Watch

  • POST /api/agentcore/gateway/sync calls SynchronizeGatewayTargets, but the shipped instance policy grants only _AGENTCORE_INSPECT_ACTIONS (GetGateway, ListGatewayTargets, GetGatewayTarget — src/kiro_crew/cloud/iam.py:85), a deliberate exclusion per the base commit ("Inspect is Get/List/GetTarget — no Synchronize"). On the reference workload deployment the button can only ever return aws_denied. Grant the verb in the same series or hold the endpoint until the PR that does.
  • The PR description is the untouched template — problem, approach, and test claims exist only in commit bodies. Fill it; reviewers cannot check description↔diff fidelity against comments.
  • PROXY_MAX_INFLIGHT = 16 overflow is a bare request.close() (agentcore_sigv4.py:223): long-lived streamable-HTTP streams across concurrent sessions/subagents can pin all slots, and the 17th caller sees an unexplained reset instead of a refusal it can surface or retry. Prefer a 503.

[DESIGN-REVIEWED] 164d6e1

@github-actions

Copy link
Copy Markdown
Contributor

Opus 4.8 Review — ✅ no blocking findings

Reviewed 164d6e185c1186cc73318dc1f018f80078fc2dc3 — this comment is updated in place on each push.

Review details

I've now established the key facts to falsify Candidate 1:

  1. The escalation requires a divergent-name restricted child on the AcpClient path. resolve_active_scope(session_key, agent=agent) uses agent to find a tighter task:<agent> profile that beats the surface binding (governance_profiles.py:1251-1254). The candidate's escalation only bites if a crew agent with a distinct task profile denying agentcore is driven while the kiro --agent name differs from that crew name.

  2. Restricted children do not use the client path. Subagents and tasks create sessions via runtime.create_session (SubagentManager._create_shared_session and SessionManager.open_task_session in the diff), which pass crew_agent correctly — and at both call sites agent and crew_agent are the same variable (agent=agent or None, crew_agent=agent or ""). So even on the runtime path the two identities do not diverge at the actual inject call sites.

  3. The other AcpClient consumer (llm_pool) uses a fixed AGENT_NAME and no session_key, so the inject guard (if self._session_key and ...) never fires there.

  4. Inject and recheck are self-consistent: the injected header agent is HMAC-bound and the proxy recheck reads that same header agent. There is no path where a tighter task profile is silently bypassed for a child, because children never reach AcpClient._pooled_mcp_servers.

The candidate's own confidence line concedes it "could not confirm that the AcpClient (non-runtime) inject path is ever exercised for a session whose kiro name and crew-agent name diverge." I cannot re-derive (a) a concrete input that occurs in practice — it resolves to "if a caller were to." Dropped.

No new grounded finding surfaced during falsification that meets the 80+ bar (the secret-stripping, loopback-only, posture, and per-hop recheck paths are all internally consistent and guarded).

No findings.

[OPUS-REVIEWED] 164d6e1

Verdict parsed from the review's SHA-scoped output markers for commit 164d6e185c1186cc73318dc1f018f80078fc2dc3.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 164d6e185c1186cc73318dc1f018f80078fc2dc3: <one-sentence reason>

@github-actions

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of 164d6e185c1186cc73318dc1f018f80078fc2dc3 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 164d6e1

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 164d6e185c1186cc73318dc1f018f80078fc2dc3: <one-sentence reason>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant