Repository navigation
Admit native trusted tools in the unattended reviewer (fixes workspace-backed launch reap) - #615
Conversation
… frame A workspace-backed unattended review (observed on kiro) was reaped at launch with unattended_interaction_forbidden:session/request_permission. Under AllowlistedAutoApprove the daemon admits a leaked permission frame only for a tool the launch trusts, but the admitted set was built from only the @server/tool namespaced half of the trust list while the --trust-tools argv also grants the native fs_read/thinking. A leaked prompt for fs_read (which the vendor emits intermittently even for a trusted tool) was therefore refused and reaped; a workspace-backed launch reads the mirrored worktree and hits it, context-only never does. - AdmittedFor now returns the full trust set (native tools + namespaced entries), so admission equals trust. fs_write/execute_bash are in neither, so the read-only containment floor is unchanged. - The permission-frame reap now logs the untrusted tool title + kind, so the leaked frame is diagnosable — the forwarded coded reason names only the method. Closes #614 AI-2096 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
PR Summary by QodoAdmit Native Trusted Tools for Unattended ACP Reviews
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Code Review by Qodo
1.
|
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Problem
A workspace-backed unattended review flow with an ACP reviewer (observed with kiro) is reaped at launch:
Context-only mode (diff inlined) reviews cleanly with the same vendor, so the frame is provoked by the workspace-backed mode reading the mirrored worktree, not by the vendor being broken.
Root cause
Under
AllowlistedAutoApprove, the daemon admits a leakedsession/request_permissionframe only if it names a tool the launch trusts. ButUnattendedToolAdmission.AdmittedForwas built from only the@server/toolnamespaced half of the trust list, while the--trust-toolsargv (KiroReviewerTrustList.Build) also grants the native toolsfs_readandthinking.So a leaked prompt for
fs_read— a tool the launch already trusts, which the vendor prompts for intermittently even when trusted (the same leak that motivatedAllowlistedAutoApprovefor the injected result channel) — was refused by admission and reaped. A workspace-backed launch reads the mirrored worktree and hitsfs_read; context-only reads nothing and never does.The factory already states the intended invariant — the admitted set is "built from the SAME injected specs and identity the trust argv is built from … Two derivations would let the reviewer be TRUSTED to call a tool the policy then refuses to approve" — so admission being narrower than trust is the defect.
Fix
AdmittedForreturns the full trust set — native tools ∪ namespaced entries — so admission equals trust.fs_write/execute_bashare in neither, so the read-only containment floor is unchanged.AllowlistedAutoApprovepermission-frame reap now logs the (untrusted, agent-supplied) tool title + kind. Previously only the method was logged, so the leaked frame was undiagnosable even from the daemon log.Caveat
The match stays a complete-title comparison (the deliberate anti-substring rule). Kiro's MCP-tool titles are
Running: @server/tool; a native-tool title shape was never captured by probe, so if a native frame's title is presentation text rather thanfs_read, the fix is inert for that frame and fails closed — the new diagnostic (2) is what will let us refineIsAdmittedwith the real title. The companion kcap-server change surfaces acontext-onlyremediation hint on this coded reason so the workaround no longer needs tribal knowledge.Testing
UnattendedToolAdmissionTests: the previously-pinned "namespaced half" test is now "the full trust list"; added native-tool admitted cases (fs_read,thinking) and the containment-floor refusals (fs_write,execute_bash).AcpInteractionBridgeTests/ preset tests remain green; AOT publish is IL-clean.Closes #614
Linear: AI-2096