Repository navigation
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. Scoping the static grant filter by agent fixes the root cause, every lookup fails closed, and the PreToolUse gate is unchanged. Notes
[DESIGN-REVIEWED] c64fddb Description read[DESCRIPTION-READ] 5e611d252d9ee8c532f14941e426f35812bd200d7d7aa3cdeb90ab46cc968278 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — 🔴 changes requested (blocking)Reviewed Blocks: grants on shared agent templates are now kept or stripped based on app manifest state, but updating an app re-derives nothing. So once an app gains session hosting, its profile's denials are bypassed through stale static grants. BLOCKING — src/kiro_crew/platform/governance_profiles.py:1135 [BLOCK-MERGE] c64fddb Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — 🔴 changes requested (blocking)GPT 6.1 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/platform/governance_profiles.py:1171 -- App capability changes leave previously scoped grants active (origin: validation)
[BLOCK-MERGE] c64fddb Adjudication (Opus 5.5) — is blocking on each finding proportionate?The adjudicable block is empty, so there are no regular verdicts. The one fenced finding, F1, stays blocking. I'm not flagging it for override, because the condition chain it needs is ordinary use, not something extreme. F1, unbounded harm (bypasses the governance ceiling):
False positive or not applicable? A repository writer can comment: |
d23f6c1 to
c686ee9
Compare
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS This fix works on the cause: the agent-less "does any profile govern this ref" question. The only extra is a redundant branch at the call sites. Notes
What this change shipsInventory (6 items) — 5 justifiedIntent: stop a governance profile bound to one app from taking away every agent's
[FIRST-PRINCIPLES-REVIEWED] c64fddb Description read[DESCRIPTION-READ] 8bf9a294e1902e4604de9bc9d45bd125bcbce901e1a7c6db769b6be45d627090 That sha256 names the PR description this verdict read. Recompute it with |
|
|
… run The shared-template pass re-filters every crew-bound spec's allowedTools on each start. It asked may_skip_gate_now with no agent, so any profile with an opinion on a ref withheld it from every spec. An app-bound profile with a network.egress rule therefore stripped every @server grant from every agent, though only calls carrying that app's context can resolve to it. The pass, the servers' autoApprove strip and the KAS projection now name the spec. An app-bound profile is left out for it only when all of these hold: the profile switches spawn off, the app is not an in-process runner that drives other agents (auto-improvement), the app cannot open chat sessions on an agent of its choosing (no backend, no permissions.api entry reaching /api/chat, readable manifest), and the app did not register the spec. Any lookup that fails counts the profile. Surface and task binds, fallback profiles, every writer that names no agent, and the builtin floor that withholds fs_read, grep, glob, code and the shell are unchanged.
c686ee9 to
c64fddb
Compare
|
|
Closing this PR: the symptom is fixed in the internal edition instead. The stripped grants came from one bundled app profile whose The branch is left in place for reference. |
Problem / Motivation
Goal: a governance profile bound to one app no longer removes
@serverauto-approvals from agents that app can never run.After an update or restart, every agent lost the
@serverentries in itsallowedTools(and its servers'autoApprove), so each MCP call started prompting again. The host had one app-bound profile that confinesnetwork.egressand switchescapabilities.spawnoff.Why it matters
Every crew-bound agent on such a host is affected, on every start, and the user's own hand-written grants are rewritten away. The prompts it adds come from a profile that, at the PreToolUse gate, can never govern those agents' calls.
Not a goal
fs_read,fs_write,execute_bash,code,grepandglob.surfaceortaskbinds, or the writers that name no agent (build_agent_configand the install paths).What changed (motivation → approach → change)
Symptom → cause. On every start the fork refresh re-filters each crew-bound shared template (
src/kiro_crew/agent_materialization/fork_refresh.py:496, the pass at:888). It asksmay_skip_gate_now(ref)with no agent, which withholds a ref if ANY loaded profile governs it (src/kiro_crew/platform/governance.py:850→src/kiro_crew/platform/governance_profiles.py:1037). A profile with anetwork.egressrule governs every@server, so one app-bound profile stripped every agent. TheautoApprovestrip (governance.py:505) and the KAS read-time re-filter (src/kiro_crew/acp/kas_agents.py:448) asked the same agent-less question.Approach. The gate resolves an
appbind only for a call carrying that app's context. Such a call comes from the app's own agents, a sub-agent the app spawned, a chat session the app opened on an agent of its choosing (POST /api/chat/slotstakes the agent from the request body and stamps the app on the slot,dashboard/chat_api/slot_create.py:155; the agent switch checks only slot ownership), or an in-process runner that drives other agents under its app id. So an app-bound profile is left out for an agent only when spawn is off, the app is not such a runner, the app cannot open chat sessions, and the app did not register the agent. Every lookup fails closed.Change.
appbind, spawn off, app cannot open chat sessions, agent not the app'sappbind whose manifest declares a backend, has apermissions.apientry reaching/api/chat(incl./api/*,*), or does not readappbind, agent registered by the app,<app>--name, or ownership unreadableappbind with spawn left onappbind of an in-process runner (IN_PROCESS_AGENT_APP_CONTEXTS)surface/taskbind, fallback profile, no agent namedgovernance_profiles.py:any_configured_profile_governs(ref, *, agent="")skips a profile_profile_may_bind_agentrules out._app_may_host_sessionsreads the app's manifest (no backend, no/api/chatgrant) and returns True on any doubt. Ownership readsapps.manager_lookup._app_agent_registration; anything but"missing"counts as owned.governance.py:may_skip_gate_nowandstrip_ungoverned_auto_approvetakeagent=and pass it through; with none, every profile counts as before.agent_materialization/auto_approve.py,fork_refresh.py: the shared-template pass names the bound agent for bothallowedToolsandautoApprove.acp/kas_agents.py: the KAS projection asks for the agent it projects.docs/system-specs/modules/governance.md: the rule.Backwards compatibility
Compatible: every writer that names no agent, and every profile other than a spawn-off
appbind, gives the same answer as before.Removes nothing: the change only keeps grants a profile could never govern; the profile's own app agents, the gate's per-call decision and the builtin floor are unchanged.
Tests
test/test_governance_profile_agent_scope.py(new): an unrelated agent keeps@builder-mcpinallowedTools, inautoApproveand in the KAS projection when the app (like the internal tunnel app: one/api/edition/tunnelgrant, no backend) cannot open sessions; an app that can open chat sessions strips it from any agent in all three (test_an_app_that_may_open_chat_sessions_governs_every_agentover/api/chat,/api/chat/slots,/api/chat/slots/*,/api/*,/api/c*,*, the agent-switch route;test_the_kas_projection_governs_agents_a_chat_capable_app_can_run), as does an app with a backend, an unreadable manifest or a manifest lookup that raises; the app's own agent (registered, ambiguous, unverifiable,<app>--name, a lookup that raises) is still stripped; spawn-on and in-process-runner app binds,surfaceandtaskbinds and an unnamed writer still strip; the six floor builtins stay withheld with or without a profile; every literalapp=gate argument in the package is listed as an in-process runner.test_agent_refactor_contracts.py,test_agent_refactor_fork_refresh.py,test_conductor_allowed_tools_survive.py,test_agent_fork_templates.py,test_kas_agents.py,test_kas_permissions.py,test_kas_tools_settings.py,test_mate_worker.py,test_mcp_confirm_tools.py._app_may_host_sessionscheck removed and pass with it. Governance, KAS, fork refresh, agent refactor, conductor and mate-worker suites: 2616 passed;test_mcp_confirm_tools.py: 140 passed. flake8, isort, black, mypy, comment-history, brand, line-cap, docs-lint: clean.Proof: PROVEN test/test_agent_refactor_contracts.py::test_every_pre_split_name_resolves_with_its_pre_split_shape, test/test_governance_profile_agent_scope.py::test_the_kas_projection_scopes_by_agent[missing-True] (head c686ee9)
Manual verification
N/A — unit coverage sufficient: the decision is a predicate over loaded profiles, driven through the real shared-template pass and KAS projection.
Not verified: an end-to-end start of the internal edition with its app profile.
Related Issues
No issue found. Searched open and closed issues and PRs for "allowedTools MCP removed restart", "profile governs every server", "any_configured_profile_governs". Regression from #18811. Reported by a user of the internal edition in Slack.
Sibling sweep
Swept: git grep -nE "may_skip_gate_now(|any_configured_profile_governs(" -- src/
Sibling: src/kiro_crew/agent_materialization/fork_refresh.py:888 -- changed here
Sibling: src/kiro_crew/platform/governance.py:505 -- changed here (agent= is threaded; the shared-template pass passes it)
Sibling: src/kiro_crew/acp/kas_agents.py:448 -- changed here
Sibling: src/kiro_crew/agent_parts/spec_build.py:612 -- not affected -- build_agent_config serves every installer and names no single agent, so every profile still counts
Sibling: src/kiro_crew/dashboard/chat_api/slot_create.py:155 -- not changed -- an app picks any agent for its slot; this PR counts such apps instead of narrowing the route
Sibling: src/kiro_crew/apps/bridges_agents.py:190 -- not affected -- an app's own agents, which its own profile must keep governing
Pattern harvest
Rule candidate: review-prompt
Pattern: a static grant filter that asks "does any profile govern this" without the subject the grant belongs to over-applies scoped profiles globally.
Checklist