Repository navigation
Description
Context
Found while implementing #3797 (epic #3791). The host GitHub read tools send model-chosen data to GitHub: brain_github_issue_search sends the search text (packages/ui-server/src/github/host.ts, search), and brain_github_issue_read sends a repository name and number. The provider policy's data routing (G2) treats every third party that receives model-chosen data as a recipient: Apify is one (APIFY_RECIPIENT), and so is each web search provider (packages/ui-server/src/web-tools/recipients.ts, applied in webRoutingRefusal, packages/ui-server/src/web-tools/routing.ts:13). A conversation that has been shown a provider folder a recipient may not receive sends that recipient nothing.
The GitHub tools do not apply this rule today. Text from a folder routed away from GitHub could therefore reach GitHub inside a search query. Neither #3797, #3798 nor #3799 names G2 routing in its scope.
Scope
- Name GitHub as a provider-policy recipient
github, using the same mechanism as the web tools (recipients.ts) and Apify (APIFY_RECIPIENT). - Before any request, refuse a GitHub read or search (
brain_github_issue_search,brain_github_issue_read, and any other read tool registered under ui-sdk, ui-server: GitHub tool contract, dedicated credential and host read tools #3797) whose session exposures include a folder not routable togithub, by the same rules aswebRoutingRefusal(packages/ui-server/src/web-tools/routing.ts:13), including refusing when exposure cannot be judged. Use a coded refusal (policy_deniedwith a routing reason) and send nothing. - Document in the provider policy reference (and the GitHub tools docs, if ui-server, docs: prove the Network card for raw GitHub API connections and document the GitHub tools #3799 has landed them) that
githubreceives read/search input under G2, and that the write tools are not G2-routed: each write is gated by its owner approval card and theoutward.github.repositoriesallow-list instead.
Out of scope
-
Applying G2 routing to the write tools (ui-server: GitHub write tools behind a policy repository allow-list and approval cards #3798). Ruled out: the approval card, which shows the exact body, is the gate for writes.
-
Egress for raw connections, which keep the
Networkcard (ui-server, docs: prove the Network card for raw GitHub API connections and document the GitHub tools #3799). -
Any change to which repositories a read may reach (bounded by the token).
Acceptance criteria
- A session that has been shown a folder whose routing excludes
githubgets a codedpolicy_deniedrefusal frombrain_github_issue_searchandbrain_github_issue_read, and the loopback stand-in receives no request (test). - A session whose exposure cannot be judged under a policy that restricts
githubis refused the same way (test). - A session with no such exposure reads as before (test).
- A write in a session with such an exposure still reaches its approval card unchanged (test), pinning the ruling that writes are not G2-routed.
- The provider policy reference names the
githubrecipient and states the write exemption. - Mutation receipt: skip the routing check, and the refusal test fails.
Verification
bun run test packages/ui-server/tests(new GitHub routing cases).
Contract impact
Additive: a new recipient name (github) in the provider policy reference, and a new refusal reason on the GitHub read tools. Policies whose provider rules do not allow github begin restricting GitHub reads for those folders, which is the intended G2 effect; the release notes say so.
Ruled on 2026-11-16 (see the decision comment): gates 0.45.0, the recipient is named github, and writes are not G2-routed (the approval card is their gate).
Updated 2026-11-16: scope, out of scope, acceptance criteria and contract impact rewritten for the maintainer ruling (gates 0.45.0; recipient github; reads only, writes stay card-gated).
Activity
schlessera commentedon Nov 16, 2026
Decision (maintainer, 2026-11-16):
priority: p1, and epic Epic: hosted turns read and file GitHub issues through governed host tools #3791 does not close without it. The GitHub tools ship with the same data-routing guarantee as Apify and the web providers.github. This matches the lowercase company-name convention (apify,exa, …). No GitHub or Microsoft inference recipient exists today; if one is added, its naming is a separate decision.outward.github.repositoriesallow-list as their gate. Routing applies to reads and searches only. The provider policy reference states the exemption, and a test pins that a write still reaches its card in an exposed session.The scope, out of scope, acceptance criteria and contract impact in the body now follow this ruling.
schlessera commentedon Nov 17, 2026
Claimed for implementation. Claim token:
claim-403a041a. Branch:feat/4029-github-g2-routing.closure-only collisions (shared test graph), no path collisions
CONTRACT: feat(ui-server): route the host GitHub reads under the prov…
schlessera commentedon Nov 17, 2026
Merged in #4124 as
3714b7ff2through the integration lease (orchestrator merge queue for 0.45.0). Candidate confirmation passed on the exact head; the squash's own main run carries the post-merge heavy categories.