#### Integrations

# GitHub

The Cursor GitHub App connects your repositories so you can use features like [Cloud Agents](/build/agents-window/cloud-agent) and [Bugbot](/build/agents-window/bugbot). On GitHub the app is still listed as **Cursor**.

## Setup

**GitHub.com**

Requires Grok Build admin access and GitHub org admin access.

1. Go to [Integrations in the dashboard](https://grok.com/dashboard/integrations)
2. Click **Connect** next to GitHub, or **Manage** if it's already connected
3. Choose **All repositories** or **Selected repositories**
4. Return to the dashboard to configure features on your repositories

To disconnect your GitHub account, return to the integrations dashboard and click **Disconnect** on the GitHub row.

The first time a Grok Build account connects GitHub, **Connect** signs in with GitHub to link your GitHub account without installing the app. You can connect a second Grok Build account to a GitHub account that already has the Cursor GitHub App installed: that first Connect doesn't move or change the existing installation.

Each GitHub App installation belongs to one Grok Build account or team. If another Grok Build account or team already owns an installation, connecting it from yours fails with "GitHub installation is already connected to another Grok Build target." and the installation stays with its owner. One exception: when a team admin connects an organization installation that a member of the same team connected personally, Grok Build moves that installation to the team. GitHub Enterprise Server installations don't show this error.

**GitHub Enterprise Server**

### Prerequisites

* Running a supported version of GitHub Enterprise Server (v3.8 or later recommended)
* Admin privileges on your GHES instance
* Grok Build team admin access (required to see the GitHub Enterprise registration option in the dashboard)

### Networking

GHES requires secure inbound access from Grok Build and outbound access for webhook notifications.

#### IP whitelisting (recommended)

Add these IP addresses to your allowlist:

```text
184.73.225.134
3.209.66.12
52.44.113.131
100.63.97.141
100.63.144.57
18.210.232.136
3.208.51.163
3.224.130.48
3.234.118.132
34.197.19.148
34.198.251.120
34.199.187.247
35.170.160.152
44.215.226.85
52.202.172.69
54.81.109.217
54.204.61.44
54.236.99.119
67.202.63.191
184.193.125.229
184.193.223.40
184.194.140.210
184.194.175.144
184.194.208.56
34.192.39.182
50.16.106.255
44.217.29.124
3.223.245.201
54.164.185.10
34.194.133.23
35.170.116.221
```

> [!NOTE]
>
> For other connection options beyond IP whitelisting, see [Advanced networking](#advanced-networking).

#### Proxy requirements

If you run a proxy in front of GHES, make sure it allows Grok Build's GitHub App integration to use authenticated GitHub REST and GraphQL APIs. Grok Build uses these APIs during app setup and after webhook delivery to resolve repository identity, inspect pull request state, read checks and reviews, and update prior Bugbot output.

The proxy should allow authenticated GitHub API requests from Grok Build without blocking or rewriting them.

### Register the Grok Build Enterprise App

1. Go to [Integrations in the dashboard](https://grok.com/dashboard/integrations). In the **Source Control** section, find the **GitHub Enterprise** row (listed under GitHub) and click **Manage apps**.
2. Enter the **base URL** of your GHES instance (e.g., `https://git.yourcompany.com`)
3. Enter the name of the **Organization** that will own the application
   * This should be your company's Organization inside your GHES installation
   * You need administrator privileges for this Organization
   * Other Organizations can access the app once registered
   * Leave blank to use your user account (not recommended)
4. Click **Register**
5. Choose a name for the Grok Build Enterprise Application (default recommended)
6. The app will appear under your available GitHub Apps in your GHES instance
7. Return to the dashboard to configure features on your repositories

> [!NOTE]
>
> For GitHub Enterprise Cloud with data residency (`*.ghe.com`), use these registration steps with `https://<subdomain>.ghe.com` as the base URL.

## Share an installation with another team

A team in an [Organization](/build/agents-window/enterprise/organizations) can share its GitHub installation with other teams in the same Organization. Those teams use the installation's repositories with Cloud Agents, automations, and Bugbot without installing the GitHub app again. Sharing works for GitHub.com and GitHub Enterprise Server installations.

1. **Open the share dialog**

   As an admin of the team that owns the installation, go to [Integrations in the dashboard](https://grok.com/dashboard/integrations) and select **Share with another team** on the **GitHub** or **GitHub Enterprise** row.

2. **Grant access**

   In **Share GitHub installation**, choose the **GitHub account** and the **Team**, then click **Grant access**.

The receiving team can use every repository on the installation, and its usage is billed to that team. Its GitHub row on the Integrations page names the team that owns the installation.

Only one of the teams sharing an installation can turn on Bugbot for a given repository. If another team already has Bugbot on for it, an admin of that team has to turn it off first.

To remove access, open **Share with another team** again and select **Revoke** next to the team under **Already shared with**. Revoking also deletes that team's Bugbot settings for the installation's repositories.

## IP allow list configuration

If your organization uses GitHub's IP allow list feature to restrict access to your repositories, Grok Build can be configured to use a hosted egress proxy with a narrow set of IPs.

> [!WARNING]
>
> Cloud Agents send git traffic through the egress proxy only after Grok Build enables it for your team, whichever allowlist option you choose below. [Contact support](/build/agents-window/help) with your team ID to enable it. The proxy is available for teams, not individual accounts. Other GitHub calls from the agent's VM, such as `gh` or GitHub API requests, don't use the proxy. If your agents make those calls, also allowlist the [Cloud Agent egress ranges](/build/agents-window/cloud-agent/security-network#egress-ip-ranges).

### Enable IP allow list configuration for installed GitHub apps (recommended)

The Cursor GitHub App has the IP list already pre-configured. You can enable the allowlist for installed apps to automatically inherit this list. This is the **recommended approach**, as it allows us to update the list and your organization receives updates automatically.

This inherits the IP list registered on the Cursor GitHub App. It does not allow every client that happens to use those addresses.

To enable this:

1. Go to your organization's Security settings
2. Navigate to IP allow list settings
3. Check **"Enable IP allow list configuration for installed GitHub Apps"**

For detailed instructions, see [GitHub's documentation](https://docs.github.com/en/enterprise-cloud@latest/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-allowed-ip-addresses-for-your-organization#allowing-access-by-github-apps).

### Add IPs directly to your allowlist

If your organization uses IdP-defined allowlists in GitHub or otherwise cannot use the pre-configured allowlist, add the proxy IPs listed in [Git egress proxy and IP allow list](/build/agents-window/cloud-agent/security-network#git-egress-proxy-and-ip-allow-list).

## Advanced networking

Self-hosted instances support multiple connection methods beyond IP whitelisting. For setup details and supported private networking options, see [Private Connectivity](/build/agents-window/cloud-agent/private-connectivity).

**AWS PrivateLink**

Available for Enterprise customers. Use AWS PrivateLink when your GitHub Enterprise Server is in AWS or can sit behind an AWS Network Load Balancer. PrivateLink can cover Grok Build accessing GHES and, when needed, GHES sending webhooks back to Grok Build without public internet egress.

**Best for:** AWS-hosted GHES instances and teams that want private VPC endpoint connectivity

**Security:** HTTPS encryption, AWS PrivateLink, VPC endpoint policies, service account access tokens

**Drawbacks:** Requires coordination with Grok Build and AWS endpoint service setup.

**Cloudflare Tunnel**

Available for Enterprise customers. Use Cloudflare Tunnel when AWS PrivateLink is not practical or when you need an outbound-only deployment model. Your network runs `cloudflared`, and Grok Build provides the tunnel hostname and token.

**Best for:** Environments without inbound network access

**Security:** HTTPS encryption, Cloudflare Tunnel, service account access tokens

**Drawbacks:** Requires running and maintaining `cloudflared` in your environment.

## Permissions

The GitHub app requests the following permissions to support Grok Build features:

| Permission                              | Purpose                                                                      |
| --------------------------------------- | ---------------------------------------------------------------------------- |
| **Repository access**                   | Clone your code and create working branches                                  |
| **Pull requests**                       | Create PRs and leave review comments                                         |
| **Issues**                              | Track bugs and tasks discovered during reviews                               |
| **Checks and statuses**                 | Report on code quality and test results                                      |
| **Actions and workflows**               | Monitor CI/CD pipelines and trigger CI re-runs from pull requests            |
| **Administration**                      | Read branch protection and required check rules to determine PR mergeability |
| **Custom repository roles**             | Determine user access levels so the correct merge and review options appear  |
| **Organization custom properties**      | Surface organization-defined repository metadata in filtering                |

All permissions follow the principle of least privilege.

These are the Cursor GitHub App's permissions. Inside a Cloud Agent's VM, `git` and `gh` use a separate, narrower token that can't dispatch or re-run workflows. If the agent needs to, add a GitHub personal access token as a [personal secret](/build/agents-window/cloud-agent/security-network#runtime-secrets) named `GH_TOKEN`.

## Protected Git scopes

Lock your GitHub organization to your Grok Build organization so only your teams can use its repositories with Cloud Agents, automations, and Bugbot. Protecting a scope requires GitHub organization owner or admin access. See [Protected Git Scopes](/build/agents-window/enterprise/model-and-integration-management#protected-git-scopes).

## Troubleshooting

**Agent can't access repository**

* Install the GitHub app with repository access
* Check repository permissions for private repos
* Verify your GitHub account permissions

**Permission denied for pull requests**

* Grant the app write access to pull requests
* Check branch protection rules
* Reinstall if the app installation expired

**App not visible in GitHub settings**

* Check if installed at organization level
* Reinstall from [github.com/apps/cursor](https://github.com/apps/cursor)
* Contact support if installation is corrupted

## Next steps

Once your GitHub integration is connected, configure the features that use it:

* [Bugbot](/build/agents-window/bugbot): automated PR reviews that catch bugs and security issues
* [Cloud Agents](/build/agents-window/cloud-agent): AI agents that run in the cloud on your repositories
