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

# GitHub Integration

> Connect your GitHub repositories to enable source code access and automated PRs

GitHub integration lets the AI agent clone your repo in a sandbox, read the source code behind failing spans, and create fix PRs — all from within TraceRoot.

## Setup

1. Go to Workspace Settings -> Integrations in the TraceRoot dashboard and Connect GitHub App.
2. Grant access to the repositories you want to connect

## Permissions

| Permission      | Access         | Why                                                                          |
| --------------- | -------------- | ---------------------------------------------------------------------------- |
| Metadata        | Read-only      | List repositories, collaborators, and access repository metadata (mandatory) |
| Contents        | Read and write | Clone and read source code for debugging; create fix PRs                     |
| Pull requests   | Read and write | Create fix PRs from root cause analysis; read PR context                     |
| Issues          | Read and write | Create and manage issues; read issue context for debugging                   |
| Commit statuses | Read-only      | Read commit statuses for trace correlation                                   |
| Discussions     | Read-only      | Read discussions and related context                                         |

## Requirements

For source code correlation to work:

* The TraceRoot GitHub App must have access to the repository
* Traces must include git context typically auto-detected by the SDK

<Note>
  Git context is captured automatically for every span when you use the `@observe` decorator. See [Git Context](/tracing/git-context).
</Note>
