# Connect GitHub

The GitHub connector lets Treasure AI Studio agents work with your GitHub repositories during a chat — cloning code, reading and editing files, opening and reviewing pull requests, and managing issues on your behalf. The agent uses the `gh` CLI and `git` over HTTPS inside its sandbox, authenticated by your connection. Like the Treasure Data connector, there is no OAuth application to create on the vendor side. An administrator enables the connector and installs the GitHub App on the repositories the agent may access, and then each user authorizes their own connection.

New to connections?
Read [Connections](/products/ai-studio/connections) first for the general model — the difference between a connector and a connection, and the administrator vs. user roles. This page covers the GitHub-specific steps.

## Objective

Set up the GitHub connector — enable it and install the Treasure AI GitHub App on your repositories — and authorize a connection so the agent can work with your code, issues, and pull requests. You'll also see exactly which actions the GitHub App is permitted to perform.

## Prerequisites

- Account administrator privileges in Treasure AI Studio (to enable the connector)
- Permission to install a GitHub App on the target organization or repositories (organization owner, or repository admin for repository-scoped installs)


## Step 1 — Set Up the GitHub Connector (Administrator)

Because Treasure AI manages the GitHub App and its OAuth client, there is nothing to register on the vendor side and no client ID or secret to enter. Setup has two parts: add and enable the connector, then install the Treasure AI GitHub App on the repositories the agent may access.

### Enable the connector

1. In Treasure AI Studio, open **Settings → Connector Settings** (under **Organization**).
2. Click **Add Connector** (or **Add your first connector**) and choose **GitHub**.
3. The GitHub connector has no configuration fields to fill in — click **Save** to add it.
4. Make sure the connector is **enabled** so users can authorize connections to it.


The Select Connector screen with the GitHub connector and an Add button, alongside the already-configured Treasure Data, Databricks, and Snowflake connectors
### Install the GitHub App on your repositories

Installing the App is what actually grants access: **the agent can only reach repositories where the Treasure AI GitHub App is installed.** This is the control that scopes what the agent can touch — install it only on the repositories you want the agent to work with.

1. Open the **GitHub App installation page** from the link in the connector's **Setup Guide** (it ends in `/installations/new`). Installing a GitHub App requires GitHub organization owner (or repository admin) rights.
2. Choose the **organization** or **account** to install into.
3. Select **All repositories** or **Only select repositories**, and pick the repositories you want the agent to access.
4. Review the permissions (see [What the GitHub App Can Access](#what-the-github-app-can-access) below) and click **Install**.


To change which repositories the agent can reach later, or to remove access entirely, update or uninstall the App from your GitHub organization's **Settings → GitHub Apps**.

The Configure GitHub form showing only Save and Cancel buttons and a Setup Guide panel with the steps to connect and install the GitHub App, including a link to the GitHub App installation page
No OAuth setup on your side
The Databricks and Snowflake connectors require an administrator to create an OAuth application in the vendor's console and paste its client ID and secret. The GitHub connector skips all of that — the GitHub App and its OAuth client are provided and managed by Treasure AI, so the configuration form is empty.

Allow the egress domains in your network policy
If your account uses a network policy, allow the connector's **egress domains** — `github.com` and `api.github.com` — so the agent's sandbox can reach GitHub. Connector Settings shows the domains each connector requires.

## Step 2 — Authorize Your Connection (User)

With the connector enabled and the App installed, each user who wants the agent to access GitHub authorizes their own connection. You can do this ahead of time from **Settings**, or on demand from a chat.

1. Open **Settings → Connections**.
2. Under **Available**, find **GitHub** and click **Connect**.
3. Sign in to GitHub in the popup and approve the requested access.
4. When the popup closes, **GitHub** appears in your connected list with the date you connected it.


To remove the connection later, click the delete (trash) icon next to it.

The Connections page with GitHub listed under Available and a Connect button, alongside Snowflake, Databricks, and Treasure Data
Connect from a chat instead
You don't have to authorize in advance. If you ask the agent to work with GitHub before you've connected, it shows a **Connection Required** card in the chat — click **Connect** there to run the same authorization without leaving the conversation. See [Connect from a chat](/products/ai-studio/connections#connect-from-a-chat).

The agent authorizes as you and acts with your GitHub identity — commits it creates are attributed to your account. Crucially, the agent can reach a repository only when **both** conditions hold: the GitHub App was installed on that repository in Step 1, **and** your own GitHub account has access to it. In other words, the agent's reach is the **intersection** of the App's installed repositories and your personal access — never more than you could reach yourself.

Connected but a repository is missing?
If you've authorized your connection but the agent still can't see or reach a repository you expect, it's almost always because the Treasure AI GitHub App isn't installed on that repository — and installing it is an administrator (GitHub organization owner) task, not something you can do from **Connections**. Ask your GitHub organization administrator to install the App on that repository (Step 1). Note that a repository you can't access yourself won't become reachable either.

## Step 3 — Use GitHub in a Chat

Once connected, ask the agent to work with your repositories — for example, to clone a repository, summarize recent changes, open a pull request, review a PR, or triage issues. The agent runs `gh` and `git` commands with your connection automatically; no extra configuration is needed in the chat. The `gh` CLI is pre-authenticated inside the sandbox, so the agent never runs `gh auth login`.

## What the GitHub App Can Access

The Treasure AI GitHub App requests a fixed set of permissions — you cannot broaden or narrow them per install. It is scoped to what an agent needs to work with code and collaborate on issues and pull requests, and deliberately excludes administrative and secret-management capabilities. The tables below list every permission the App holds.

### Repository permissions

| Permission  | Access  | What it's for  |
|  --- | --- | --- |
| Contents | Read & Write | Clone repositories and read, create, and edit files and branches. |
| Pull requests | Read & Write | Open, read, review, comment on, and update pull requests. |
| Issues | Read & Write | Open, read, comment on, and update issues. |
| Discussions | Read & Write | Read and participate in repository discussions. |
| Projects | Read & Write | Read and update repository projects. |
| Actions | Read & Write | Read workflow run logs and re-run them. It cannot create or modify workflow definitions (see [Not granted](#not-granted)). |
| Merge queues | Read & Write | Add pull requests to a merge queue when one is enabled. |
| Code scanning alerts | Read & Write | Read and manage code scanning alerts. |
| Dependabot alerts | Read & Write | Read and dismiss Dependabot alerts. |
| License compliance alerts | Read & Write | Read and dismiss license compliance alerts. |
| Metadata | Read-only | Read basic repository metadata (always required). |
| Commit statuses | Read-only | Read the status checks reported on commits. |
| Checks | Read-only | Read check runs and results (writing is left to CI tools). |
| Deployments | Read-only | Read deployment records. |
| Environments | Read-only | Read environment configuration. |
| Packages | Read-only | Read published packages (publishing is left to CI). |
| Pages | Read-only | Read GitHub Pages configuration. |
| Artifact metadata | Read-only | Read metadata about build artifacts. |
| Code quality | Read-only | Read code quality results. |
| Secret scanning alerts | Read-only | Read secret scanning results. |
| Repository security advisories | Read-only | Read repository security advisories. |
| Custom properties | Read-only | Read repository custom properties. |
| Variables | Read-only | Read GitHub Actions variables (non-secret values). |
| Webhooks | Read-only | Read repository webhook configuration. |


### Organization and account permissions

| Permission  | Access  | What it's for  |
|  --- | --- | --- |
| Organization members | Read-only | Read the member list so the agent can @-mention the right people. |
| Account email addresses | Read-only | Read your email address so commits are attributed to you. |


### Not granted

For safety, the App holds **no access** to the most sensitive capabilities, including:

- **Secrets** and **Dependabot secrets** — it never reads or writes repository or Actions secrets.
- **Workflows** — it cannot create or modify GitHub Actions workflow definitions (it can only re-run existing ones via the Actions permission).
- **Administration** — it cannot change repository settings, collaborators, or branch protection.
- **Codespaces** and **Copilot agent settings** — out of scope for the agent.
- **Secret scanning bypass and dismissal requests**, and **attestations**.


## Reference

| Item | Value |
|  --- | --- |
| Connector | GitHub |
| Authentication | OAuth 2.0 (user-to-machine) via a Treasure AI-managed GitHub App, with PKCE |
| Permissions | Granular GitHub App installation permissions — see [What the GitHub App Can Access](#what-the-github-app-can-access) |
| Agent identity | Acts as the authorizing user; commits are attributed to that user |
| Access boundary | The intersection of the repositories where the GitHub App is installed and the repositories your own GitHub account can access |
| Tools used in the sandbox | `gh` CLI (pre-authenticated) and `git` over HTTPS |
| Required configuration | None — the GitHub App and OAuth client are managed by Treasure AI; an administrator only enables the connector |
| Egress domains | `github.com`, `api.github.com` |


## Troubleshooting

| Issue | Solution |
|  --- | --- |
| GitHub isn't listed on the Connections tab | An administrator must add the GitHub connector in **Connector Settings** and enable it. |
| The connection authorizes but the agent can't find or access a repository | Access is the intersection of where the App is installed and what you can reach. First, ask your GitHub organization administrator to confirm the Treasure AI GitHub App is installed on that repository (installing it is an administrator task — Step 1). Then confirm your own GitHub account can access the repository, since the agent can't reach anything you can't. |
| The agent can't reach GitHub at all | Allow the egress domains `github.com` and `api.github.com` in your network policy (see the domains shown in **Connector Settings**). |
| The agent can re-run a workflow but can't edit one | This is expected. The App has no **Workflows** permission, so it cannot change workflow definitions — only re-run existing runs. |
| The agent can't manage repository settings, secrets, or collaborators | This is expected. The App holds no **Administration** or **Secrets** access — see [Not granted](#not-granted). |


## Next Steps

- [Connections](/products/ai-studio/connections) — The general connection model and administrator controls
- [Connect Treasure Data CDP](/products/ai-studio/connections/treasure-data) — Enable the connector and authorize a Treasure Data connection
- [Skills & Marketplace](/products/ai-studio/skills/skills) — How skills give the agent domain expertise
- [Security & Permissions](/products/ai-studio/security) — How access control works in Studio