Skip to content

ui-server: apply provider-policy data routing (G2) to the host GitHub tools #4029

Closed

Description

@schlessera

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 to github, by the same rules as webRoutingRefusal (packages/ui-server/src/web-tools/routing.ts:13), including refusing when exposure cannot be judged. Use a coded refusal (policy_denied with 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 github receives read/search input under G2, and that the write tools are not G2-routed: each write is gated by its owner approval card and the outward.github.repositories allow-list instead.

Out of scope

Acceptance criteria

  • A session that has been shown a folder whose routing excludes github gets a coded policy_denied refusal from brain_github_issue_search and brain_github_issue_read, and the loopback stand-in receives no request (test).
  • A session whose exposure cannot be judged under a policy that restricts github is 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 github recipient 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

  1. added
    type: featA new capability or a change in user-visible behaviour.
    area: ui-serverHono app factory: turn coordinator, auth, session catalog, routes, cron.
    needs: decisionBlocked on a maintainer or designer ruling, not on code.
    on Nov 15, 2026
  2. added
    agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.
    priority: p1Scheduled into the current or next milestone.
    on Nov 16, 2026
  3. added this to the 0.45.0 milestone on Nov 16, 2026
  4. removed
    needs: decisionBlocked on a maintainer or designer ruling, not on code.
    on Nov 16, 2026
  5. schlessera commented on Nov 16, 2026

    @schlessera
    OwnerAuthor

    Decision (maintainer, 2026-11-16):

    1. Gates the release. It is in 0.45.0 at 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.
    2. Recipient name: 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.
    3. Writes are not G2-routed. The write tools from ui-server: GitHub write tools behind a policy repository allow-list and approval cards #3798 keep their owner approval card (which shows the exact body) and the outward.github.repositories allow-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.

  6. self-assigned this
    on Nov 17, 2026
  7. schlessera commented on Nov 17, 2026

    @schlessera
    OwnerAuthor

    Claimed for implementation. Claim token: claim-403a041a. Branch: feat/4029-github-g2-routing.

    closure-only collisions (shared test graph), no path collisions

  8. schlessera commented on Nov 17, 2026

    @schlessera
    OwnerAuthor

    Merged in #4124 as 3714b7ff2 through 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.area: ui-serverHono app factory: turn coordinator, auth, session catalog, routes, cron.priority: p1Scheduled into the current or next milestone.type: featA new capability or a change in user-visible behaviour.

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions