Repository navigation
feat(governance): respect an owner-written MCP autoApprove - #14394
Conversation
|
Intent: Respect an |
First Principles Review (Fable 5) — ✅ human override accepted@bolichen97 overrode this lane for |
GPT 5.6 Review — ✅ human override acceptedHuman judgment by @bolichen97 overrides the GPT 5.6 finding for [GPT-OVERRIDE] 77653de This comment is updated in place on each push. The model was not re-run because an authorized human decision supersedes it. False positive or not applicable? A repository writer can comment: |
Design Review (Fable 5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS "Owner-written" is decided by absence of counter-evidence, so any unmarked, un-enumerated writer of the shared map inherits the gate exemption by default. Watch
[DESIGN-REVIEWED] 77653de |
Opus 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: |
6da84f2 to
a87dbe5
Compare
a87dbe5 to
7b80393
Compare
7b80393 to
5e55a33
Compare
|
Rebased: Reason it was needed even though the base moved in nothing this PR touches: the base carried Re-verified after the rebase: 726 passed / pytest exit 0 across the 6 test files touching this filter, mypy 0 on both changed modules, comment-history gate passed. |
An autoApprove list the owner typed into their own mcp.json or agent file is a deliberate statement about their own tools, and the floor deleted it silently: the only remedy was an undocumented global boolean with no dashboard control, so the choice could be neither expressed nor recovered. mcp.honour_auto_approve now defaults to on and the list survives the spec rebuild. The default had to move in the LOADER as well as on the dataclass field: _build_mcp_config sets the field on every load, so a default declared only on the field never reaches a loaded config and the change would have been inert for every real install. An absent key now reads as on; opting out still takes a real false, and a value of the wrong type is removed by the schema validator, so it reads as absent and the documented default applies. The governance ceiling is untouched and still wins: a governed ref keeps nothing whatever the setting says, because the ceiling is the operator's policy from a trust root the agent process does not own, not a preference of whoever uses the machine. Granting an exemption is as much a permission decision as revoking one, so an honoured owner-written list now emits mcp_auto_approve_honoured beside the existing withheld event, naming only the verbs no spec declares.
5e55a33 to
35e5ec1
Compare
|
Rebased: The base gained #14393, #14408 and #11121. |
35e5ec1 to
b109751
Compare
b109751 to
ed836eb
Compare
… list[str] The honoured branch tested 'no spec declared this' rather than provenance, so an app manifest's autoApprove and a Kiro Crew authored entry inherited the exemption once the key defaulted on. Provenance is now PASSED by the two app writers, which alone know their keys are not the owner's -- a shipped agent spec picks its own server names and need not namespace them, so no test on the merged map could separate them. The name shape and the provenance marker remain as defence for the host writer, whose input is the owner's own config. A value that is not a list[str] is also declined: kiro-cli rejects it and no rebuild repairs the spec. All of them fall through to the strict floor.
ed836eb to
77653de
Compare
|
Stopping the drive-to-green loop here and handing this to the maintainer: the blocking finding on The wall. "Owner-written" cannot be both DURABLE and POSITIVELY AUTHENTICATED on this codebase:
So every source the honoured branch can reach is either agent-writable or not durable. Four rounds of narrowing (app manifest keys, the shipped agent spec's un-namespaced keys, the per-agent policy's What is already fixed and stands on its own, whichever way the decision goes: the app-materialized map declines the opt-in outright; an app's The three options, for the maintainer. (1) Move the owner's statement into Kiro Crew's own owner-gated Recommendation is (1): it honours the same intent without inferring authorship from a file the agent can write. |
|
/ai-review override gpt 77653de: Maintainer decision to accept the injection window; mcp.json stays the owner's own file and every honoured grant is audited. |
Human judgment recorded@bolichen97 marked the gpt AI finding as false positive, not applicable, or explicitly accepted for
This decision applies only to this commit. A new push requires a new judgment. |
|
/ai-review override first-principles 77653de: Maintainer decision to flip this default; the RFC recording it ships with the change. |
Human judgment recorded@bolichen97 marked the first-principles AI finding as false positive, not applicable, or explicitly accepted for
This decision applies only to this commit. A new push requires a new judgment. |
Problem / Motivation
Goal: An
autoApprovelist the owner wrote themselves is honoured again, so the tools they exempted stop asking.An
autoApprovelist the owner wrote themselves, in~/.kiro/settings/mcp.jsonor directly in an agent file, was deleted from the agent config Kiro Crew writes.
The owner saw no notice: a
logger.infoline and a SEL event, neither of which aperson reads. Tools they had deliberately exempted started showing approval cards
again with nothing explaining why, and the documented way back was a config key
with no dashboard control, so recovering the choice meant hand-editing
config.jsonand restarting.Why it matters
The list is not something that arrives by accident or from a third party: the
owner typed it into their own file, about their own tools, on their own machine.
Dropping it removed the only way they had to say "stop asking me about this
tool", did so silently, and offered a remedy they could not discover. A product
may decline to honour a dangerous request; it should not quietly discard a
deliberate one and leave nothing in its place.
Not a goal
mcp.honour_auto_approve. It belongs in Settings, andits absence is part of what made the old default hard to live with, but the key
is now on by default, so the missing control no longer stands between anyone and
the behaviour they asked for.
would let an owner honour their own list on one server while keeping the strict
floor elsewhere, and nothing here forecloses that.
allowedTools, the other route around the gate. It keeps its ownceiling filter, untouched.
this setting says, and making an owner's config able to widen an operator's
policy is deliberately out of scope.
What changed (motivation -> approach -> change)
src/kiro_crew/config/sections.pyhonour_auto_approvedefaults toTrue, with help text naming what anautoApprovecostssrc/kiro_crew/config/loader.py_build_mcp_configreads an ABSENT key asTruesrc/kiro_crew/platform/governance.pymcp_auto_approve_honoured; the ceiling branch is unchangedconfig-baseline.jsondocs/architecture/mcp.md,src/kiro_crew/docs/agent-spec-fields.mddocs/request-for-change/rfc-owner-written-mcp-auto-approve.md,docs/request-for-change/README.mdtest/test_config_mcp_section.py,test/test_agent.py,test/test_computer_use_registration.py,test/test_app_mcp_scoping.pyGoal: respect the owner's own statement about their own tools, without widening
anything an operator controls.
Approach: the mechanism was already there.
strip_ungoverned_auto_approvehas anhonoured branch gated on
mcp.honour_auto_approve, so the change is the DEFAULTrather than new logic, which keeps the strict floor reachable by one real
falseinstead of replacing it.
Change:
McpConfig.honour_auto_approvedefaults toTrue, with help text that nameswhat an
autoApproveactually costs rather than only what the key does._build_mcp_configreads an ABSENT key asTrue. This is the load-bearing half:that builder sets the field on every load, so a default declared only on the
dataclass never reaches a loaded config and the change would have been inert for
every real install. A new test pins the default through the real load path,
which is the test whose absence let that trap exist.
mcp_auto_approve_honoured, besidethe existing withheld event. Granting a gate exemption is as much a permission
decision as revoking one, and until now only the revocation reached the security
feed, so the calls that skip the gate left no trace of why they were allowed to.
Only verbs no server spec declares are reported: what a spec declares is Kiro
Crew's own emission, not the owner's decision.
Deliberately unchanged:
may_skip_gate_now. A governed ref keeps nothing whateverthe setting says, because the ceiling is the operator's policy loaded from a trust
root the agent process does not own, not a preference of whoever uses the machine.
No config value can widen it, and a test pins that the owner's choice loses to it.
allowedToolskeeps its own ceiling filter, untouched.Backwards compatibility
Compatible in the sense the checklist asks about: nothing is rejected, renamed or
removed, and no writer sweep is needed because no contract tightened. It is a
CHANGED DEFAULT, which is the reason the RFC exists.
What behaves differently: a host whose owner had written an
autoApprovekeeps iton the next spec rebuild instead of losing it, so those tools stop prompting
again, and those calls do not reach
hooks.on_tool_call. An operator who wantsevery MCP call gated sets
mcp.honour_auto_approvetofalse, which restores theprevious behaviour exactly. A host that never had an
autoApprovesees no change,which is the common case. Enterprise hosts with a governance ceiling are entirely
unaffected.
Tests
test_honour_auto_approve_defaults_to_onandtest_an_absent_key_reads_as_on_through_the_real_loadpin the new default atboth layers, the second specifically through the loader that decides it.
test_a_real_false_opts_outandtest_a_value_that_is_not_a_boolean_degrades_to_the_defaultpin the opt-out andwhat a hand-edited wrong type does.
test_refresh_keeps_a_user_added_auto_approve/test_existing_config_keeps_a_hand_added_mcp_auto_approvepin preservation onthe two spec-writing paths;
test_opting_out_drops_...andtest_refresh_drops_a_user_added_auto_approve_when_opted_outkeep the strictfloor covered rather than deleting that coverage with the old default.
test_honouring_an_owner_written_list_emits_its_own_event,test_a_declared_list_is_not_reported_as_the_owners_decisionandtest_the_ceiling_still_wins_over_the_owners_choicepin the new audit event andthe ceiling boundary.
Manual verification
Exit codes read from each checker itself, not through a pipe:
mypyon the threechanged modules 0;
black --checkon every changed non-baselined file 0(
test/test_app_mcp_scoping.pyis in.github/black-baseline.txtand was editedby hand to match its existing style rather than reformatted);
./scripts/docs-lint.sh0; and the 22 test files touching this filter or the key, 2258 passed, pytest exit
0.
config-baseline.jsonwas regenerated withscripts/generate_config_baseline.pyrather than hand-edited.Also checked on a live host that the emitted
~/.kiro/agents/kirocrew.jsoncarries no
autoApprovetoday and that the sharedmcp.jsondeclares none, sothe behaviour this changes is reachable only for an owner who wrote one.
Screenshots / video
N/A -- no frontend surface is touched. The setting has no dashboard control today,
which the RFC records as deliberately out of scope for this change.
Related Issues
N/A -- raised directly by the maintainer, whose decision the RFC records.
Checklist
agent-spec-fields reference, the RFC and its index row