Repository navigation
feat(governance): govern which discovery registries Discover may query - #28530
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The key is named in the accepted LTS-edition RFC's "Extension sources" row. It is open by default in every edition, so main's defaults do not change, and all four existing What this change shipsInventory (6 items) — 6 justifiedIntent: let an enterprise operator's security policy limit which skill and MCP discovery registries Discover queries. This is an ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 7d76f9e Description read[DESCRIPTION-READ] 616296cc367fc622e74c28165aacefaac64e67a2a9fa3593564da232438e9cda That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. The key only adds restriction: an unnamed key admits everything, as before, and it narrows Discover in the one shared gate that all four registry call sites go through. Notes
[DESIGN-REVIEWED] 7d76f9e Description read[DESCRIPTION-READ] 533637047203b7bbf5e4ccc3069d2e3168b13792d7ede987f6e6d6e0ac3478a1 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 |
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: |
Disposition: accepted, release-notes only. The Backwards compatibility section now names edition-contributed providers and flags this as a release-notes item. CHANGELOG.md belongs to the release PR (AGENTS.md), so this PR doesn't edit it. No code change. |
0c55800 to
1df3c51
Compare
|
Hold for human review at 1df3c51 (security-policy change). This PR changes which external discovery registries the gateway is allowed to contact. It adds the governed key I found no defect. The key is matched on the host of — crew-pr-reviewer (r143) |
hkrishg-aws
left a comment
There was a problem hiding this comment.
Thanks for building this, and for the credit. Reviewed against the branch; the design matches what we agreed in #12677.
What I checked: the key is asked in the shared admits_registry gate before the edition policy, so the stricter wins, and reading the context first keeps a composition failure from reading as a policy denial. registry_host_denied judges the host of api_base, never the provider name, and goes through _denied, so it fails closed and audits governed decisions. The enterprise baseline is off and covered in test_governance_enterprise_baseline.py. The new tests cover allow, deny, the * catch-all for hostless providers, host-only matching, stricter-wins, enterprise defaults, error-denies and never-registered. CI is green.
One non-blocking suggestion: registry_host_denied derives the host with _url_host, a single stdlib reading. The other host-keyed checks use url_policy_hosts (decisions/capability.py:286, metrics/otlp_governance.py:53), which asks every client's parser and requires all readings to permit. api_base comes only from built-in and edition providers today, so nothing exploits the difference. But if a provider ever takes api_base from config, https://evil.example\@skills.sh/ reads as skills.sh here while aiohttp connects to evil.example. Checking every reading from url_policy_hosts would keep this key consistent with the others. Happy for that to be a follow-up.
I'll close #16007 as superseded by this PR and the enterprise-edition RFC. I'm also glad to take operator docs with an example security_policy.json as a follow-up, since this PR only touches the system specs.
|
Could you update this branch onto the latest main? The branch has a merge conflict on head 1df3c51, so it cannot merge as is. The gate shows 98 checks passed and none red. I read the full diff (8 files, 393 lines). I have no change to ask for on the design: in the default edition an unnamed |
1df3c51 to
26917fb
Compare
26917fb to
9ebf66a
Compare
bolichen97
left a comment
There was a problem hiding this comment.
Thanks, the opt-in key itself is good to keep: external_access.registry_hosts as a host-matched ruleset, checked in the shared admits_registry gate, with the edition policy asked after it. Two parts of this head add new refusals where main admits today, and our current rule is not to add security strictness in a PR like this. Please drop just those two parts.
-
Unset key in Enterprise must behave as main does.
platform/governance_parts/baseline.pyadds"external_access.registry_hosts": _OFF, so an Enterprise install with no policy for the key now refuses every discovery registry (skills.sh, GitHub, the official MCP registry, andskill_discoverthrough the gateway).test_governance_enterprise_baseline.pypins that as((), ("skills.sh",)). Please remove the baseline entry so an unset key admits as main does, and an org that wants the ceiling sets the key on purpose. Please update the baseline test to match, and add a test that an Enterprise install with the key unset still admits skills.sh and the official MCP registry. -
A governance read error must not newly deny Discover.
registry_host_deniedgoes through_denied, which is fail-closed, sotest_a_governance_error_deniespins that an unreadable profile store with no key set refuses skills.sh. Main admits in that case. Please log the error (through the same audit/log path as other decisions) and admit, as main does, instead of refusing. Please replace that test with one asserting the error is logged and the registry is still admitted. An explicit allow or deny list that the policy does set should keep working as in your other tests.
The docs in governance.md ("fail-closed") and platform-context.md should follow both changes. Happy to re-review once these are in.
bolichen97
left a comment
There was a problem hiding this comment.
Re-checked at 8ec6d28: both points from my 11-06 review are still open, so I'm restating them briefly. Keeping the external_access.registry_hosts key itself is fine.
- Unset key in Enterprise still refuses every registry.
platform/governance_parts/baseline.pystill adds"external_access.registry_hosts": _OFF, andtest_enterprise_unnamed_key_admits_no_registrypins it. Please drop that entry so an unset key admits as main does, and test that Enterprise with the key unset still admits skills.sh and the official MCP registry. - A governance read error still denies.
registry_host_deniedgoes through the fail-closed_denied, andtest_a_governance_error_deniespins that. Please log the error and admit, as main does, with a test for that.
The "baseline is off" line in governance.md should follow. An allow or deny list that a policy sets should keep working as your other tests show.
8ec6d28 to
b987983
Compare
b987983 to
dabb002
Compare
|
@bolichen97 thanks for the review (review). Both asks are done on head
An allow or deny list a policy sets still narrows Discover, now tested on LTS too ( The stricter LTS default the RFC row describes (off by default, fail closed) is split out as a proposal for a maintainer to decide in #34006. hkrishg-aws's suggestion to read the host through |
|
Follow-up: #34006 proposes, for a maintainer to decide, that on Enterprise/LTS installs |
dabb002 to
880ed5e
Compare
Add the governance key external_access.registry_hosts, a host-matched ruleset that lists the skill and MCP discovery registries the Discover surfaces may query. It is the LTS-edition RFC's "Extension sources" row. admits_registry asks it on the host of the provider's api_base before the edition's external_access policy, so the stricter of the two wins and an edition cannot loosen the operator's policy. The key is additive. An unnamed key admits every registry, as before, in oss and LTS alike (it is in BASELINE_UNGATED), so only a policy that names it narrows Discover; an allow or deny list a policy sets applies on both. A governance error on the key is logged and audited as governance_degraded and the registry is admitted, as Discover did before the key existed. A policy that names the key, which the parser refused before, now loads. The catalogs are built once per process, so a change binds at the next gateway start. Whether LTS should default the key to off and fail closed is proposed separately in #34006. Fixes #12677
880ed5e to
7d76f9e
Compare
bolichen97
left a comment
There was a problem hiding this comment.
Approving at 7d76f9e. Thank you: both points from my reviews are done.
- An unset key now admits every registry in every edition.
baseline.pymarksexternal_access.registry_hostsas_OPEN("Discover queries every registry unless a policy names the key"), andtest_lts_unnamed_key_admits_every_registrychecks that LTS with the key unset still admits skills.sh, GitHub and the official MCP registry, and writes nothing new to the SEL. So with no policy, Discover behaves as on main. - A governance read error now admits.
registry_host_deniedcalls_denied(..., fail_closed=False), which logs the error and recordsgovernance_degradedinstead of denying.test_a_governance_error_is_logged_and_admits(oss and LTS) andtest_an_error_inside_the_evaluation_is_logged_and_admitspin it. The other governed keys stay fail-closed as before.
What a policy turns on is an opt-in admin narrowing: an allow or deny list of registry hosts, matched on the host of the provider's base URL. The allow and deny tests show it works. governance.md and the module docs follow the new defaults, and the RFC references now point at rfc-crew-lts-edition.
A PlatformCompositionError still propagates from this gate, as it does from the other governance gates. That only happens when the platform context is not composed at all, so it is not a refusal a working install meets.
No regex, and with no policy nothing is refused that main allows. All checks on this head are green.
Problem / Motivation
Goal: Let an operator's security policy choose which skill and MCP discovery registries the Discover surfaces may query.
The Discover surfaces (Add Skill, Add MCP Server, and the agent's
skill_discover) query skills.sh, the GitHub API and the official MCP registry. The policy has no key for that: asecurity_policy.jsonnaming one is refused whole as an unknown governed key, and the public default admits every registry. An LTS build queries all three too, although the accepted LTS-edition RFC lists this control ("Extension sources") as off by default.Why it matters
An enterprise deployment that must limit which registries developer machines browse (the reporter's case in #12677) cannot say so in the policy it already controls, and an LTS build reaches public registries its own RFC says stay off until the policy names them.
Not a goal
_local_sourceshalf), or install itself (capabilities.extension_installalready does).kirocrew policy validatewarning when a list covers one catalog and not the other.What changed (motivation → approach → change)
The registry gate already existed: every provider is admitted through
_shared_access.admits_registry, and a refused one is never registered. It only asked the edition's policy. The design was agreed in #12677's comments, and the key comes from the accepted LTS-edition RFC, appendix row "Extension sources". Following the maintainer review, the key ships additive: it adds no refusal main does not already make. Whether LTS should default it to off and fail closed, as the RFC row says, is proposed separately in #34006.external_access.registry_hosts(platform/governance_parts/catalog.py, listed inBASELINE_UNGATEDinbaseline.py): a host-matched list, likenetwork.egress. One list covers both catalogs.admits_registryasks that key first, throughregistry_host_deniedinsrc/kiro_crew/extension_governance.py, on the host of the provider's base URL (never its name), then the edition's policy. The stricter wins, so an edition cannot loosen the operator's policy.ossor LTS: every registry is admitted, as before. An allow or deny list a policy sets narrows Discover on both.governance_degraded, and the registry is admitted, as Discover did before the key existed._deniedgains afail_closedswitch for this; every other key keeps failing closed. APlatformCompositionErrorstill propagates.Backwards compatibility
Not breaking. With no policy naming the key, Discover queries the same registries as on main, on
ossand LTS. Writer sweep on origin/main @ f745d26:admits_registryhas four callers,discover.py(skills.sh, GitHub, edition providers) andmcp_discover.py(official registry); each already drops a refused provider, so a registry a policy refuses is simply absent. A policy that names the key, which the parser refused before, now loads.Reader: src/kiro_crew/dashboard/handlers/discover.py:_build_registry -- chat -- a refused provider is not registered, as for an edition denial | test_a_denied_registry_is_never_registered
Reader: src/kiro_crew/dashboard/handlers/mcp_discover.py:_build_registry -- chat -- same | test_a_denied_registry_is_never_registered
Reader: src/kiro_crew/mcp_tools/skills.py:skill_discover -- subagent -- goes through the gateway's discover endpoint, so it sees the same registry set | test_lts_unnamed_key_admits_every_registry
Tests
test/test_governance_registry_hosts.py: the key loads with the host matcher (flat and nested);ossand LTS without the key admit everything (skills.sh, GitHub, the official MCP registry) and write no audit; allow and deny lists by host, onossand LTS; the host is matched, never the URL or provider name; an empty host matches only*; the stricter of edition and ceiling wins; a governance error, raised around or inside the evaluation, is logged throughaudit_governance_degradedand admits; aPlatformCompositionErrorpropagates; a refused registry is never registered.test_governance_lts_baseline.pylists the key among the open scopes, so its generic tests check that an unnamed key keeps Crew's default and a policy deny still closes it.Proof: PROVEN test/test_governance_registry_hosts.py::test_lts_unnamed_key_admits_every_registry[no-ceiling], test/test_governance_registry_hosts.py::test_lts_policy_deny_list_narrows, test/test_governance_registry_hosts.py::test_a_governance_error_is_logged_and_admits[lts] (head dabb002)
Determinism: the new file passed 20 serial repeats and an
-n 4run with its neighbours. Mutation check: putting back the LTS_OFFrow fails 5 tests, and making the key fail closed fails 4.Manual verification
N/A — unit coverage sufficient: the tests drive the real parser, baseline and both
_build_registryfunctions; no UI changes.Related Issues
Fixes #12677
Refs #16007 (the reporter's RFC asking whether this belongs in the public policy).
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.