git clone a repository into its sandbox, change files, run your tests, commit, push a branch, and open a pull request. The agent acts as a GitHub App that your organization owns, so every commit and push shows up as <your-app>[bot], never as a person.
Connecting the App needs the Manage org settings capability. Granting it to an agent also needs Agent Accounts to be enabled for your workspace; if the agent’s GitHub access section shows “Agent accounts are not enabled for this organization”, contact Runlayer.
GitHub access vs the GitHub connector
These are two different things, and an agent can use both.How it works
- A GitHub org admin creates a GitHub App in your GitHub organization and installs it on the repositories agents may touch.
- A Runlayer workspace admin connects that App in Settings → Integrations. Runlayer checks the credentials with GitHub before saving them.
- A workspace admin grants the connection to an agent, optionally limited to specific repositories.
- On every git network operation, the agent’s sandbox asks Runlayer for a token. Runlayer mints a short-lived (about one hour) installation token scoped to that agent’s repositories. No GitHub secret ships with the run or is written to disk.
What you need
- On GitHub: an owner of the GitHub organization (or someone allowed to create and install GitHub Apps in it).
- In Runlayer: a workspace admin with the Manage org settings capability (Super Admins have it). Both connecting the App and granting it to an agent need this capability, because a grant hands the agent the App’s reach.
- For agent Git access: an agent to grant access to. See Agents. Private skill imports do not require an agent.
Set up
Steps 1–4 connect the workspace’s GitHub App. Step 5 is only for giving an agent Git access.1
Create a GitHub App
In GitHub, open your organization’s Settings → Developer settings → GitHub Apps and click New GitHub App.
- GitHub App name: anything you like, for example
acme-runlayer-agents. Commits will show asacme-runlayer-agents[bot]. - Homepage URL: any URL, for example your Runlayer workspace URL.
- Callback URL and Setup URL: leave them empty, and leave Request user authorization (OAuth) during installation unchecked. Runlayer only uses the App’s installation, never a user sign-in, so it needs no redirect URL.
- Webhook: clear Active. Runlayer does not use GitHub App webhooks.
- Repository permissions:
- Contents: Read-only for private skill imports; Read and write for agent Git access
- Metadata: Read-only (GitHub sets this automatically)
- Pull requests: Read and write (optional; add it if agents should open pull requests)
- Where can this GitHub App be installed? Only on this account.
2
Note the App ID and generate a private key
On the App’s settings page, copy the numeric App ID.In the left sidebar, click Credentials, then Key pairs. Click New key. GitHub downloads a
.pem file containing the App’s private key. Save this file: you paste its entire contents into Runlayer in a later step.See GitHub’s private-key instructions for the current key-management flow.3
Install the App on your organization
On the App’s page, open Install App and click Install next to your organization. Choose All repositories or Only select repositories. Agents can never reach a repository the installation doesn’t include.The Installation ID only exists after this step. Once you click Install, GitHub opens the installation’s settings page; copy the number at the end of its URL, for example
https://github.com/organizations/acme/settings/installations/12345678 (or https://github.com/settings/installations/12345678 for an App installed on a personal account). The App’s public page, https://github.com/apps/<app-name>, doesn’t contain it. To find it later, open your organization’s Settings → GitHub Apps and click Configure next to the App.4
Connect the App in Runlayer
In Runlayer, open Settings → Integrations, find GitHub App and click Connect GitHub App. Enter:
- App ID
- Installation ID
- Private key: paste the whole contents of the
.pemfile, including theBEGINandENDlines
5
Grant the connection to an agent (agent Git access only)
For an agent that needs to clone repositories, push code or open pull requests, open that agent under Agents, go to the Agent tab and find GitHub access. Click Grant access, then:
- GitHub App connection: pick the organization.
- Repositories: type the repositories this agent may use, as
owner/repo(for exampleacme/web). Runlayer doesn’t list the installation’s repositories, so enter each name yourself. Every entry must belong to the connection’s organization. Leave the list empty to allow every repository the installation can access.
grant_agent_github_access, get_agent_github_access and revoke_agent_github_access take the agent’s id and need the same capability.Use it in a run
Ask the agent to work with HTTPS repository URLs. Git authenticates through Runlayer automatically; the agent never handles a password or personal access token. There is nothing else to turn on for the agent: it doesn’t need Code mode or any other built-in tool forgit.
Git access works in every run of the agent, whatever started it: the playground, a Slack mention or DM, a schedule, a webhook or the API. To ask the agent for code changes from Slack, set up its Slack app on the agent page under Slack, then mention it with the task.
- Clone, fetch, pull and push work for the granted repositories over
https://github.com/.... SSH remotes (git@github.com:...) are not supported. - Commits are authored as the App’s bot (
<app-name>[bot]), so GitHub links them to the App. - Pull requests need the App’s Pull requests: Read and write permission. The sandbox includes the GitHub CLI, so the agent can open them with
gh pr create.ghuses the same credential as Git for each call, so the agent doesn’t setGH_TOKENitself. - Branch protection and rulesets still apply. The agent can’t push to a protected branch or merge anything your rules don’t allow for the App.
- Workflow files are off limits. Tokens never carry the
workflowspermission, so GitHub rejects pushes that change files under.github/workflows/. - Network access policy: if the agent uses an allow list, add
github.com, andapi.github.comif it opens pull requests or usesgh. - Offline eval replays never get GitHub access.
Security model
- Short-lived tokens. Each token lasts about an hour and is minted on demand. Nothing long-lived is stored in the sandbox.
- Scoped twice. The installation decides which repositories the App can see on GitHub; the agent’s repository list narrows that further for each agent.
- Per agent, not per run. The repository list applies to every run of the agent. A run can reach any repository on the list, whichever one its task is about. To keep each run on one repository, see Limit a run to one repository.
- Minimal permissions. Tokens carry only Contents (read and write), Metadata (read) and, if the App has it, Pull requests (read and write). Other App permissions such as Workflows, Administration or Secrets never reach the agent.
- Admins only. Connecting an App and granting it to an agent both need the Manage org settings capability. Agent owners without it don’t see the GitHub access section.
- Audited. Connecting or deleting an App and granting or revoking an agent’s access appear in Audit Logs as
github_app_installation_created,github_app_installation_deleted,installation_grant_createdandinstallation_grant_revoked, with who did it and which repositories were granted. Each private-repo read for a skill import or auto-update appears asgithub_app_repo_read_token_minted, with the admin it ran as, the repository, and whether it came from the web app (skill_import_rest), Runlayer MCP (skill_import_mcp) or auto-update (skill_auto_update).
Limit a run to one repository
The repository list belongs to the agent, so you can’t narrow it for a single run. If one agent reviews pull requests across many repositories and each run should only touch the repository it was started for, you have two options:- One agent per repository, or per small group of repositories, each granted only its own repositories. This is the only option that also limits
gitin the sandbox. - Pin GitHub connector calls to the first repository a run touches. Every run of a Runlayer agent is its own policy session, so the repository isolation policy on your GitHub connector denies calls to a second repository in the same run, and the next run starts fresh. Apply it to the agent’s agent account. It only checks tools that take a
repoargument, so deny tools that search across repositories with a free-form query if the agent doesn’t need them. It doesn’t limitgitin the sandbox.
Revoke access
- One agent: in the agent’s GitHub access section, click the trash icon. The agent’s next git operation against GitHub fails, and the token it holds is revoked at GitHub.
- Every agent using an App: in Settings → Integrations → GitHub App, delete the connection. All of its grants are revoked at once.
- Disabled or deleted agents can’t get new tokens. For a disabled agent account, the token already in the sandbox is also revoked at GitHub within about a minute.
- On GitHub: uninstalling the App or deleting its private key stops all access immediately.
Troubleshooting
Related docs
Agents
Build, schedule and run agents
Agent Accounts
The identity every agent carries
GitHub connector setup
Give agents GitHub MCP tools that act as a user
Audit Logs
Review who granted which agent access to what