Skip to content

scoping: agent token repositories sent to access_tokens API as owner/repo (needs runtime verification) #294

Closed

Description

@goodtune

Summary

Needs runtime verification. Agent (gha_) token repository restrictions are sent to GitHub's installation access_tokens API as owner/repo. GitHub's API expects bare repository names in repositories (or numeric repository_ids).

Evidence

  • internal/github/app.go:198-200 - repositories passed through unchanged.
  • internal/proxy/proxy.go:664-667 - values come from the token's owner/repo list.
  • Source: recon consensus.md A6; confirmed from code by two reviewers; runtime behaviour UNVERIFIED.

Impact

If GitHub rejects or ignores the owner/repo form, either every agent-token request fails at installation-token minting, or (worse) the minted installation token is not narrowed to the intended repositories, so the GitHub-side defence-in-depth is lost.

Proposed fix

Strip the owner (and verify it equals the installation account, rejecting mismatches at token creation), or resolve and send repository_ids. Add a unit test on the request body sent to access_tokens.

Verification

The scope regression rig (/tmp/ghp-rig) carries a scenario for this item. It is marked known_issue until this is fixed; once fixed the rig asserts the expected result and the known_issue marker is removed. The rig probes this once against a real installation to confirm GitHub's behaviour.

Activity

  1. added
    bug
    on Nov 5, 2026
  2. added 2 commits that reference this issue on Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsecurity

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions