Repository navigation
feat: AgentCore principal propagation (default-off) - #6595
kyleseaman wants to merge 2 commits into
Conversation
Design Review (Fable 5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS The spec contradicts itself on the dashboard bind: session.md prose says Watch
Suggestions
[DESIGN-REVIEWED] c56fe1a |
First Principles Review (Fable 5) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS Half the new identity surface has zero production consumers — the "do not bind" guarantees the description headlines are enforced by callers omitting Not justified as shipped
What this change shipsInventory (10 items) — 5 justifiedIntent: bind a trusted core-derived "who is this turn?" principal on every human surface, default-off, ahead of AgentCore token vending — an ADDITION (covered by
[FIRST-PRINCIPLES-REVIEWED] c56fe1a |
GPT 5.6 Review — 🔴 changes requested (blocking)GPT 5.6 found at least one blocking issue that must be resolved before merging This comment is updated in place on each push. BLOCKING -- src/kiro_crew/messaging/identity.py:67 -- unified DM sessions bind one human’s principal to other humans (origin: validation) Adjudication (Opus 4.8) — is blocking on each finding proportionate?The adjudicable block is empty (0 findings). Ruling on the one fenced finding, F1. F1 (fenced): The claim is that
🏷️ Fenced finding(s) machine-flagged as likely edge caseThe security fence keeps these findings blocking regardless of adjudication; the only clearance path is a human override. The annotate-only pass judged the condition combination each one requires extreme, and pre-drafted the override rationale below. A repository writer must independently verify a rationale before posting it — it is machine-authored, and a wrong override on a security-class finding ships exactly the class the fence exists to stop.
False positive or not applicable? A repository writer can comment: |
Opus 4.8 Review — ✅ no blocking findingsReviewed Review detailsNo findings. The sole candidate — that repointing [OPUS-REVIEWED] c56fe1a Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
| sessions: Any, | ||
| session_key: str, | ||
| *, | ||
| surface: str | None = None, |
There was a problem hiding this comment.
[P1] Do not make caller identity optional on the shared human-turn hook without updating every caller. In the final stack, Slack, Discord, Telegram, and the generic messaging dispatcher still call publish_turn_identity(sessions, session_key) with neither field, so no principal is stored and login Gateway attach never runs for channel users. Split out a pid-only API for genuinely injected/system turns, require identity here for user turns, and update every surface with its trusted provider user id.
There was a problem hiding this comment.
Rechecked at dc9f141 and through the top of stack: still open. The channel callers continue to omit surface/raw_id, so they never bind a principal or attach login-posture Gateway authorization.
0e30917 to
ab4a21b
Compare
UX Review (Fable 5) — ⏭️ skippedRevision |
ab4a21b to
7736436
Compare
7736436 to
dc9f141
Compare
| # can see it. Pid publication still happens after spawn. Injected | ||
| # envelopes omit surface/raw_id and skip this bind. | ||
| _principal_raw_id = state.owner_id or _dashboard_local_owner() | ||
| _bind_kw = principal_bind_kwargs(message, surface="dashboard", raw_id=_principal_raw_id) |
There was a problem hiding this comment.
[P1] Do not derive the dashboard owner principal for app-token turns. api_chat deliberately passes app-originated work into _run_chat with _directive_user_origin=False, but this bind ignores that provenance and treats any non-prefix message as a human dashboard turn. In login posture a companion can therefore annotate an app-owned slot as the dashboard owner and attach the owner JWT/Gateway authorization. Thread the trusted request provenance into this decision and refuse principal binding for app and other synthetic turns; text-prefix detection is not an authentication boundary.
d6c9db7 to
6df1aa8
Compare
|
Rebased onto main
Gates run locally on changed files: black, isort, flake8, and pytest over the 22 test files this PR touches plus the ones covering the resolved code (3706 passed). Please review the resolutions. A maintainer push makes the maintainer the last pusher, so a second approver is needed under the repo's last-push rule. Reply if anything looks wrong. |
|
Landing here from the other direction. I run a Kiro Crew deployment day to day (multi-repo GitHub work, AWS deploys, a set of autonomous crons), and I worked through an architecture problem this week that lands exactly on what this PR does, so I wanted to add a real-world use case in support of it. The problem I hit: today the crew acts under one baked-in bot identity for every write, no matter who directed the work. That makes attribution untrue (a PR opened because a teammate asked reads as the bot, under my account), it means a self-authored PR cannot be self-approved if branch protection ever needs a review, and it turns the crew into an ambient-authority path: anyone who can reach the control plane inherits the bot's full GitHub and AWS write access. Working through it, the clean principle turned out to be exactly principal propagation: the crew should act as its caller, carrying that caller's identity outward, so the external system's own access control does the enforcing. Against GitHub that means the caller's own token (their writes attribute to them, they reach only what they already can). Against AWS it means a role scoped to the caller. The crew stops being a privilege-escalation path and becomes an accelerant on permissions the caller already holds. Most of what I was reaching for in a bespoke permission model simply disappears once the crew delegates identity to systems that already have access control. Two things from my notes that might be useful as this lands, offered as field input, not a design ask:
Glad to see this being built rather than something I would have had to work around. Happy to test the propagation path against a real multi-repo GitHub + AWS deployment if that is useful once it is far enough along. |
bolichen97
left a comment
There was a problem hiding this comment.
Maintainer review (agent-assisted), pinned to 40567d6. Requesting changes for the identity contract mismatch. The body and session.md paragraph promise a verified dashboard bind, but session.md's table and chat_runner.py:7681-7686 deliberately keep dashboard turns unbound. The only publish_turn_identity call omits the threaded _principal_surface/_principal_raw_id. Core-derived identities and exclusive-DM binding are sound; failure here is safely unbound, not credential leakage.
Keep that safe multi-speaker-slot behavior unless a separately reviewed binding design changes it. Make body/spec agree, remove or explicitly classify the unused plumbing as provenance-only, and add a dashboard-turn regression asserting no principal survives publication. Do not simply wire the opener's identity into a slot another speaker can steer to satisfy the prose. Later stack work must consume the actual contract. Isolated source/test review plus independent inspection of the call; local tests not run this wave.
Partition SessionPrincipal as {surface}+{raw_id} at turn start.
Injected cron/subagent envelopes skip bind. Existing
publish_turn_identity callers that omit surface/raw_id stay
byte-identical. No Gateway attach or AWS in this slice.
CLI identity comes from the process UID or token SID, not environment usernames. Automated turns omit raw_id and publish after session acquire so a concurrent human principal is not cleared mid-stream. Live-credential retract belongs to the later Gateway layer.
|
🤖 Kiro Crew [operator: NicholasRBowers#a942f9ca]: This PR has been inactive since 2026-09-15. I reviewed the blockers and they require your input — every remaining gate on it is a decision, not a mechanical fix:
The mechanical parts are real but downstream of all of the above: the branch is 435 commits behind main with conflicts across 57 files, and When you've addressed these, the pipeline will re-assess on its next cycle. |
|
Open-PR triage, 2026-10-05. Checked against Verdict: DISTINCT, REBASE + CONTINUE-DEVELOPMENT. Nothing on main or in another open PR replaces this one.
The full evidence is archived in the triage run. |
|
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. |
PR 2 of 6 in the AgentCore stack. Session identity must be core-derived and independently reviewable before AWS, Gateway inject, or login attach land.
Token vending and Gateway inbound later key off
SessionPrincipal. If a tool argument or an injected cron envelope can mintdashboard+admin, later PRs inherit that hole. This PR is the trust boundary for "who is this turn?"What changed
SessionPrincipalis{surface}+{raw_id}, derived in core. Tool-input identity is rejected. Injected cron/subagent envelopes do not bind.surfaceandraw_id: dashboard (verifiedrequest["user"]only whenis_dashboard_useris true — neverstate.owner_id), Slack, Discord, Telegram, CLI, and every ChannelTurnprincipal_raw_id.LOGNAME/USER/USERNAME.bind_principal=False) omitraw_idand publish afterget_or_create. Automated turns omitraw_idandpublish_turn_identityclears leftover principal metadata