Repository navigation
Conversation
UX Review (Opus 5.5, fork) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Check one thing before merge: an allow-mode profile listing What this change shipsInventory (7 items) — 7 justifiedIntent: make an operator's deny rule or governance profile, written in Kiro Crew's spelling (
[FIRST-PRINCIPLES-REVIEWED] dc19e44 Description read[DESCRIPTION-READ] 3f5ef3a70821a5fb0437a23ee066e088c74874d6f659f87f367bd95dfd1ba0a9 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. [DESIGN-REVIEWED] dc19e44 Description read[DESCRIPTION-READ] 716c144579b1403a59b56bc85f37f1d858d5c76ee0b56af8007649cb1c2df30d 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 |
e4fcb31 to
6d7d9a5
Compare
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
Security Scope Review (fork) — 🟡 CONCERNSWhich legitimate operations does the reviewer's own judgement; no confirmed regression Scope-Verdict: CONCERNS TIGHTENING: Tool-identity alias resolution in the deny-target and governance tiers. It moves from the read-only ADJUDICATED: 13 candidates, 0 confirmed newly-refused PLATFORM COVERAGE: I wrote posix rows (bash-wrapped status check, UNADJUDICATED:
[SCOPE-REVIEWED] dc19e44Security scope review -- adjudicated candidates
No candidate flipped from allowed to refused. |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
|
rebutted
self-added: no |
|
This moves |
kiro-cli stamps its three built-ins `read`, `write` and `shell` where an operator's `auto_deny_tools` and a governance `tools` rule are written `fs_read`, `fs_write` and `execute_bash`. The gate compared the stamp as stamped, so a rule in the spec spelling never fired on `write` or `shell`; only `read` was translated, for the side chat's read-only proof. Move `KIRO_TOOL_ALIASES` into the stdlib-only `platform.tool_names` leaf (the ACP projection imports it from there under its old name) and resolve a stamp through one helper, `_host_builtin_alias`, for the deny tier, governance and the read-only proof. Governance is asked a trusted stamp and its spec spelling as one alias group, so an allow-mode profile in either spelling admits the call and a deny on either refuses it; an unverified stamp keeps its own name and the alias may only deny. The proof's allowlist is unchanged, so `write` and `shell` resolve to names it does not hold and stay unproven. Fixes kirodotdev#18662
6d7d9a5 to
dc19e44
Compare
|
Thank you, @billyae, for this fix and for the careful write-up. The I'm closing this one in favor of #21761. Your branch is left as is. All credit for the fix stays with you. |
Problem / Motivation
Goal: A rule or governance profile written in Kiro Crew's own tool spelling reaches the matching kiro-cli built-in, whichever short name kiro-cli stamps on the call: a deny in either spelling refuses it, and an allow-mode profile in either spelling admits a provenance-verified stamp.
auto_deny_tools: ["fs_write"]does nothing on the kiro-cli backend. kiro-cli stamps its file-write built-inwrite, its shellshelland its file readerread(_meta.kiro.toolName), while rules, governancetoolsscopes and the read-only allowlist are spelledfs_write,execute_bash,fs_read. The deny tier compares the stamp letter for letter, so a rule spelledfs_writeorexecute_bashnever matches. Onlyreadwas translated.Why it matters
A "never write files" or "never run commands" rule that silently fails to fire is a security setting that does not work, on the default backend, with nothing unusual needed to hit it. The side chat's READ_ONLY proof already resolves
read; the deny tier that runs before it must see the same name or the operator loses the only control that runs before any approval.Not a goal
read_file,str_replace, ...): landed in fix(acp): spell a Crew agent's tools in KAS ids so the kas backend can read files #17280; this change keeps that fold and adds the kiro-cli short stamps beside it.Readstamp: feat(side-chat): run read-only tools on the Claude Code backend #17785._HOST_READ_ONLY_BUILTIN_TOOLS) decides that, unchanged.What changed (motivation → approach → change)
platform/tool_names.pyKIRO_TOOL_ALIASESshell->execute_bash,read->fs_read,write->fs_write); moved here so the gate reads the same table without crossing the agent-SDK boundaryacp/kas_permissions.pyKIRO_TOOL_ALIASESfrom the leaf instead of defining it; same name, same value, same readershooks.py_HOST_READ_ONLY_BUILTIN_ALIASESis gonehook_runtime/tool_identity.py_host_builtin_alias""for an MCP-served call or a stamp with no aliashook_runtime/gate_tiers.pydeny targets and governance queryalias_groupsentry, the shape #17280 uses for KAS ids, so an allow-mode profile in either spelling admits the call and a deny on either refuses it; an unverified stamp is asked on its own name with the alias indeny_aliases; the KAS branch from #17280 is untouchedThe symptom: a deny rule in the spec spelling misses a short stamp. The root cause: the hooks-side alias table carried only
read, and each consumer read it through its own copy of the server guard. The change: one table with all three stamps, owned by the stdlib-only leaf both the KAS projection and the gate already import, and one helper every consumer calls, so the deny tier, governance and the proof cannot disagree about which built-in a stamp names. Governance is asked the two spellings as one identity rather than two required items: onmain, areadstamp besidefs_readas separateextra_titlesmeant an allow-mode profile written in either spelling refused it, since the other spelling was never listed. The read-only proof still admits onlyfs_read,glob,grep,web_fetchandweb_search:writeresolves tofs_writeandshelltoexecute_bash, neither of which is on that list, so both are refused exactly as before. A server's own tool calledreadorwritegets no alias.docs/system-specs/modules/side.mdandmemory-skills-hooks.mdname the helper and the table's owner.Backwards compatibility
Compatible for deny rules: every call a deny rule or deny-mode profile refused on main is refused here, and the only new denials are by a rule the operator already wrote in the spec spelling. Allow-mode profiles change in one direction only: a trusted
readstamp thatmainrefused under atools: [..., "fs_read"]ortools: [..., "read"]allow set is now admitted, because the two spellings are one alias group;writeandshellundertools: [..., "write"]/[..., "shell"]are admitted as onmain, and now also under the spec spelling.acp.kas_permissions.KIRO_TOOL_ALIASESkeeps its name and value (imported from the leaf, sokas_permissions.KIRO_TOOL_ALIASESstill resolves foracp/harness_tool_names.pyand the tests that read it there).hooks._HOST_READ_ONLY_BUILTIN_ALIASESis removed; it had no reader outsidehooks.py,hook_runtime/andtest/.Tests
test_hooks.py::TestClassifierOnlyHostTrustedProof: every alias resolves to a governed built-in;readis proven read-only;write/shellresolve outside the allowlist and are not proven; the helper gives""for a server-backedreadand for an unaliased stamp.test_hooks.py::TestBuiltinToolIdentityGoverned, parametrized over the three stamps: a rule in the spec spelling denies the stamp at the deny floor (interactive andclassifier_only) and on the governance plane; a server's tool under the same short name is not denied and never appears as the built-in; a trusted stamp reaches governance as one alias group and an unverified one as its own name plus a deny-only alias; end to end through the realgate_decision, an allow-mode profile in either spelling admits a trusted stamp, one naming neither refuses it and reports the spec spelling, a deny on either spelling refuses it, and the spec spelling cannot admit an unverified stamp.test_llm_helpers_tool_gate.py: end to end, the rule's security deny is what the caller sees --readunder READ_ONLY,writeandshellunder HOOK_BASED, where without the rule the same calls auto-approve.With the table shrunk back to
{"read": "fs_read"}, exactly the six write/shell cases fail (deny floor, governance, end to end; two stamps each).Manual verification
N/A — unit coverage sufficient: the gate is exercised through
HookManager.on_tool_callandstream_and_collect, the same entry points the live surfaces use.Related Issues
Fixes #18662
Pattern harvest
Rule candidate: review-prompt
Pattern: a name translated for one consumer of a shared identity (the approve path) but not for the consumers that run before it (deny, governance)
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)