Skip to main content
A GitHub connection gives an agent two surfaces with one short-lived GitHub App installation token per session: the GitHub MCP tools, which run outside the sandbox, and authenticated git, Git LFS, and gh inside the sandbox for cloning, building, testing, and pushing. Both use the same permissions and repository scope. Where the sandbox holds no GitHub credential, because the deployment restricts sandbox GitHub access or for a reason in Use git and gh in the sandbox, only the MCP tools are available and the agent is told to use them instead of git and gh.
Connecting GitHub and changing an agent’s access need the organization developer or admin role. See Organizations and roles. You also need a GitHub account that can install the GitHub App on the target organization or user account. Some organizations require an owner to approve new apps.

Connect GitHub

  1. In Integrations, click Add integration, then choose GitHub. Authorize the GitHub user so Recursion can find the App installations that user can access.
  2. Choose an existing installation, or choose Install on another account and select the account and repositories in GitHub. If none are available, Recursion starts installation automatically. For an existing installation, use Manage repositories on GitHub to change its repository access in a separate tab. Return to Recursion and click Continue to connect with the updated access. Choosing an already installed account on GitHub’s App installation page opens its settings without returning to Recursion.
  3. Back in Integrations, select the tools available to the organization and save. The picker describes each tool and groups the current GitHub tools as Read-only or Changes data. Merging a pull request changes data; the Destructive category is reserved for tools that delete data, and none of the current GitHub tools do so. Use the group checkboxes or Select read-only, Select all, and Clear to choose several at once. You can change this selection later with Edit tools on the connection.
The App’s installed permissions are fixed by its configuration. Choosing tools in Recursion narrows which MCP calls agents can make and which permissions their short-lived tokens request. It does not change the App installation’s permissions in GitHub. New connections start with the supported read tools; connections created before tool selection have all supported tools enabled. wait_for_pr comes with pull_request_read: a selection that includes pull_request_read also includes wait_for_pr, which needs no further permission. Agents that have wait_for_pr wait on a pull request’s CI, reviews, and comments with it, or with sleep’s wake_on_prs, instead of polling GitHub. The tool list comes from the production App’s permissions. The connection’s tool selection is a ceiling for every agent that uses it. Workflow-file editing is unavailable. To change repository access after connecting, open the installation’s settings in GitHub, save the new selection, then use Reconnect on the GitHub connection in Recursion. Reconnecting refreshes the repositories available through that connection while preserving agent grants.

Assign GitHub to an agent

  1. In the agent’s Integrations section, click Add integration and click the GitHub connection.
  2. In Tools, review each tool’s description and read-only or write classification. Use Select read-only, Select all, Clear, or the group checkboxes to choose a subset.
  3. In Repositories, choose specific repositories or All authorized repositories.
  4. Click Use this access, then save the agent version.
The agent’s GitHub token requests the permission categories required by its selected tools, for the MCP tools and for git and gh in the sandbox alike. There is no separate read/write token setting in standalone Managed Agents. Existing agent grants without a tool list retain their former read or write tool scope, subject to the connection’s current tool ceiling. Repository selections can only narrow the repositories installed in GitHub. If an administrator removes a tool from the connection, the agent’s saved selection still shows it as unavailable. Edit the agent’s GitHub access and uncheck the unavailable tool. To keep the access, select at least one available tool; otherwise, use Remove access. New sessions can use only tools still enabled for the connection. When using the API, set nativeIntegrations[].tools to the selected tool names. The permission field remains in the version contract for compatibility; the server derives its read or write value from the tools. You can discover supported tools through listIntegrationProvidersV2 and the connection’s enabled tools through listIntegrationConnectionsV2. For example, publish a new agent version with selected GitHub tools and one repository:
Templates name their GitHub tools, and an agent created from a template’s setup form in the console, or through the assistant’s Use defaults, receives that list. The PR reviewer reads pull requests, files and issues and writes pull request reviews, so its token carries pull request write permission and no permission to change contents or issues; the Issue fixer also creates branches, pushes files and opens pull requests. The setup form and the approval card list the tools and what their write permissions allow. If the connection does not enable one of a template’s tools, setup stops before anything is created and names the tools to enable on Integrations. Through the API, listAgentTemplatesV2 returns each template’s list as requires[].tools on its GitHub requirement; a template without the field leaves the grant at the permission’s preset. A new agent version or connection selection applies to new sessions. A new agent version also applies to a running session you move to it. Running sessions may keep credentials and tool lists they already received until they refresh or end. Disconnecting GitHub does not uninstall the GitHub App from the account. A token already issued to a running sandbox may work until it expires, within an hour; disconnecting stops new token issuance. Name repositories as owner/name, up to 500, where owner is the connection’s own account. A repository of another owner is refused; grant it through the connection for that owner. A new agent version replaces the whole definition, so include every field you want to keep.

Use git and gh in the sandbox

Depending on the deployment, the sandbox holds either the token itself or only a placeholder that Recursion replaces with the real token on the way to github.com and api.github.com, outside the sandbox; with a placeholder, nothing in the sandbox, including git credential fill, can read the token (except with privileged Docker, below), and everything below about using git and gh still applies except token expiry: Recursion adds the current token to each request, so a long-running command keeps working across token refreshes while Recursion keeps refreshing the token. When the sandbox holds the token, it reaches git, Git LFS, and gh through the sandbox’s credential helper, not through an environment variable: an agent that checks GITHUB_TOKEN finds nothing, but git clone, git push, and gh pr create against a granted repository authenticate. When the sandbox holds the token, it expires about an hour after it was issued. The platform refreshes it for subsequent sandbox commands, but a long-running command can outlive its token, and requesting credentials again inside that command does not renew it; run a long clone or LFS transfer as its own command. Any command in the sandbox can use the token, including commands an agent runs on untrusted input. The tool selection narrows the token’s GitHub permission categories and the repository selection narrows its repositories, but inside the sandbox the token allows every operation those categories permit, not only the selected tools: selecting create_pull_request alone still lets gh pr edit and gh pr close run on pull requests in the granted repositories, and push_files alone still lets git push --force run where the repository’s rules allow it. The per-tool allowlist applies to the MCP tools only. Grant only the repositories, and the permission categories, the agent needs. With a placeholder, only requests to github.com and api.github.com that send the sandbox’s own placeholder, as git and gh do, carry the token; a web page the agent opens in the sandbox’s browser does not get it. Other GitHub hosts receive the placeholder and don’t authenticate: gh release upload, which uploads to uploads.github.com, fails, and so do logins to ghcr.io and npm.pkg.github.com. For GitHub Packages for npm, use a vault credential instead. In an environment with privileged Docker, the placeholder is a weaker boundary: a command in the sandbox can reach the real token, and Docker containers the agent starts send their requests without it, so authenticated git inside a container fails. In deployments that deliver GitHub credentials through a placeholder, some sessions’ sandboxes hold no GitHub credential at all: git and gh are unauthenticated, and the GitHub MCP tools keep working. This happens when:
  • The session has more than one GitHub connection, such as two GitHub organizations. The sandbox can act as only one GitHub account, so it gets none; the MCP tools still cover every connection.
  • The environment’s network policy admits no GitHub host: No access, or rules that deny both github.com and api.github.com.
  • The environment’s compute runs where Recursion can’t add the token outside the sandbox.
  • The session reviews a pull request in an environment with no network policy. Such a review fails for the missing policy, unless a vault credential that Recursion adds outside the sandbox lets it start; it then runs without GitHub in the sandbox.
  • The session is part of an evaluation run and works in a copy of the evaluated session’s workspace: the copy holds no GitHub credential.
When GitHub refuses to issue a token for the grant, for example because a repository isn’t in the GitHub App installation, neither git and gh nor the GitHub tools work, since the tools use the same grant. Once you fix the installation, the GitHub tools work again on their next use. In a sandbox that was set up for that grant when it was created, Recursion checks the grant again at a sandbox command once about 20 minutes have passed since GitHub refused it, and also at other times while the session keeps working. After the check that finds it working, git and gh can work on that command; if the sandbox’s saved credentials haven’t refreshed yet, they work at a command up to about 15 minutes later. A sandbox whose git and gh hold the token itself (an older sandbox, or one in a deployment that delivers the token that way) instead picks it up at the first command after its credentials are due to refresh, normally within about 15 minutes of the fix while commands continue. In deployments that deliver GitHub credentials through a placeholder, a sandbox created without a GitHub credential doesn’t gain one later: a GitHub grant added during the session reaches the agent through the MCP tools only. Start a new session to use git and gh with it. A grant GitHub refused when the sandbox was created is the exception: that sandbox was set up for it, so git and gh start working once GitHub accepts the grant. When a GitHub grant reaches the sandbox, Recursion can add the GitHub hosts when new compute is created. See Integration network behavior for the exact policy outcomes. Under No access, switch Internet access on or allow the hosts before using git. Start a new session after changing the grant or policy; a running sandbox keeps its original policy. GitHub MCP calls run outside the sandbox and need no host allowlist.

Verify access

Open the connection’s row menu and click Test connection. Then start a new agent session and ask it to use one of the selected GitHub tools, or to run git ls-remote against a granted repository. A passing connection test proves GitHub issued a token; a successful tool call or clone also proves that the tool, repository, and permission were available.

Start a connection from the API

startIntegrationInstallV2 returns the service’s authorization url and a single-use state. Open the url in a browser where the same person is signed in to the console; after approval the console completes the connection. The state expires after 15 minutes.
For a new GitHub installation, send {"option":"install"} to open GitHub’s App installation page; omit option to connect an existing installation. Send connectionId to re-authorize an existing connection in place, keeping its id so agents that use it keep working.

List repositories and pull requests

For a GitHub connection, list the repositories it can reach and their pull requests, for example to fill a repository picker. For an installation on selected repositories, the list is the installation’s own repositories, the same list the console’s repository pickers show. Results come from GitHub, up to 100 per page. Pass nextCursor as cursor with the same limit and, for pull requests, state. Deduplicate by id (repositories) or number (pull requests); 409 snapshot_stale means start again without cursor. Selected-repository listings may be up to a minute old. See Pagination.
The pull-request path names the repository owner and repository name separately. state is open or closed; omit it to include both. Use fullName values in resources.

More information

See Connection status and Tools for MCP tool use. To start an agent from a GitHub Actions workflow and fail the check on its verdict, see Run an automation from CI.