Repository navigation
feat(side): run read-only shell tools in KAS side turns - #18917
Conversation
UX Review (Opus 5.5) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS The new "Couldn't check which tools" notice is red, offers no retry, and doesn't say the side chat still works, so it scares users off a usable panel. Watch
Suggestions
[UX-REVIEWED] 17a6aec Description read[DESCRIPTION-READ] 767543104b5cb999bcd2af73f26fe0121d58aeb4fd8a8bcc4b6e8f632c8474c4 That sha256 names everything this verdict read: the PR description, plus the 11 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 |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Check whether a pinned live probe or contract test keeps the " [DESIGN-REVIEWED] 17a6aec Description read[DESCRIPTION-READ] 4231cad7ec858e9983b8b29b1cbc83244c35596973190ce8e92cfda187986d7b 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 |
First Principles Review (Opus 5.5) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS The new "Couldn't check which tools…" footer state, with a key in all 15 locales, goes beyond the Goal. Without it the footer would simply stay silent. Not justified as shipped
What this change shipsInventory (6 items) — 5 justifiedIntent: let a KAS user's Side Chat look things up in the workspace through read-only shell commands, as kiro-cli users already can. This is an ADDITION (closing a parity gap).
[FIRST-PRINCIPLES-REVIEWED] 17a6aec Description read[DESCRIPTION-READ] aa0c3f379d15a1024525e0e2ae0a85f44c87c869c54df442e5cd4106f7246fed That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed 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 — ✅ no blocking findingsGPT 6.1 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: |
8169a3f to
d876e9d
Compare
d876e9d to
7da48c5
Compare
|
Dispositions for the CONCERNS on
|
7da48c5 to
5c09d73
Compare
|
Dispositions for
|
5c09d73 to
ae7851e
Compare
|
GPT 6.1 BLOCKING on
Backend Tests shard 4 (Linux and Windows) red on |
ae7851e to
20a909b
Compare
|
Dispositions for
|
7083101 to
3313d9c
Compare
3313d9c to
d62f251
Compare
d62f251 to
902fca5
Compare
KAS takes the derived <agent>--readonly spec as a projected custom agent with its permissions emptied, so every tool call it serves reaches session/request_permission. Add KAS to ACP_BACKENDS_SIDE_READONLY and mirror the set in the Side Chat footer. The READ_ONLY gate is unchanged: on KAS it approves read-only shell commands; read_file and grep_search stay refused because their frames name no trusted tool.
902fca5 to
17a6aec
Compare
|
Dispositions for
|
|
Self-review (crew-pr-reviewer, read-only): RECOMMEND APPROVE This PR closes the Side Chat parity gap on KAS. A KAS side turn or thread reply used to run REJECT_ALL only because ACP_BACKENDS_SIDE_READONLY listed kiro-cli alone. Adding KAS (src/kiro_crew/agent_sdk/backends.py:2223) is the root-cause fix, because the derived |
Problem / Motivation
Goal: A Side Chat turn on the KAS backend can run read-only shell lookups, as it can on kiro-cli.
On KAS, a Side Chat turn (and a crewmate thread reply) runs
REJECT_ALL: no tools at all, and the footer says "Tools are unavailable here on this agent backend". On kiro-cli the same turn runs read-only tools underREAD_ONLY. The only reason is membership:ACP_BACKENDS_SIDE_READONLYlisted kiro-cli alone.Why it matters
A KAS user asking the side panel "what's in this file" or "which branch am I on" gets a model that cannot look anything up, while the same question on kiro-cli is answered from the workspace. KAS is a first-class backend, so this is a visible parity gap.
Not a goal
read_file/grep_searchparity on KAS. Those frames carry no_meta.kiro.toolName, so the gate cannot prove them as reads. Trusting the engine'stoolIdas a read identity changes the identity-proof layer and goes in its own PR with its own security review.What changed (motivation → approach → change)
Symptom → root cause: the set's own rule is that a harness joins when every tool call it serves reaches
session/request_permissionunder the derived<agent>--readonlyspec. KAS meets it. It takes the derived spec over the wire (acp/kas_agentsprojects it into_meta.kiro.customAgents), andderive_readonly_specalready emptiespermissionsto{"rules": []}with the other grants. A live probe drove kiro-cli 2.29.0acp --agent-engine v3with that projection, answering every request with reject:read_filerun_commandls -lagrep_searchfs_writeThe projected agent carried no
permissionsrule, so nothing on KAS runs without asking the host gate.A main-chat
allow_alwaysdoes not carry over either. Second probe, one KAS process: a normal session'stouchand file write were answeredallow_always; then the same calls were made from a--readonlyside session, from a second normal session, and from a fresh process.run_commandaskedfs_writeasked--readonly, same process--readonly, new processKAS keeps an
allow_alwaysfor its own session only, so no main-chat grant reaches a side turn. Recorded in thebackends.pymembership comment andside.md.Change:
ACP_BACKENDS_SIDE_READONLY={kiro, kas}, with the measurement in the comment (agent_sdk/backends.py).SideChat.tsx) reads the server's own answer, theside_chat_toolsline of the configured backend's card (GET /api/acp-backends, built fromACP_BACKENDS_SIDE_READONLY), so KAS shows "Read-only · Lookups work here" instead of "Tools are unavailable" and no frontend copy of the set exists.cat,grep,ls) instead of retrying it. True on every member backend, and it is what keeps a KAS turn from looping on a refusedread_file.side.md/harness-parity.mdname KAS beside kiro-cli.What a KAS side turn may now do: read-only shell commands, approved by the existing READ_ONLY classifier from the
_meta.kiro.commandthe engine states (allow_once).What it still may not do: file writes, modifying shell commands, deletes, exec (
python3 -c ...), MCP tools. All are refused by theread_only_policyfallback, as before.read_file/grep_searchare refused too (see Not a goal); the model can read through read-only shell (cat,grep,ls).What did NOT change:
llm_helpersREAD_ONLY / HOOK_BASED logic, thehooks.pyclassifier,_dispatch.pyidentity parsing,kas_permissions.py,kas_agents.py,side_readonly_spec.py. Normal (main chat) turns on every backend keep the same gate and the same approval card.Backwards compatibility
Compatible: the change only adds a backend to an allow set; every kiro-cli and non-KAS path is unchanged, and a KAS side turn gains read-only shell where it had nothing.
Removes nothing: no field, key, row or path is removed or narrowed.
Tests
test/test_side_readonly_kas.py(new): replays the captured KAS frames through the realparse_session_update+build_permission_event(kas_consent_meta=True)+ provider conversion + realHookManager.ls -laapproved;fs_write,touch,rm -rf,python3 -crefused;read_file,grep_searchrefused.fs_write,touch,python3 -Vreach the approver and stay rejected when declined.test/test_side.py: the side-turn allowance test runs for kiro and kas (derives the spec, streams READ_ONLY).test/test_backend_cards.py::test_the_default_harness_reads_as_the_most_capable: with/compacton KAS (feat(acp): serve manual /compact on KAS via its engine verb #18921) and side tools here, KAS ties kiro-cli at 8 available lines (each has two the other lacks). The test still pins kiro-cli at the top, pins the measured tie explicitly (kiro == kas == 8), and keeps kiro-cli strictly ahead of every other harness.website/src/test/SideChat.footerBackend.test.tsx(new): footer reads "Lookups work" on kiro and kas, "Tools are unavailable" on claude, follows the server'sside_chat_toolsline rather than any frontend list, shows its own tools-unknown notice when only the backend card fails to load, and the config-unavailable notice only when the config itself fails.SideChat.multiturn/SideChat.stopmocks serve the backend card the footer now reads.Manual verification
--agent-engine v3) with the derived spec, results in the table above.python3 -m pyteston test_side_readonly_kas, test_side, test_side_context, test_side_readonly_spec, test_chat_threads, test_harness_parity, test_kas_permissions, test_llm_helpers_tool_gate: 461 passed.Screenshots / video
Side panel footer, captured from the real
SideChatwith the config endpoint answering each backend (420px dock).KAS before (main) → after:
When the backend card fails to load (config loaded,
GET /api/acp-backendsfailing), the footer says only that the tools could not be checked:Light theme, kiro-cli (unchanged) and claude (unchanged)
Related Issues
Refs #18914
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license.