fix: allow reads of kiro-cli agent-spec directory in bash gate - #9290
fix: allow reads of kiro-cli agent-spec directory in bash gate#9290aniruddhaadak80 wants to merge 1 commit into
Conversation
The kiro-cli agent-spec directory (~/.kiro/agents) is write-protected (_WRITE_PROTECTED_HOME_PATHS) but must remain readable for kiro-cli's --agent resolution and MCP rewriter. Added explicit exception in is_sensitive_path to allow reads of this directory while keeping writes blocked. Fixes kirodotdev#9198.
Design Review (Fable 5, fork) — 🔴 BLOCK (blocking)Design-level review of I have everything I need. The base code at Design-Verdict: BLOCK The read gate already allows BlockersPhantom problem, and the "fix" weakens the deny gate. Watch
[DESIGN-REVIEWED] 8770a19 |
GPT 5.6 Review (fork) — 🔴 changes requested (blocking)Reviewed 1 of 1 blocking finding(s) are security-class and were withheld from adjudication, so the blocking verdict stands. BLOCKING -- src/kiro_crew/security/paths.py:1815 -- Agent-directory exemption bypasses credential protection Adjudication (Opus 4.8) — is blocking on each finding proportionate?I've confirmed the mechanism from code opened this run. F1 — The exemption Precondition for a FLAG would be that the symlink cannot be created by the threat actor. But [ADJUDICATION] 8770a19 total=0 uphold=0 downgrade=0 |
First Principles Review (Fable 5, fork) — 🔴 BLOCKPremise-level review of I have everything I need. The evidence is conclusive: the base's read gate ( First-Principles-Verdict: BLOCK The read gate never fenced What this change shipsIntent: let agents/users read their own agent specs under
BlockersThe defect this fix claims does not exist in the base. The description says "the path matching logic could flag this directory," but WatchThe only inputs the early-return changes are ones the gate deliberately catches today: a spec-shaped path whose resolved candidate lands in a credential store (the ANY-candidate contract, paths.py:1767-1780, pentest AWS-345/AWS-62) now returns False before that check runs — an undeclared behavior change the description never mentions. [FIRST-PRINCIPLES-REVIEWED] 8770a19 |
Opus 4.8 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo blocking issue; one advisory finding — the new FINDING — src/kiro_crew/security/paths.py ( [OPUS-REVIEWED] 8770a19 |
|
Closing without merging: the behaviour this PR sets out to add already exists on On Issue #9198's real ask -- move the agents-dir fence to the sandbox READONLY tier -- is untouched by this diff and belongs in a separate change next to #9197. Thanks for looking at this area. |
Problem / Motivation
The bash gate (and file-edit tool gate) was refusing READ operations on the kiro-cli agent-spec directory (
~/.kiro/agents). This directory is correctly write-protected (in_WRITE_PROTECTED_HOME_PATHS) but MUST remain readable for:--agent <name>resolutionmcpServers.<name>.commandinto env varsThe bash gate was incorrectly blocking reads because the path matching logic could flag this directory.
Why it matters
Agents and users could not read their own agent specifications, breaking:
kirocrew --agent <name>workflowsWhat changed (motivation → approach → change)
Added an explicit exception in
is_sensitive_path()to allow reads of the kiro-cli agent-spec directory (~/.kiro/agents). The directory remains write-protected via_WRITE_PROTECTED_HOME_PATHS, but reads are now explicitly allowed.Added helper
_is_kiro_agents_dir()that checks if a path is under the agent-spec directory using the same candidate-form/symlink-resolution logic as the main gate.Tests
~/.kiro/agents/spec.jsonare allowed~/.kiro/agents/are still blockedRelated Issues
Fixes #9198
Checklist
Contribution License Agreement