Skip to content

feat: give a sandbox's GitHub token every repository the app is installed on - #18

Merged
OmarAlex24 merged 1 commit into
feat/sandbox-sub-sandboxesfrom
feat/sandbox-github-all-repos
Nov 11, 2026
Merged

OmarAlex24 merged 1 commit into
feat/sandbox-sub-sandboxesfrom
feat/sandbox-github-all-repos

Conversation

@OmarAlex24

@OmarAlex24 OmarAlex24 commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Problem

Each sandbox gets an hour-long GitHub App installation token, renewed by the host every 20 minutes. It was minted for the sandbox's own repository only (repositories: [<repo>]). An agent that also works on another repository the app is installed on got 403 "Resource not accessible by integration" and could not push or open PRs. A push that changes .github/workflows/ was refused too, because the app had no Workflows permission.

Solution

  • Token scope. createInstallationToken sends no repositories restriction, so the token covers every repository the installation covers. The user picks those repositories in the installation's settings on GitHub.

    • The host still finds the installation through the sandbox's own repository. If the app isn't installed there, the launch warns as before.
    • The record still keeps repository, which the renewal uses.
  • Manifest. New apps ask for workflows: "write". The description now says the token covers every repository the app is installed on.

  • Settings text. The GitHub App row and the config form no longer say the token is for one repository.

  • Docs. A new "GitHub in a sandbox" section in docs/user/remote-access.md covers:

    • which repositories the token reaches, and where to change that list (Installed GitHub Apps → Configure → Repository access);
    • that a change reaches a running sandbox with its next token, within about 40 minutes;
    • that an app made before this needs Workflows set to Read and write, and each installation must approve that change.

    docs/internals/sandbox-environments.md has a matching note.

Known limitations

  • Wider reach. An agent on a sandbox can now push to every repository the app is installed on, not just the sandbox's own. Keep the installation's repository list to the ones agents should touch.
  • Token renewal needs the Mac awake. The token is renewed by the host. If the Mac sleeps for more than an hour, pushes fail until it wakes.

Test plan

  • SandboxProvisioner.test.ts: the launch's and the renewal's mint requests carry no repositories, and the renewal keeps the record's repository
  • Manifest tests (server and browser) expect workflows: "write"
  • SandboxAccessRows.browser.test.tsx 9/9 and SandboxEnvironmentFields.browser.test.tsx 23/23
  • Checked from a sandbox before the change: its token reached only the sandbox's own repository, and a PR to another installed repository returned 403
  • vp run check:changed origin/feat/sandbox-environments on the top of this stack (feat/sandbox-agent-skill, which includes this branch): format, lint, knip, graphql, typecheck (38 packages) and React compiler pass. 818 of 819 tests pass; the one failure, sandboxSetup.test.ts > tailscaleScript > falls back to userspace, joins with the key as a 0600 file, and the scrub logs out, fails on feat/sandbox-environments too.

🤖 Generated with Claude Code

…lled on

The token was minted for the sandbox's own repository only, so an agent
working on a second repository got "Resource not accessible by
integration". It now covers the installation's repositories, which the
user picks on GitHub; the installation is still found through the
sandbox's repository. The manifest also asks for workflows: write so a
push that changes .github/workflows/ is accepted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@OmarAlex24
OmarAlex24 added this pull request to stack #13 November 11, 2026 14:55
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M labels Nov 11, 2026
@OmarAlex24
OmarAlex24 merged this pull request into feat/sandbox-environments Nov 11, 2026
8 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant