Skip to content

ui-server: GitHub write tools behind a policy repository allow-list and approval cards #3798

Closed

Description

@schlessera

Context

Part of #3791 (rulings and shared context live there). This is the second slice: the two write tools, the policy allow-list that bounds them, and their approval cards. It builds on slice 1's contract and credential.

Blocked by #3797

Scope

  • Register and implement brain_github_issue_create (title, body, labels) and brain_github_issue_comment for both backends, using slice 1's schemas and credential.
  • Governance policy key outward.github.repositories: ["owner/repo", "owner/*"] (final shape in the PR): entries are exact or one trailing /*, the owner is case-insensitive, and unknown keys and malformed entries are refused. An absent or empty list means no GitHub writes.
  • A write outside the list is refused before any card, with a reason naming the policy key, and recorded as an outward_action refusal.
  • A write inside the list raises the outward approval card, showing repository, title/body and labels exactly as they will be sent. An edited input is rechecked, as in backends: ask before an agent acts outside the brain in the user's name, unless the policy allows it #1664. Voice may refuse but never approve. Autonomous envelopes expose no write tools and cannot dispatch writes. Within an interactive/voice session, tool definitions and order stay fixed across profile/configuration/handler changes; enforce current availability at the host permission boundary. Each write is recorded as outward_action and listed as irreversible.

Out of scope

  • Read tools and the credential (slice 1).
  • The raw-connection card check and the docs (slice 3).
  • PR creation, merge, label administration, project boards.

Acceptance criteria

  • brain_github_issue_create to an allowed repository raises one card with the exact repository, title, body and labels. Allow creates exactly one issue. Deny, or a changed input after approval, sends nothing. Tests cover all three against a loopback stand-in.
  • A write to a repository outside the list is refused before any card is emitted, with no request sent. The exact and owner/* forms reach the card. An absent list refuses all writes. Policy validation refuses malformed entries. Tests cover each.
  • Voice cannot approve a write, and autonomous turns cannot call the write tools (tests). The stable-roster test pins write names and schemas across interactive/voice modes and separately proves their absence from the restricted autonomous envelope. No turn changes an existing session’s provider-facing roster.
  • Mutation receipt: skip the allow-list check, and the "outside the list" test fails.

Verification

  • bun run test packages/ui-server/tests packages/ui-backend-claude/tests packages/ui-backend-pi/tests (new write, policy and roster cases).

Contract impact

Additive CONTRACT: a new governance policy key in the policy reference. The write tool names were already declared in slice 1's contract.

Triage 2026-11-09 at main 9c7eb25825fdad5f4485db0df472188805edb450: Made the existing autonomous exclusion and per-session fixed-roster obligations explicit together, without widening write authority. The allow-list and per-call approval ruling is settled. #3797 remains open; the complete brief may be agent-ready while dependency-blocked.

Activity

  1. added this to the 0.45.0 milestone on Nov 9, 2026
  2. added
    type: feat
    area: ui-server
    area: backends
    priority: p1
    blocked
    contract
    on Nov 9, 2026
  3. added
    agent-ready
    on Nov 9, 2026
  4. schlessera commented on Nov 15, 2026

    @schlessera
    OwnerAuthor

    Unblocked: #3797 is closed, so scripts/sync-project.ts is removing the blocked label.

  5. removed
    blocked
    on Nov 15, 2026
  6. self-assigned this
    on Nov 15, 2026
  7. schlessera commented on Nov 15, 2026

    @schlessera
    OwnerAuthor

    Claimed for implementation. Claim token: claim-eff337f8. Branch: feat/3798-github-write-tools.

    Path collision only on docs/decisions/governed-writable-workers.md with several open PRs; no source-path collisions with the GitHub host files.

  8. schlessera commented on Nov 16, 2026

    @schlessera
    OwnerAuthor

    Merged in #4076 as ee55de168 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-readyarea: backendsarea: ui-servercontractpriority: p1type: feat

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions