Skip to main content

Overview

Magnet’s GitHub integration enables the AI agent to:
  • Clone repositories into sandboxed environments
  • Create branches for agent-generated changes
  • Open pull requests against your base branch
  • Track PR status (draft, open, merged, closed)
  • Auto-complete issues when linked PRs are merged

Setting up GitHub

1

Install the GitHub App

Go to Settings > Integrations in the Magnet dashboard and click Connect GitHub. This redirects you to GitHub to install the Magnet GitHub App.
2

Select repositories

Choose which repositories the app can access. You can grant access to all repositories or select specific ones.
3

Authorize the installation

Approve the permissions. Magnet requests:
  • Read access to code, metadata, and pull requests
  • Write access to pull requests and webhooks
4

Link a repository

Back in Magnet, link specific repositories to your organization. Linked repos appear in the repository picker when creating sessions.

How it works

Repository cloning

When you create a session with a repository:
  1. Magnet authenticates with GitHub using your organization’s app installation
  2. The sandbox clones the repository at the branch you specified
  3. The agent works in an isolated copy — your repository is never modified directly

Pull request creation

When the agent finishes making changes:
  1. Changes are committed to a new branch (e.g., agent/fix-signup-validation)
  2. A pull request is opened against the base branch
  3. The PR link appears in the session for in-app review

PR status syncing

Magnet keeps PR status up to date automatically. As PRs are reviewed, approved, or merged on GitHub, the status updates in Magnet.

Disconnecting GitHub

To disconnect GitHub:
  1. Go to Settings > Integrations
  2. Click Disconnect GitHub
  3. Optionally, uninstall the GitHub App from your GitHub organization settings
Disconnecting GitHub will prevent existing sessions from creating new PRs or accessing repository data. Already-opened PRs are not affected.