> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloudthinker.io/llms.txt
> Use this file to discover all available pages before exploring further.

# GitHub

> Install the CloudThinker GitHub App so agents can read repositories, pull requests, and Actions runs, and Review can comment

Connect GitHub and CloudThinker agents can read your repositories, pull requests, issues, and GitHub Actions runs, and [Review](https://docs.cloudthinker.io/guide/code-review/overview.md) can post AI code reviews on pull requests. You connect by installing the CloudThinker **GitHub App** on an account or organization, so there's no token to create or paste.

## Prerequisites

* Access to the GitHub repositories you want agents to read.
* To install on a GitHub organization: the **Owner** role in that organization, or an owner willing to approve the install.
* The **Admin** role in your CloudThinker workspace, which can add and edit connections. See [Roles](https://docs.cloudthinker.io/guide/security/roles.md).
* A GitHub.com account or organization. Setup installs the app from GitHub.com and has no field for a GitHub Enterprise Server URL.

## Setup

**1. Open GitHub in CloudThinker**

In the sidebar, click **More → Workspace settings → Connections**. On the **Builtin Connections** tab, search for **GitHub** and click **Connect**.

The **Connect GitHub** dialog lists what the app requests: access to the repositories you select, read and write permissions for pull requests, and webhook events for code review.

**2. Install the GitHub App**

Click **Install GitHub App**. GitHub opens and asks where to install it. Pick the account or organization, then choose **All repositories** or **Only select repositories**.

Pick only the repositories agents need. You can add more later from GitHub.

**3. Approve and return**

Click **Install** on GitHub. GitHub sends you back to CloudThinker, which shows **Processing GitHub App installation...** and then **Successfully installed!**

**Success state:** GitHub shows **Connected** on the **Builtin Connections** tab.

The app registers its own webhooks (event notifications GitHub sends when a pull request changes), so GitHub needs no webhook setup for Review.

## Connection details

GitHub has no fields to fill in. CloudThinker stores the GitHub App installation when you approve it.

| Item | Where it comes from |
| - | - |
| **GitHub App installation** | Created on GitHub during setup and saved automatically |
| **Repositories** | The repositories you granted to the app on GitHub |

## Required permissions

The app's permissions are fixed. You decide its reach by choosing which repositories it's installed on. The app requests the permissions below. The **Connect GitHub** dialog lists the first three; the app also asks for read and write on issues, which Cyber uses.

| Request | Why CloudThinker needs it |
| - | - |
| Access to the repositories you select | Read code, issues, and Actions runs |
| Read and write on pull requests | Read pull requests and post review comments |
| Webhook events | Start a review when a pull request opens or changes |
| Read and write on issues | File and update [Cyber](https://docs.cloudthinker.io/guide/security/cyber-overview.md) findings as GitHub issues, when you send findings to a repository |

If the app's permissions change, GitHub asks an organization owner to accept the updated permissions before they apply. GitHub's install screen lists every permission by its GitHub name, with its access level. Check it there before you click **Install**.

> [!TIP]
>
> Install the app on **Only select repositories** and start with the ones you want reviewed or investigated. To change the list later on GitHub, go to **Organization settings → GitHub Apps** (or **Settings → Applications → Installed GitHub Apps** for a personal account), click **Configure** next to the CloudThinker app, and edit GitHub's **Repository access**.

## Control access in CloudThinker

Two settings on the connection's detail panel narrow what agents do with the installation. Open **More → Workspace settings → Connections**, select **GitHub**, and look under **Settings**.

| Setting | Options | What it does |
| - | - | - |
| **Repository access** (CloudThinker) | **All** or **Selected** | **All** lets agents read every repository the installation covers, including new ones. **Selected** limits agents to the repositories you pick, and new repositories stay excluded until you add them. |
| **Allow writes** | On (default) or off | On: agents can propose changes, and your [Rules and Approval mode](https://docs.cloudthinker.io/guide/approvals/overview.md) decide each one. Off: agents can only read, and every change is refused. |

Every change an agent makes goes through your workspace's [Approvals](https://docs.cloudthinker.io/guide/approvals/overview.md) first. On the default **Auto · Rules + AI · Ask me** mode, AI judgment can let a safe change run without asking — and an Allow Rule can too, once CloudThinker turns on [Rule enforcement](https://docs.cloudthinker.io/guide/approvals/rules.md#troubleshooting) for your workspace. Choose **Manual** to approve every change yourself.

To block GitHub writes outright, turn **Allow writes** off.

These settings only narrow what GitHub already grants. Choosing which repositories Review runs on is a separate step in [Review setup](https://docs.cloudthinker.io/guide/code-review/setup.md).

## Agent capabilities

Agents work through the GitHub CLI (`gh`). Reads run without asking. Writes need **Allow writes** on and pass through your Rules and Approval mode first. Comments and pull requests appear on GitHub as the app's bot account, `cloudthinker-ai[bot]`.

| Capability | What agents can do |
| - | - |
| **Repositories** | List repositories the connection reaches and read their code and history |
| **Pull requests** | Summarize open pull requests, their review status, and discussion |
| **Actions runs** | Find failing workflow runs and read their logs to explain the failure |
| **Issues** | Read issues for triage and delivery context |
| **Changes** | Create branches, comment, or open pull requests, through your Rules and Approval mode |

### Verify the connection

```text theme={null}
List the GitHub repositories you can reach and how many open pull requests each one has
```

A working connection names your real repositories and counts. A generic answer about GitHub means the connection isn't being used. Check GitHub's **Repository access** on the app install, then CloudThinker's **Repository access** setting.

### Example prompts

```text theme={null}
Which open pull requests in our GitHub repositories have had no review for more than 3 days?
Why did the latest GitHub Actions run on main fail in the payments repository?
Summarize the pull requests merged into api this week
```

## Troubleshooting

> [accordion] Installation failed
>
> The redirect back from GitHub was interrupted, or you approved the install from a different GitHub account. Sign in to the right account, return to **More → Workspace settings → Connections**, select **GitHub**, and click **Connect** again.

> [accordion] You can't install on your organization
>
> Only organization owners can install apps on a GitHub organization. When a member picks the organization, GitHub offers to send the owners a request instead of installing. Nothing is installed until an owner approves it. After approval, click **Connect** again and pick the organization.

> [accordion] An agent can't find a repository
>
> Check both layers. On GitHub, the app install's **Repository access** must include that repository. In CloudThinker, the connection's **Repository access** setting must be **All**, or **Selected** with that repository in the list.

> [accordion] Reconnect GitHub to renew its App installation credentials.
>
> CloudThinker could no longer use the installation, often because the app was uninstalled or suspended on GitHub. Open the connection and click **Connect** to install the app again.

> [accordion] An agent says it can't make changes
>
> **Allow writes** is off on the connection, or a Rule refused the action. Turn on **Allow writes** if you want agents to propose changes, then check your [approval rules](https://docs.cloudthinker.io/guide/approvals/rules.md).

## Security

* **Least privilege** — grant only the permissions the agents need for your use case; start read-only and widen later.
* **Read-only by default** — use read-only credentials unless you want agents to make changes through this connection.
* **Rotate credentials** — rotate keys and tokens on your normal schedule; CloudThinker picks up the new value when you update the connection.
* **Revoke on offboarding** — remove the credential at the provider when you delete a connection or a teammate leaves.

- **Scope the installation.** The app reaches only the repositories you grant it on GitHub, and you can narrow that list at any time.
- **Uninstall to revoke.** On the app's **Configure** page on GitHub, click **Uninstall**. Access to every repository stops, and the connection then shows [Reconnect GitHub to renew its App installation credentials.](#troubleshooting)

## Related

> [card] [Set Up Review](https://docs.cloudthinker.io/guide/code-review/setup.md)
>
> Choose repositories and start AI code reviews on pull requests

> [card] [Provider Authentication](https://docs.cloudthinker.io/guide/code-review/provider-auth.md)
>
> Compare how GitHub, GitLab, and other Git providers connect


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.