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

# Connecting Vega to GitHub

<View title="Developer" />

<View title="Federal docs">
  <Danger>
    **Vega is not available in federal environments**

    To learn more, read <a href="/docs/home/infrastructure/federal">LaunchDarkly in federal environments</a>.
  </Danger>
</View>

<View title="EU docs">
  <Danger>
    **Vega is not available in the LaunchDarkly European Union (EU) instance**

    To learn more, read <a href="/docs/home/infrastructure/eu">LaunchDarkly in the European Union (EU)</a>.
  </Danger>
</View>

Vega integrates with GitHub to read your code, make code changes, and open pull requests. Connecting GitHub is optional for using Vega read-only mode. It is required for [flag cleanup](/docs/home/flags/manage/flag-cleanup-vega) and for the [agent mode](/docs/home/observability/vega#agent-mode) flows that create pull requests.

Connecting GitHub does not grant access to Vega itself. To use Vega, your role requires the [Vega actions](/docs/home/account/roles/role-actions#vega-actions). To learn more about Vega, read [Vega](/docs/home/getting-started/vega).

## How GitHub access works

Vega's GitHub access is scoped by both **user** and **organization**:

* At the organization level, an admin installs the LaunchDarkly Vega GitHub App and selects which repositories Vega is allowed to access.
* At the user level, each developer authenticates with their personal GitHub account.

The repositories Vega can access for a given user are the subset of repositories that user has access to, among the organization's repositories that were granted access to Vega.

<Note>
  **One GitHub organization per workspace**

  Currently, LaunchDarkly supports connecting one GitHub organization per workspace.
</Note>

<Info>
  **Vega operates in private repositories only**

  For security reasons, Vega works only with private repositories. It will not read code from or open pull requests against public repositories, even if you grant the LaunchDarkly Vega GitHub App access to those repositories. This restriction prevents Vega from acting autonomously in a publicly visible codebase, where it could inadvertently expose secrets, configuration, or feature flag details in a pull request.
</Info>

## Setting up the GitHub integration

<Warning>
  **Vega may clone a connected repository**

  If you connect Vega to your GitHub account and you specify a repository when making a request, Vega may clone your repository code into an isolated environment to facilitate agent investigations.
</Warning>

To connect Vega to GitHub:

1. Install the [LaunchDarkly Vega GitHub App](https://github.com/apps/launchdarkly-vega) at the organization level.
2. Authenticate with your personal GitHub account. This lets Vega act on your behalf by opening pull requests and reading from repositories you can access.
3. Choose which repositories Vega can access. You can restrict Vega's permissions to specific repositories. These access scopes apply across all modes and can be modified at any time from your GitHub organization's settings.

All GitHub interactions are logged and scoped to your authenticated session. Vega will only operate within the repositories and permissions you've explicitly approved.

## When GitHub is required

<table>
  <thead>
    <tr>
      <th>Vega feature</th>
      <th>GitHub required?</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>[Read-only mode](/docs/home/observability/vega#read-only-mode)</td>
      <td>Optional (uses code context to improve analysis)</td>
    </tr>

    <tr>
      <td>[Agent mode](/docs/home/observability/vega#agent-mode)</td>
      <td>Optional to select, required to create pull requests</td>
    </tr>

    <tr>
      <td>[Flag cleanup](/docs/home/flags/manage/flag-cleanup-vega)</td>
      <td>Required (creates pull requests)</td>
    </tr>

    <tr>
      <td>[Search assistant](/docs/home/observability/vega#vega-search-assistant)</td>
      <td>Not used</td>
    </tr>
  </tbody>
</table>
