Repository navigation
feat: AgentCore dashboard identity settings - #6602
kyleseaman wants to merge 2 commits into
Conversation
Design Review (Fable 5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS Revocation proof hinges on duplicated private-attribute PID probes; a provider shape they miss makes Save → Off "confirm" revocation vacuously. Watch
Suggestions
[DESIGN-REVIEWED] ecef629 |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
UX Review (Fable 5) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS "Preview what Save grants" and "Verify connection" read as one shape-shifting button on one renamed panel; the blind reader couldn't tell them apart. Watch
Suggestions
[UX-REVIEWED] ecef629 |
First Principles Review (Fable 5) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS
Not justified as shipped
What this change shipsInventory (10 items) — 8 justifiedIntent: let the crew's owner see and configure this crew's AgentCore identity from Settings → Security, with Save → Off provably revoking Gateway access — an ADDITION, whose shape the base already records (
More rode along than fits ten (command-palette entries, capture script + committed screenshots matching the 29 existing sibling directories, 13 i18n catalogs, dashboard-restart drain reorder); these ten are what a person would notice. No test pin is deleted anywhere in the diff — the two rewritten [FIRST-PRINCIPLES-REVIEWED] ecef629 |
Opus 4.8 Review — ✅ no blocking findingsReviewed Review detailsBoth candidates die under falsification: Candidate 1 ( Candidate 2 ( No findings. [OPUS-REVIEWED] ecef629 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
34b091d to
278ee6c
Compare
8d26108 to
b891ba3
Compare
b891ba3 to
1da8e02
Compare
| extra_code = await asyncio.to_thread(ensure_extra) | ||
| applied = await asyncio.to_thread(apply_agentcore_runtime) | ||
| if applied: | ||
| await asyncio.to_thread(_rebuild_agent_after_apply) |
There was a problem hiding this comment.
[P1] Revoke live sessions after an identity policy change. Rebuilding only affects the next session/new; existing ACP sessions retain the previously injected Gateway URL and proxy/bearer headers, so Save -> Off does not actually remove access. After a successful hot-apply, reset the live sessions and invalidate/stop the workload proxy so the new ceiling takes effect immediately.
a5d746e to
50de9d0
Compare
50de9d0 to
f210526
Compare
Security Scope Review -- 🟡 CONCERNSWhich legitimate operations does Verdict basis: the reviewer's own judgement; no confirmed regression. Security scope review -- adjudicated candidates
No candidate flipped from allowed to refused. candidates.json is written (16 rows probing the Scope-Verdict: CONCERNS TIGHTENING: The crew-home keystone path fence ( ADJUDICATED: 16 candidates, 0 confirmed newly-refused PLATFORM COVERAGE: posix and windows rows were written in pairs for every path-shaped probe: the UNADJUDICATED: Four parts of this tightening live outside the shell tool-call composite, so no verdict exists for them and the empty confirmed set is not evidence there:
[SCOPE-REVIEWED] ecef629 |
GPT 5.6 Review —
|
GPT 5.6 Review —
|
Owner-dashboard GET/PUT /api/agentcore/identity writes the home policy row and hot-applies the extra. Settings → Security shows posture, catalog verify/sync, and pending 3LO consent. Inert when identity is off.
Revalidate signed or distributed home policy under the exclusive lock before rewriting it. Session cleanup cannot skip proxy revocation. Save → Off persists a disabled row when identity came from the environment, and GET still returns retained Gateway fields from that row so re-enable cannot delete them. RFC workload grant matches the narrowed IAM: no ForUserId mint, no SynchronizeGatewayTargets. proxy.stop waits for signed in-flight requests and closes unauthed sockets so they cannot pin Save. Force-kill of a hung provider runs off the loop. Identity PUT rejects a nonempty gateway_url that is not an AgentCore Gateway MCP hostname. The exclusive staging file is locked down while empty, fsync'd before close, and unlinked if lockdown or Windows replace fails so a stranded .tmp cannot brick later Saves.
|
Maintainer note: PR #11780 (merged 2026-09-19, This PR is MERGEABLE, but on this head |
bolichen97
left a comment
There was a problem hiding this comment.
Blocking merge until this is rebased onto post-#11780 main and the removed-symbol references listed in my comment above are dropped. Textually the merge is clean, so nothing else would stop it from breaking main at import time.
|
Reviewed for merge triage, not approving from my side: the base branch is cursor/agentcore-5-login-1b02, not main, it is ~9k lines of identity settings, and bolichen97's changes-requested review is still open. |
|
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. |
Stacked PR 6 of 6. Trust boundary: dashboard management UI for this crew's AgentCore identity.
What this PR does
Owner-dashboard
GET/PUT /api/agentcore/identityreads and writes the homesecurity_policy.jsonrow (capabilities.agentcore) and hot-applies the AWS extra. Fleet env overrides, signed documents, and cache-only policy distribution (KIROCREW_POLICY_CACHE_ONLY) are refused (409policy_not_writable), not rewritten. The home-file persist takessecurity_policy.json.lock(sensitive leaf,O_NOFOLLOWopen). The rewrite createssecurity_policy.json.tmpwithO_EXCL|O_NOFOLLOW. A leftover regular.tmpunder the exclusive flock is reclaimed; a planted staging link or junction is refused. Publish retries the Windows sharing-violation window and unlinks the staging file if lockdown or replace fails, so a stranded exclusive.tmpcannot brick later Saves. Save → Off writes a disabled AgentCore row even when identity was env-only, so revoke is not skipped. GET still returns retained Gateway fields from that disabled row so re-enable cannot delete the URL._write_reason/_file_rowon PUT run inasyncio.to_thread. App tokens cannot GET or PUT.Successful apply recycles sessions and stops the SigV4 proxy on a worker thread (
asyncio.to_thread), waiting forproxy.stopso Save → Off cannot return while a revoked session still reaches Gateway. A failed agent-config rebuild is HTTP 503agent_rebuild_failed; live sessions and the SigV4 proxy are still dropped because apply already succeeded.Settings → Security adds the Agent identity rail: posture, workload name, Gateway URL, catalog verify, and pending 3LO consent (allowlisted URL from PR 5). Gateway target sync is not shown: the standard instance role omits
SynchronizeGatewayTargets.POST /api/agentcore/gateway/syncremains only behindKIROCREW_AGENTCORE_GATEWAY_SYNC=1.This PR's unique diff versus #6600 is the identity handler, Settings rail, i18n, inspect operator-gate, synchronous proxy stop off the event loop, and three pieces the review rounds added:
POST /api/agentcore/gateway/preview+ "Preview what Save grants". Before this, the catalog card only rendered after Save, so the person pressing Save was granting a tool list they could not see (the UX blind-reader refused to press it: "I don't understand the consequences well enough"). The endpoint is owner- and capability-gated, validates the drafted URL exactly as the PUT does, reads the Gateway and its targets through the same control-plane calls asGET /gateway, persists nothing, creates no identity, and reports tools aslisted_after_save. One consumer (GatewayPreviewCard).Grant N targets: …(Login:Allow N targets after sign-in: …) and the consequence line names exactly those targets. Changing the URL or posture invalidates the preview and re-locks the commit. Per-target tool counts are not shown because the identity that lists tools does not exist before Save; the copy says so.allow_source/allowlist_path. The sign-in card said the host was "checked against the allowlist", which the reader could not verify; the payload now says which allowlist admitted it (a built-in provider, or the operator'soauth_endpoints.jsonby path). Read-only provenance; consumed by the card.atomic_write.unlink_with_retry. Windows sibling ofreplace_with_retryfor the.tmpreclaim path; one consumer.allchunk budget 11620 → 12300 KB (website/scripts/check-bundle-size.mjs). The identity panel's copy adds 202,936 B of translated strings across the 13 catalogs; rebased onto main0cbe2d4cathe stack below this PR buildsallat 11,778,497 B and this PR at 11,981,433 B (11701 KB), 81 KB over the ceiling main set on 2026-09-10. The chunk holds the same 14 modules before and after (no library reached it; catalog strings cannot leaveallthrough a lazy boundary), so per the file's own convention the ceiling moves to ~5% headroom over the measurement, with the attribution recorded in the entry's comment.The ten frames under
temp-screenshots/agentcore-identity/are committed so the<img>links below resolve at a pinned SHA of this branch (the same convention the 13 sibling directories already use); they are review evidence, not shipped assets, and are regenerated by the capture script. Channel / Tailscale / PDF / tips / companion / sidebar files that appear in the vs-mainstack view belong to earlier layers, not this leaf.Inert by default
Identity off / no policy row = Settings shows Off and writes nothing. Verify stays a no-op without a saved Gateway URL.
Save → Off proves revocation. Session teardown captures each provider's PID before shutdown, escalates any shutdown failure (not just a timeout) to the force-kill, and confirms the process is gone; a survivor makes the awaited revoke fail, so the PUT answers 503 with
restart_requiredinstead of reporting credentials revoked while a detached child still holds its Gateway bearer.Screenshots
Rendered from the shipped component against API fixtures by
website/scripts/capture-agentcore-identity.mjs(real strings, one frame per state the code can actually be in).Off / unset — the select with consequence-first option labels, the reversibility line beneath it, and the
Agent identity · Offrail entry:Unsaved edit — Workload picked, name and Gateway URL typed, nothing saved. With a Gateway URL the commit waits until "Preview what Save grants" has listed the targets, then restates the scoped grant on the button itself while keeping the anchor the reader learned (
Save — grant 2 targets: ticketing-mcp, payroll-lookup, the same control in the same shape) with the matching consequence beneath it. That line names what the grant IS and what still governs every call after Save -- signed only for a live chat whose policy allows AgentCore, the crew's normal tool approval, every decision in the audit log -- so nobody is asked to authorize "every tool" sight unseen or to guess whether anyone checks afterwards:Workload — Workload name (helper text visible) and Gateway URL inputs, Save, Verify connection, nine green checks, a READY target, the tools list through the SigV4 proxy, Copy debug summary:
Login — the Gateway sign-in card names the waiting target and the sign-in host and says this is the sign-in that counts; the tools section explains that Login tools show up in the chat where the person signed in (so this page lists none) and points back at the link above; the
Tools are reachablecheck is not shown under Login, since this page never lists tools; the target row's own link readsSame sign-in as above:Needs relaunch / install failed — a saved Workload whose hot-apply could not finish: the relaunch warning and the AgentCore-support install failure, both as notices:
Name required — Workload picked with the name left blank (the field shows an example,
e.g. kirocrew, so an empty field never reads as typed): the "set a workload name" warning, and the line beside the disabled Save restates that gate (nothing recorded, nothing granted until the workload has a name) instead of describing a Save the reader cannot press:No install channel — saved, but this install has no channel through which the AgentCore extra could be installed: the notice names the manual step:
Empty Gateway — every check green on a Gateway with no targets yet; the empty-targets and empty-tools copy point at the Gateway console, not at this page:
Write-blocked — a fleet-signed ceiling: every control disabled, ownership stated:
Failing verify — denied control-plane call: red invoke check with its code hint, the target listing error mapped through the same hint vocabulary, and the tools section deferring to the failed check above instead of offering a third remedy:
Source:
temp-screenshots/agentcore-identity/.security_policy.json.bak(same floor/mask as.tmp) BEFORE the publish, a failed dest lockdown rolls back by one atomic replace of that snapshot (Windows retries, re-read verify), and dest is never written into -- noO_TRUNCrewrite that a mid-write death could leave truncated. If even that replace cannot land, dest stays the whole published document and.bakkeeps the snapshot for recovery; the next successful Save clears it.Out of this PR
Tests
Identity API: cache-only refuse, locked persist, successful apply resets sessions and waits for proxy stop. Inspect: sync is 403
sync_not_permittedunless the operator env is set. SigV4:reset_workload_proxywaits forstopto finish. SecurityPanel vitest: catalog verify works and the sync button is absent.Part of GitHub stack #6830. Supersedes the monolithic #6387.