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.
GitHub access is enabled per workspace. If you don’t see GitHub App under Settings → Integrations, contact Runlayer to turn it on.
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.
- An agent to grant access to. See Agents.
Set up
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.
- Webhook: clear Active. Runlayer does not use GitHub App webhooks.
- Repository permissions:
- Contents: Read and write (required)
- 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 App ID shown under About.Scroll to Private keys and click Generate a private key. GitHub downloads a
.pem file. Keep it safe: you paste it into Runlayer in a later step.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.After installing, copy the Installation ID: it is the number at the end of the installation page’s URL, for example
https://github.com/organizations/acme/settings/installations/12345678.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
Open the agent, go to the Agent tab and find GitHub access. Click Grant access, then:
- GitHub App connection: pick the organization.
- Repositories: add the repositories this agent may use, as
owner/repo(for exampleacme/web). Every entry must belong to the connection’s organization. Leave the list empty to allow every repository the installation can access.
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.- 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 agent opens them through the GitHub REST API with the same credential, for example by reading it with
git credential filland callingPOST /repos/{owner}/{repo}/pullswithcurl. TheghCLI is not installed in the sandbox. - 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. - 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.
- 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.
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