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/gitconfigto point git at the gateway. - A GitHub connection: a GitHub App, Personal access token, or OAuth app connection that is ready and not personal.
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.
Try it
Ask the agent to make a change and open a pull request. Inside the sandbox, git works unchanged:$GITHUB_API_URL, with $GITHUB_TOKEN:
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/gitconfigrewriteshttps://github.com/to the gateway route, and makestilde sandbox credentialgit’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 asTILDE_EGRESS_GITHUB_URL.
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.
When a request is refused
Git andcurl 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 needsview on the connection.