Skip to content

fix(kas): let a sub-agent spawn reach approval - #14063

Merged
chenmingwei23 merged 1 commit into
mainfrom
fix/kas-subagent-spawn-9024
Sep 26, 2026
Merged

chenmingwei23 merged 1 commit into
mainfrom
fix/kas-subagent-spawn-9024

Conversation

@iamwhatever

@iamwhatever iamwhatever commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

On the KAS backend, an agent can never spawn a sub-agent. The spawn is refused with Denied automatically: Sub-agent: <name> claims to run a command, but its command could not be verified., and the model is told the user rejected it. No command was involved and no human was asked.

Why it matters

Every KAS agent that delegates is broken, including the bundled pptx-maker specs. Neither allowedTools nor approval_mode gets past it, so there is no workaround.

What changed (motivation → approach → change)

Two independent defects. Either one alone still leaves the spawn refused.

A. allowedTools never granted the subagent capability. acp/kas_permissions.py CAPABILITY_BY_TOOL keyed the grant on KAS's internal toolId invoke_sub_agent. allowedTools carries Crew's (kiro-cli's) name, use_subagent, so no {"capability": "subagent", "effect": "allow"} rule was ever projected. The key is now use_subagent, and only that. A second spelling would be a ref the governance ceiling is never asked about under the Crew name: the ceiling filters allowedTools by ref before this table reads it, so an alias could obtain the grant the ceiling withholds. The other keys were checked the same way: web_fetch and web_search are the same name on both sides; disclose_context is KAS's skill tool and Crew has no name of its own for it, so it stays.

B. The permission request was refused as an unverifiable shell call. KAS's spawn tool_call frame (_meta.kiro.kind: "agent-subtask") is intercepted by AcpSessionHandle._handle_kas_subagent for the sub-agent roster and never reaches the shared parser, and its toolCallId is synthetic (invoke_subagent_<id>). So every toolCallId-keyed cache misses, the request arrives with shell_classified=False, and cli_chat._unverifiable_shell refuses it before _can_prompt. The classification is on the request itself, in the engine-written _meta.kiro block:

"_meta": {"kiro": {"toolId": "invoke_sub_agent",
                   "consent": {"capability": "subagent", "resource": "kirocrew-lite", "askType": "implicit"}}}

_dispatch.build_permission_event gains kas_consent_meta, set only by the two transports when the backend is KAS. On a shell-cache miss, kas_consent_classification kas_consent_tool resolves the request to "not a shell call" when every field agrees: the toolId is invoke_sub_agent, the consent capability is subagent, consent.resource names the target agent, and no command rides along (KAS sets that field only for a shell call). It also sets tool_name to the Crew name use_subagent, so the deny floor, auto_deny_tools and the tools ceiling are asked about the tool, not only its title, and carries the target as AcpEvent.spawn_target. It never sets is_shell True, never overrides a cache hit, and grants no params or identity provenance (raw_params_trusted and mcp_identity_trusted stay False). Anything else stays unclassified and keeps the refusal. The deny-by-default gate in HookManager.on_tool_call is unchanged. A classified spawn then reaches the normal path: a prompt when a human can answer, the honest "needs approval, and this invocation cannot ask" when not.

C. The spawn policy holds on both paths. A capabilities.spawn policy is not a tools rule, so neither the projection nor the gate could see it:

  • Prompt path: HookManager.on_tool_call judges spawn_target (threaded once, through hook_gate_kwargs) against capabilities.spawn: the gate on and the target in its agents scope, the same two questions subagent._vet_spawn_governance asks on Crew's own spawn path. It is judged inside _governance_denial on the ceiling and profile that call already resolved for the tools question, so no second profile resolution runs on the event loop, and the profile is the calling agent's (a profile bound to the spawning agent's name applies). An evaluation error refuses the spawn. It runs before any grant or prompt, on every surface that uses the gate. An event with no spawn_target (every other backend) is not spawn-vetted, so their gate is unchanged.
  • Auto-approve path: an auto-approved spawn raises no request, so the check above would never run for it. The shared governance.may_skip_gate now withholds use_subagent while the ceiling or any configured profile restricts capabilities.spawn (off, or any scope), through a new BUILTIN_TOOL_CAPABILITIES map. Every allowedTools writer asks that predicate, so the grant is withheld on every backend and channel: kiro-cli's own spec, the KAS wire projection, and the permissions block written to disk. Those spawns are asked about instead. With no such policy, nothing changes on either backend. Placing the check in the shared predicate is the approach fix: let a KAS sub-agent spawn be approved #9053 took (BUILTIN_TOOL_SCOPES).

Notice. _unverifiable_shell's CLI notice said "claims to run a command" for any refusal. It now says that only when the request's kind reads as a command; an unclassified request reads "could not be identified as a known tool call". The model-facing "The user rejected this tool call." is KAS's own text for any rejection (acp-server.js), so Crew cannot reword it; with both fixes the spawn is no longer rejected.

File Change
src/kiro_crew/acp/kas_permissions.py use_subagent replaces invoke_sub_agent as the sub-agent key
src/kiro_crew/acp/_dispatch.py kas_consent_tool; kas_consent_meta on build_permission_event
docs/system-specs/modules/acp-client.md the KAS consent-meta exception to "the shell cache is written only from a backend kind"
src/kiro_crew/acp/session_handle.py, client.py pass kas_consent_meta when the backend is KAS
src/kiro_crew/acp/types.py, providers/acp.py spawn_target on the event, forwarded by the provider
src/kiro_crew/hooks.py spawn_target in hook_gate_kwargs; the gate vets it against capabilities.spawn
src/kiro_crew/platform/governance.py BUILTIN_TOOL_CAPABILITIES; may_skip_gate withholds use_subagent under a restricting spawn policy
docs/system-specs/modules/governance.md the capability-governed builtin rule
src/kiro_crew/cli_chat.py the notice names what failed

Backwards compatibility

Breaking, narrowly: a spec listing the KAS toolId invoke_sub_agent in allowedTools no longer projects the subagent rule. Such a spec now logs a WARNING at projection naming the entry and the fix (list 'use_subagent' instead); its spawns prompt until then. Writer sweep on origin/main @ 5bbc6f7: no spec, fixture or doc in the repository lists it; the only occurrence was the table line itself. Every non-KAS backend reads permission frames exactly as before: the new classification is off unless the backend is KAS. On a host whose ceiling or a profile restricts capabilities.spawn (off, or scoped), use_subagent is now withheld from auto-approve on both backends: those spawns prompt, and on KAS are vetted against the spawn policy. With no such policy, kiro-cli is unchanged.

Tests

  • test/test_kas_permissions.py TestTheSubagentToolIsKeyedOnTheCrewName: use_subagent produces the subagent rule; invoke_sub_agent produces none and warns with the fix; use_subagent warns about nothing; the ceiling is asked about use_subagent.
  • test/test_kas_subagent_permission.py: the real KAS 2.24 spawn frame classifies as non-shell, carries tool_name="use_subagent" and passes _unverifiable_shell; an auto_deny_tools: ["use_subagent"] rule denies it (fails with the name removed); it earns no params or identity provenance; only invoke_sub_agent is known; eight disagreeing shapes (shell toolId, shell or wrong capability, missing consent, unknown or missing toolId, a command present) and four malformed _meta blocks stay unclassified; the same frame on a non-KAS backend is refused as before; a cached shell verdict is never overridden and its missing command is still denied; a real shell with no command is still denied; AcpClient sets the flag only for KAS.
  • test/test_governance_chokepoints.py: a KAS spawn is denied when spawning is off, judged on its stated target under an agents scope, not denied on an ungoverned host, and an event with no target is not spawn-vetted; use_subagent is withheld when spawning is off, scoped, or restricted by a profile, on both kiro-cli (agent._may_auto_approve) and the KAS projection, and kept when spawning is enabled unscoped; with no policy both backends keep it. Disabling either check fails its deny cases.
  • test/test_hooks.py: hook_gate_kwargs emits spawn_target.
  • test/test_governance_chokepoints.py TestKasSpawnHonoursTheCallersTaskProfile: a task profile bound to the spawning agent that switches spawning off denies the spawn, and does not deny it for another agent (fails with caller_agent dropped).
  • test/test_cli.py: an unclassified request's notice does not say "claims to run a command".

Run: test_kas_permissions.py, test_kas_subagent_permission.py, test_cli.py::TestChatPermissionRequest, test_tool_call_classification.py, and the permission or kas selection of test_kas_agents.py, test_kas_subagent_progress.py, test_acp_client.py. flake8, isort, black and mypy clean on the touched files.

Manual verification

Live against KAS 2.24.0 via kiro-cli's relay, with Crew's own projection (build_kas_custom_agents) and parser, asking the agent to spawn one sub-agent:

allowedTools Projected rule Permission requests Crew parser on the request Result
["use_subagent"] subagent: allow 0 n/a spawn ran, replied PONG
[] none 1 fixed: classified=True, unverifiable=False; unfixed: unverifiable=True approved, spawn ran, replied PONG

Related Issues

Closes #9024

Compared with #9053

#9053 by karraghu fixes the same issue. What each covers:

Part #9053 This PR
A: use_subagent key yes, keeps invoke_sub_agent as an alias yes, no alias: the ceiling filters allowedTools by ref, so an alias is a spelling it is never asked about
B: classify the spawn spawn_attested from consent.capability alone, read on every backend consent.capability AND toolId AND a named target AND no command, read only on KAS; resolves the miss to non-shell and names the tool use_subagent for deny/tools rules
C: spawn policy at the prompt _vet_spawn_governance before the prompt, hand-wired in cli_chat.py and chat_runner.py the same check, adopted from #9053, placed once in the hook gate's governance step (one profile resolution) and threaded through hook_gate_kwargs, so every surface that uses the gate gets it
C: spawn policy on the auto-approve grant use_subagent -> capabilities.spawn in BUILTIN_TOOL_SCOPES, so any declared spawn capability withholds it the same seam, adopted from #9053: a BUILTIN_TOOL_CAPABILITIES entry read by may_skip_gate, withholding only when the capability restricts (off or scoped); both backends
empty-target spawns _vet_spawn_governance denies an unnamed target under an agents scope; governance_scope_constrained not needed: a spawn with no target is not classified, so it keeps the refusal
SEL records for spawns spawn_auto_approve_granted, spawn_invocation_observed not included
CLI prompt shows the target yes no

Adopted from #9053, credited in the commit: vetting the spawn against capabilities.spawn on the backend-stated target before the prompt, and withholding the grant in the shared may_skip_gate. Not adopted: the alias, reading consent on non-KAS backends, and the audit records, which are additions beyond #9024.

Found while probing, not fixed here: on KAS a spec's tools: ["use_subagent"] mounts no sub-agent tool, because tools is relayed verbatim and KAS's tool vocabulary does not know that name. kiro-cli's own use_subagent prompt is not spawn-vetted (its events carry no spawn_target); its auto-approve grant now is.

Accepted and deferred to #14112: a grant cannot be revoked from a live session when policy tightens mid-session (GPT lane on a4d75c5120). It is real, and pre-existing for every auto-approve grant on both backends, so it is tracked as one class there rather than patched for this grant alone.

Pattern harvest

Rule candidate: review-prompt
Pattern: a name table read against a list the user writes must be keyed on the list's vocabulary, not on the vocabulary of the system the table translates into.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable): acp-client.md
  • No secrets, credentials, or internal references in the diff

@iamwhatever
iamwhatever requested review from a team and patrigao September 26, 2026 01:00
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 26, 2026
@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — ✅ PASS

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

Design-Verdict: PASS

Verify KAS stamps _meta.kiro on permission requests engine-side, beyond model reach — this PR reads that payload's meta for the first time (old comment: "the permission payload carries no _meta").

[DESIGN-REVIEWED] d8f5f1b

@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — 🟡 CONCERNS

Premise-level review of d8f5f1b23d5b942c38222c1fd1dec00d335e0210 — 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.

First-Principles-Verdict: CONCERNS

The classification rests on a hand-written "KAS 2.24" frame and "KAS sets command only for a shell call" — no capture or live run is cited.

Not justified as shipped

  • Item 1 — unverified provider claim: the fix's safety and effect rest on "no command rides along (KAS sets that field only for a shell call)" and a test frame the docstring calls "the permission request KAS 2.24 sends", with no linked capture; if the real frame differs, the spawn stays refused and the fix ships inert.
    Clears when: the fixed spawn path is confirmed against a live KAS 2.24 session, or a captured real frame is linked.
  • Item 3 — rides along: the WARNING for a spec listing invoke_sub_agent mitigates item 2's break, not the reported defect.
  • Item 9 — one consumer, generalized: three new one-entry tables, each with exactly one reader (grepped: BUILTIN_TOOL_CAPABILITIES read only at governance.py:4260; KAS_SPELLINGS only by its own warning loop; _KAS_NON_COMMAND_TOOLS only by kas_consent_tool); "the approach fix: let a KAS sub-agent spawn be approved #9053 took (BUILTIN_TOOL_SCOPES)" is symmetry with a table that has several entries.
    Subtraction: inline the single invoke_sub_agent/use_subagent case at each reader; a table earns its shape at the second entry.
    Clears when: the tables are inlined, or a second real entry lands.

What this change ships

Inventory (10 items) — 7 justified

Intent: let a KAS agent's sub-agent spawn reach approval instead of being auto-denied as an unverifiable shell command — a FIX.

  1. A KAS sub-agent spawn now reaches a prompt or grant instead of "Denied automatically" — unverified provider claim (see above)
  2. allowedTools: ["use_subagent"] now grants the spawn; the KAS spelling no longer does (0 in-repo listers, counted) — justified
  3. A spec still listing invoke_sub_agent logs a WARNING naming the fix — rides along
  4. A classified KAS spawn is vetted against capabilities.spawn before any grant or prompt — justified
  5. Under a restricting spawn policy, use_subagent is withheld from auto-approve on every backend; those spawns prompt — justified
  6. The CLI denial notice no longer claims a command for a request that claimed none — justified
  7. New AcpEvent.spawn_target threaded to the gate (3 consumers counted: cli_chat, providers/acp, hooks) — justified
  8. New kas_consent_meta toggle on build_permission_event (2 callers, both transports, KAS-only) — justified
  9. Three one-entry lookup tables carrying items 2, 3 and 5 — one consumer, generalized
  10. Owning specs (acp-client, governance) updated in the same commit — justified

[FIRST-PRINCIPLES-REVIEWED] d8f5f1b

@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] d8f5f1b

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

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Sep 26, 2026
@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] d8f5f1b

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

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

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 26, 2026
@iamwhatever
iamwhatever force-pushed the fix/kas-subagent-spawn-9024 branch from 0e3231b to cdc3545 Compare September 26, 2026 01:56
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 26, 2026
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 26, 2026
@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Security Scope Review -- 🟡 CONCERNS

Which legitimate operations does d8f5f1b23d5b942c38222c1fd1dec00d335e0210 newly refuse? Updated in place on each push. A script-confirmed regression blocks; the model proposes candidates and never decides a refusal.

Verdict basis: the reviewer's own judgement; no confirmed regression.

Security scope review -- adjudicated candidates

  • macos-latest (platform posix): 12 classified, 0 newly refused, 12 still allowed.
  • ubuntu-latest (platform posix): 12 classified, 0 newly refused, 12 still allowed.
  • windows-latest (platform windows): 10 classified, 0 newly refused, 10 still allowed.

No candidate flipped from allowed to refused.

Scope-Verdict: CONCERNS

TIGHTENING: The permission gate now judges a backend-stated sub-agent spawn against capabilities.spawn, and the use_subagent auto-approve grant is withheld whenever that capability restricts anything -- the one threat refused is a spawn of an agent the spawn policy forbids (spawning off, or the target outside the agents scope) slipping through because "a spawn policy is not a tools rule, so the title question alone cannot answer it" (if spawn_target: return _spawn_policy_denial(ceiling, profile, spawn_target, session_key, agent) in _governance_denial, plus BUILTIN_TOOL_CAPABILITIES: Dict[str, str] = {"use_subagent": "capabilities.spawn"} in may_skip_gate).

ADJUDICATED: 15 candidates, 0 confirmed newly-refused
The candidates probe the shell-classifiable boundary around the change: the operators' own spawn commands (kirocrew spawn run/list), the policy-debugging reads the new "Blocked by spawn policy" message sends an operator into (kirocrew policy show/explain/profile/validate, kirocrew security deny-list), the touched test files' sanctioned pytest invocations in both platform spellings, the tool-name sweeps (use_subagent, invoke_sub_agent) the diff's own rekey and its WARNING remediation require, and the pathspec history read of a touched file. No shell command line carries a spawn_target or a use_subagent ref, so a candidate that flips would indicate an unintended reach into the shell composite; none was expected and none was confirmed.

PLATFORM COVERAGE: Rows were written as any (platform-neutral kirocrew and git invocations), posix (.venv/bin/python -m pytest, grep -rn, single-quoted spawn task), and windows (.venv\Scripts\python.exe -m pytest, findstr /s /n, double-quoted spawn task). The diff itself makes no path, separator, interpreter, executable-name, or environment-variable assumption -- its matching is on JSON _meta.kiro fields and tool-name strings, which are identical on every host -- so the platform-specific rows exist to pin the touched area's daily operations in both spellings rather than to chase an assumption in the diff. No assumed platform was left without a candidate. The per-leg verdicts are the deterministic fold's to report, not mine.

UNADJUDICATED: The tightening itself lives in the governance/permission plane, which the classifier cannot reach -- it settles a shell command line through the tool-call deny composite, and every one of the three strictures here is off that path:

  1. hooks._spawn_policy_denial (via _governance_denial's spawn_target branch). Call path: a KAS session/request_permission carrying _meta.kiro {toolId: invoke_sub_agent, consent: {capability: subagent, resource: <target>}} → _dispatch.kas_consent_tool → AcpEvent.spawn_target → hook_gate_kwargs → HookManager.on_tool_call → _governance_denial → _spawn_policy_denial. No shell command line sets spawn_target, so no row can obtain a verdict. Candidate legitimate inputs I would have submitted: a KAS spawn of a target explicitly inside the agents allow scope (must stay permitted); a spawn on an ungoverned host (must stay permitted); and a spawn under a syntactically damaged profile file -- the new branch fails CLOSED ("Blocked by spawn policy: it could not be evaluated"), so a profile-store read error now costs a previously-permitted legitimate spawn, where the surrounding tools question fails open.
  2. governance.may_skip_gate capability withholding. Call path: every allowedTools writer → may_skip_gate_now("use_subagent") → _capability_restricts(ceiling.get("capabilities.spawn")). Candidate legitimate input: an operator whose policy enables spawn with an agents scope allowing exactly the agents in use loses the auto-approve grant on every backend and channel -- each spawn now prompts. That is the diff's stated design (the per-spawn check must get a request to run on), but it is a real behavior change to a legitimate configuration that nothing here can adjudicate.
  3. kas_permissions.CAPABILITY_BY_TOOL rekey. Call path: an agent spec's allowedTools → allowed_tools_to_permissions. Candidate legitimate input: an existing spec listing invoke_sub_agent -- the only spelling the table accepted before this diff -- now receives no subagent grant, so the spawn it meant to auto-approve prompts. The diff mitigates with a WARNING naming the fix, and the alias removal is argued (a second spelling would let a spec dodge the ceiling under the Crew name), but a spec written against the old key loses its grant with no adjudicated verdict available.

[SCOPE-REVIEWED] d8f5f1b

@iamwhatever
iamwhatever force-pushed the fix/kas-subagent-spawn-9024 branch from cdc3545 to d4e26b5 Compare September 26, 2026 02:10
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 26, 2026
@iamwhatever
iamwhatever force-pushed the fix/kas-subagent-spawn-9024 branch from d4e26b5 to 65b8386 Compare September 26, 2026 03:10
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 26, 2026
@iamwhatever
iamwhatever force-pushed the fix/kas-subagent-spawn-9024 branch from 65b8386 to a4d75c5 Compare September 26, 2026 03:39
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 26, 2026
On KAS a sub-agent spawn was always auto-denied as an unverifiable
command. Two independent defects, both fixed, plus the spawn policy the
fix must not bypass:

- kas_permissions.CAPABILITY_BY_TOOL keyed the sub-agent grant on KAS's
  internal toolId `invoke_sub_agent`, but allowedTools carries Crew's
  name `use_subagent`, so no `subagent` allow rule was ever projected.
  Key it on `use_subagent` only; a second spelling would be a ref the
  governance ceiling is never asked about under the Crew name.
- KAS's spawn tool_call frame is taken for the sub-agent roster and its
  toolCallId is synthetic, so every cache missed and the request arrived
  unclassified, which `_unverifiable_shell` refuses. On KAS only,
  build_permission_event resolves that miss from the request's
  engine-written `_meta.kiro` block when the toolId is
  `invoke_sub_agent`, the consent capability is `subagent`, a target is
  named and no command rides along. It sets tool_name `use_subagent` and
  `spawn_target`, never is_shell True, never overrides a cache hit, and
  grants no params or identity provenance.
- HookManager.on_tool_call judges `spawn_target` against
  `capabilities.spawn` (gate on, target in the `agents` scope) inside
  `_governance_denial`, on the ceiling and calling agent's profile it
  already resolved, before any grant or prompt; an evaluation error
  refuses the spawn. governance.may_skip_gate withholds `use_subagent`
  from every allowedTools writer, on both backends, while the ceiling
  or any configured profile restricts `capabilities.spawn`. Both the
  per-spawn vet and the shared-predicate withhold follow the approach
  in #9053 by karraghu.

The CLI notice for an unclassified request no longer says it "claims to
run a command" when nothing claimed one.

Closes #9024
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Disposition of the GPT 5.6 finding on a4d75c5120d11ce1cb4ecc8d404e29d3b2d951c5 (src/kiro_crew/acp/kas_agents.py:385, "A live policy update cannot revoke an emitted spawn grant"): accepted, deferred to #14112.

The finding is real. It is also pre-existing and class-wide: every auto-approve grant, on both backends, is decided when a session starts, and nothing narrows a session already negotiated (docs/system-specs/modules/governance.md § allowedTools states this limit). Patching it for the subagent grant alone would leave @server, web_fetch, web_search and kiro-cli's own grants with the same gap, so #14112 tracks the class, with the evidence and a fix direction.

What this PR does close on the next head: the grant is no longer emitted at all while a policy restricts spawning, on any backend or channel (Opus finding, same head), because the check now lives in the shared governance.may_skip_gate.

@iamwhatever
iamwhatever force-pushed the fix/kas-subagent-spawn-9024 branch from a4d75c5 to d8f5f1b Compare September 26, 2026 04:26
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 26, 2026
@chenmingwei23
chenmingwei23 merged commit 142ecee into main Sep 26, 2026
100 checks passed
@chenmingwei23
chenmingwei23 deleted the fix/kas-subagent-spawn-9024 branch September 26, 2026 06:21
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Sep 26, 2026
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.

Bug report: a sub-agent spawn can never be approved on the kas backend

2 participants