Skip to main content
GitHub egress lets processes in a sandbox clone, fetch, and push to GitHub, and call the GitHub API, with no GitHub token in the VM. Requests go through the Tilde gateway. The gateway checks each one against the blueprint’s egress grant, adds the GitHub credential from a connection, and records it in the agent’s trace. Use it when an agent should work on your repositories in a sandbox: open a branch, push commits, and open a pull request. The agent can push only to the branches you grant, and never to the default branch.

Before you start

  • A sandbox blueprint, given to an agent.
  • An image whose sandbox process runs as root, such as a Tilde sandbox image. The process writes /etc/gitconfig to point git at the gateway.
  • A GitHub connection: a GitHub App, Personal access token, or OAuth app connection that is ready and not personal.
Prefer a GitHub App connection. For each request, Tilde mints an installation token limited to the grant’s repositories and permissions. A personal access token or OAuth token cannot be narrowed, so only the gateway’s checks limit it.

Grant egress

1

Open the blueprint's Egress tab

Open the blueprint in Sandboxes, select Egress, and select Add egress.
2

Choose the connection and a slug

Choose the GitHub Connection. The Slug names the grant, such as github. It appears in the grant’s route and in TILDE_EGRESS_GITHUB_URL.
3

Narrow it

Choose the Repositories, the branches pushes may update under Push › Branches, and whether to allow Pull requests. See What a grant allows.
4

Enable it

Switch on Enabled, and select Save. A grant is off until you enable it.
Grant changes apply to the next request. Toggle Enabled in the list to pause a grant, or delete it to cut sandboxes off.

Try it

Ask the agent to make a change and open a pull request. Inside the sandbox, git works unchanged:
Call the GitHub REST API at $GITHUB_API_URL, with $GITHUB_TOKEN:
In the agent’s trace, each request is a sandbox.egress span under the invocation, with the repository, the decision, and the reason for any refusal.

What the sandbox sees

When the sandbox connects, tilde sandbox connect wires every shell for the blueprint’s enabled grants:
  • Git. /etc/gitconfig rewrites https://github.com/ to the gateway route, and makes tilde sandbox credential git’s credential helper for the gateway.
  • GITHUB_API_URL. The gateway route for the GitHub API.
  • GITHUB_TOKEN. The sandbox’s egress token. It is not a GitHub token.
  • TILDE_EGRESS_<SLUG>_URL. The grant’s route, such as TILDE_EGRESS_GITHUB_URL.
The egress token works only at the gateway, only for the blueprint’s enabled grants, and only while the sandbox exists. Every process in the VM, and the agent, can read it, which is why it carries no GitHub access of its own.
The GitHub CLI, gh, calls api.github.com directly, not $GITHUB_API_URL, so its API calls do not go through egress. Use curl or an API client you point at $GITHUB_API_URL. Git commands work either way.

What a grant allows

Every GitHub grant allows only git fetch and push, and REST calls that read a repository or work on pull requests, reviews, and issue comments. The gateway always refuses organization endpoints, repository deletion, and repository settings such as secrets, webhooks, deploy keys, collaborators, and branch protection. The grant narrows this further: A push is refused if it would:
  • Update a branch that is not granted, or any tag.
  • Delete a branch.
  • Force-push, or rewrite history in any other way.
  • Update the repository’s default branch, even when a pattern matches it.
Pushes are capped at 100 MiB, and signed pushes are not supported.

When a request is refused

Git and curl fail with HTTP 403. Open the agent’s trace, and read the sandbox.egress span’s reason, such as Pushing to refs/heads/main is not granted. To allow the request, change the grant. For example, add the branch pattern, or the repository.

Who can manage egress

Egress grants belong to their blueprint, and follow its access. Adding a grant also needs view on the connection.