Repository navigation
Conversation
Design Review (Fable 5, fork) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS Backends publishing no Watch
[DESIGN-REVIEWED] c6cfc67 Description read[DESCRIPTION-READ] 99a2cbcf44088bfe03c1282eaf9e393c7f079ec10346a8b4191fa090a04b5b45 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 (Fable 5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Verify one live heartbeat cycle on kiro-cli: every approval now rests on Not justified as shipped
What this change shipsInventory (10 items) — 9 justifiedIntent: FIX — make the base's existing edition heartbeat-tool allowlist seam (
[FIRST-PRINCIPLES-REVIEWED] c6cfc67 Description read[DESCRIPTION-READ] a672ef6051fe1b2bb0f7e4855985836f5a6b4841a82c1060b671005170a4ffdf That sha256 names the PR description this verdict read. Recompute it with |
Opus 5 Review (fork) — ✅ no blocking findingsReviewed |
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/agent.py:3521 -- Composition failure skips governance refresh for forked agents
Adjudication (Opus 5) — is blocking on each finding proportionate?UNBOUNDED — governance-ceiling bypass: a fork's on-disk |
c5caf61 to
46000da
Compare
46000da to
132fe36
Compare
132fe36 to
e1a7de9
Compare
e1a7de9 to
2965ac7
Compare
|
|
|
|
|
|
|
|
|
|
|
|
…gent
Adds McpToolingProvider.extra_heartbeat_mcp_servers() so an edition can
name servers that reach only the unattended heartbeat agent. Default {},
merged ADD-only after kirocrew-core, so a standalone install is unchanged.
PlatformCompositionError propagates out of the heartbeat installer's
wrapper instead of being swallowed; the dashboard MCP add/update handlers
report it as 500 agent_config_rebuild_failed.
Heartbeat has no approver, so every tool call an edition server can now
send is judged on trusted identity, never on model-authored text:
- autoApprove is dropped from every edition heartbeat entry on every
install, audited as mcp_auto_approve_withheld: kiro-cli would approve
matching calls locally and bypass _heartbeat_approval,
HEARTBEAT_SAFE_TOOLS and per-call SEL audit, and the declared-verb
exemption a spec also returned by extra_mcp_servers() earns does not
extend to an agent with no approver. The assembled map then goes
through strip_ungoverned_auto_approve, so the owner's kirocrew-core
entry follows rfc-owner-written-mcp-auto-approve as on the main agent.
- _is_heartbeat_safe_tool keys on mcp_identity_trusted / tool_name /
mcp_server_name instead of event.title; builtins delegate to
hooks._is_host_read_only_builtin with web_fetch/web_search excluded;
a read-only shell command is allowed via is_read_only_bash with every
git invocation excluded (git reads .git/config on invocation, a
channel no text classifier can see); the SEL audit label records the
trusted server/tool identity.
- HooksConfig.deny_kind_based_read_only turns off the three kind- and
title-based auto-approve branches in HookManager.on_tool_call for the
heartbeat-scoped manager only.
- security.readonly_bash.command_invokes_git splits on the same
_SEGMENT_SEPARATOR_RE as _classify_bash so `pwd; git status` cannot
slip past the exclusion.
Docs (heartbeat.md, platform-context.md, slack-gateway.md, prepare-pr
SKILL.md and rationale.md) describe the seam and the approval rules.
test_security_gate_liveness re-pins the security package line budget to
the measured total with the reason recorded; two touched files leave the
black baseline as the gate requires.
|
|
|
|
|
|
|
|
Read-only review note, leaving approval to a maintainer because the diff touches security/readonly_bash.py and the heartbeat's auto-approve path. What I verified: only edition-contributed servers from current_context().mcp_tooling.extra_heartbeat_mcp_servers() are wired in, never user-configured custom servers; autoApprove is stripped and audited; no write tools are added; shell approval now requires a trusted identity, a non-empty tool_name with no server behind it, no git in any pipe segment, and a name-grant check, where before is_read_only_bash was auto-approved unconditionally, so the surface narrows. readonly_bash.py only adds a deny helper (first word 'git' per pipe segment; /usr/bin/git slips the helper but is rejected by the allowlist anyway). mcp_custom.py adds no route, both endpoints stay owner-gated. Nits: the _bare_tool_name docstring (gateway.py:1116) still says it unwraps the same forms _is_heartbeat_safe_tool unwraps, which is stale; the add endpoint returns 500 after the server is already written, so a retry hits 'already exists'. |
# Conflicts: # src/kiro_crew/agent.py # test/test_security_gate_liveness.py
bolichen97
left a comment
There was a problem hiding this comment.
Merged main to clear conflicts in src/kiro_crew/agent.py (import list) and test/test_security_gate_liveness.py (kept both re-pin notes, budget 27,994). Liveness test and the PR's own test files pass locally (912 passed). Re-approving the same change.
|
🤖 Kiro Crew [operator: dwu96#8c08bee0]: Security scan flagged this PR for manual review. Findings:
Both matches are in test files and read as fixtures that assert the security gate rejects such a command rather than as destructive code. I am not treating that reading as sufficient to clear them, because this PR also changes the enforcement path those fixtures exercise — Accordingly this PR is not being enqueued for automated fixes, and no automated commits will be pushed to the branch. I have added For the reviewer's convenience, the rest of the triage read (not acted on): 2222 additions / 296 deletions across 23 files, 2 commits, |
|
Open-PR triage (2026-10-05), checked against Classification: DISTINCT. No open or merged PR adds Still blocking at this head (not resolved by any disposition):
Needs a rebase: Recommendation: REBASE, fix the re-raise ordering, then get the maintainer ack on the identity-less-backend posture. Do not close this PR. |
|
Heads-up from the maintainer side: this change is being carried to main as an in-repo redo, #20047 ( |
|
Superseded by #20047, which landed on #20047 is the in-repo takeover of this fork PR: the heartbeat agent now mirrors edition-contributed MCP servers ( Closing this PR; follow-up on the one deferred finding is tracked in #20105. |
Problem / Motivation
Goal: Let a companion edition's MCP servers reach the unattended heartbeat agent, closing the one agent-config builder that never wired in edition-contributed servers.
_install_heartbeat_agent()builds the heartbeat agent'smcpServersfrom a hardcoded single-item tuple and never reaches any edition-contributed server._install_research_agent()and the main agent config (build_agent_config()) both correctly merge edition-contributed servers via the platform seam; the heartbeat path was the one builder that never called through, so a companion contributing a heartbeat-relevant MCP server had no way to reach the unattended heartbeat agent at all.Why it matters
Any companion/edition that wants its own MCP servers available to the unattended heartbeat cycle currently cannot get there — the seam other agent builders use simply isn't wired for this one. The gap is silent: nothing errors, the heartbeat agent just installs with a narrower server set than intended, so the failure mode is a companion server that quietly never runs rather than a visible break.
Not a goal
CONTRACT_VERSIONbump for the newextra_heartbeat_mcp_servers()seam — an older companion built without it degrades to{}via the existing fail-closed/degrade split rather than being required to update.What changed (motivation → approach → change)
Heartbeat is the one agent with no approver, ever. Letting an edition add servers to it also means every tool call from those servers must be judged on a trusted identity, never on text the model wrote. So the PR adds the seam and closes the approval paths the seam would otherwise open.
platform/interfaces.py,platform/defaults.pyextra_heartbeat_mcp_servers()onMcpToolingProvider. Default{}.agent.py_install_heartbeat_agent()merges those servers afterkirocrew-core, core wins collisions, and dropsautoApprovefrom every edition entry (audited). The assembled map then goes throughstrip_ungoverned_auto_approve.PlatformCompositionErroris held until every sibling installer has run, then re-raised; other errors degrade to{}.dashboard/handlers/mcp_custom.pyagent_config_rebuild_failedwhen the rebuild fails, instead of a silentok, with a SELerrorrow.slack/gateway.py_is_heartbeat_safe_tool()keys onmcp_identity_trusted,tool_name,mcp_server_name, neverevent.title. Builtins delegate tohooks._is_host_read_only_builtin(fs_read,glob,grep); the title spellingsRead,Grep,Glob,WorkspaceSearchleave the allowlist;web_fetch/web_searchexcluded. Read-only shell allowed viais_read_only_bash, every git invocation excluded. SEL audit records the trustedserver/tool.hooks.pyHooksConfig.deny_kind_based_read_onlyturns off the three kind- and title-based auto-approve branches; heartbeat hooks set it.security/readonly_bash.pycommand_invokes_git()splits on the same_SEGMENT_SEPARATOR_REas_classify_bash, sopwd; git statuscannot slip past the git exclusion.builtin_skills/kirocrew-dev/prepare-prSKILL.mdandreferences/rationale.mdstate that heartbeat cannot read a repo.docs/system-specs/modulesheartbeat.md,platform-context.md,slack-gateway.mddescribe the seam and the approval rules..github/black-baseline.txttest/test_security_gate_liveness.py_PACKAGE_LINE_BUDGETre-pinned to the measured total, reason recorded in the ratchet's log.Why
autoApproveis handled two ways: it lets kiro-cli approve a call locally, before_heartbeat_approvalever sees it. An edition entry loses it on every install, even when the same spec is declared on the main-agent seam, because heartbeat has no approver and the declared-verb exemption would run that server with no gate and no per-call audit. The owner'skirocrew-coreentry keeps an owner-writtenautoApproveundermcp.honour_auto_approve(rfc-owner-written-mcp-auto-approve), as on the main agent.Why git is excluded even for
git status: git reads.git/configon every invocation.core.fsmonitorandcore.hooksPathname a program from that file, not from the command line, so no text classifier can see it.Backwards compatibility
Compatible: for a standalone install the heartbeat agent config is byte-identical, including an owner-written
autoApproveonkirocrew-core, which still followsmcp.honour_auto_approve. An older companion without the new method still installs heartbeat withkirocrew-corealone.Two approval-path changes affect existing installs. A heartbeat tool call is approved only on a trusted
_metaidentity, so on a backend that publishes none (claude-agent-acp, opencode peracp/_dispatch.py) heartbeat approves no tool and runs text-only;heartbeat.mdrecords this as intended. The old title spellings (Read,Grep,Glob,WorkspaceSearch) no longer match;WorkspaceSearchhas no entry inhooks._HOST_READ_ONLY_BUILTIN_TOOLSand is not mapped.Tests
New and updated tests across
test_cpp_wiring_enterprise.py,test_cpp_wiring_standalone.py,test_heartbeat_cycle_recycle.py,test_app_mcp_scoping.py,test_agent.py,test_heartbeat_safe_tools.py,test_slack_gateway_more_coverage.py,test_hooks.py,test_mcp_custom_api.py,test_trust_reads.pylock in:PlatformCompositionError, degrade to{}on other errors, forward-compat with an older companion, verbatim merge of edition filters, core wins a name collisionautoApprove: an edition entry's is dropped and audited even when the same spec is declared viaextra_mcp_servers()(the case the governed helper alone would keep); the owner'skirocrew-coreentry keeps it whilemcp.honour_auto_approveis on and loses it when off; a governance ceiling withholds it_is_heartbeat_safe_tool(): untrusted identity denied even with an allowlisted name; bare or wrong-server core tool names denied; builtins with a server attached denied;web_fetch/web_searchdenied; read-only shell approved, mutating or unrecoverable command denied; every git form denieddeny_kind_based_read_onlyon all three branches, defaultHookManagerunchanged, deny never widenedcommand_invokes_git: every separator, pipe targets, case, empty input,gitk/digitdo not matchagent_config_rebuild_failedand audit it asoutcome=error; the rebuild still runs every sibling installer before the composition error is re-raised_heartbeat_approvalSEL label uses the trusted identity on trusted events and the redacted title on denied onesManual verification
N/A — unit coverage sufficient. This is a backend config-generation path (
_install_heartbeat_agent()writes a JSON agent spec to disk) plus pure-function gates (_is_heartbeat_safe_tool(),HookManager.on_tool_call); the tests exercise them end-to-end against a real temp directory and assert on the written file's contents or the returned action.Screenshots / video
Why no screenshot: backend-only change, no rendered surface is touched.
Related Issues
None filed; found while investigating heartbeat MCP access during unrelated work.
no linked issue: this PR was opened from a review finding during unrelated work, not from a tracked issue.
Pattern harvest
Rule candidate: semgrep
Pattern: one of several sibling "install agent config" functions omits a call
to the shared edition-extension helper that its siblings all call
(
_install_research_agent()andbuild_agent_config()both call_extra_mcp_servers();_install_heartbeat_agent()did not). A structuralcheck comparing sibling functions with a shared naming/role convention
(
_install_*_agent) against a required call to a named helper would havecaught this at review time rather than needing a live bug report.
Second rule candidate, from this PR's own review cycle: a multi-branch
matching function (bare-name vs. qualified-name cases) that closes a
collision class in one branch should be checked for the identical collision
shape in every sibling branch before merging, not branch-by-branch across
separate review rounds — three of this PR's review rounds each found the
same unguarded-branch shape in a different branch of
_is_heartbeat_safe_tool().Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)