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
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.
Select repositories
Choose which repositories the app can access. You can grant access to all repositories or select specific ones.
Authorize the installation
Approve the permissions. Magnet requests:
- Read access to code, metadata, and pull requests
- Write access to pull requests and webhooks
How it works
Repository cloning
When you create a session with a repository:- Magnet authenticates with GitHub using your organization’s app installation
- The sandbox clones the repository at the branch you specified
- The agent works in an isolated copy — your repository is never modified directly
Pull request creation
When the agent finishes making changes:- Changes are committed to a new branch (e.g.,
agent/fix-signup-validation) - A pull request is opened against the base branch
- 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:- Go to Settings > Integrations
- Click Disconnect GitHub
- Optionally, uninstall the GitHub App from your GitHub organization settings