← All guides

Let coding agents fix bugs: Cursor and GitHub

Confirmed bugs get a failing test, a fix, and a pull request; approved features get built with a preview link.

The video for this guide is coming soon. The written steps below cover everything.

Sign up for Cursor ↗Monthly plan

What you get

Send a bug from the inbox and an agent reproduces it with a failing test, fixes it, and opens a pull request. Approve a feature spec and an agent builds it with a preview for you to try. Nothing merges without you until you choose otherwise.

Steps

  1. In Cursor, connect GitHub and grant access to your repository. Create an API key and set it as CURSOR_API_KEY.
  2. Set GITHUB_REPO to owner/name, and create a fine-grained GitHub token for only that repository (contents and pull requests read and write, checks read) as GITHUB_TOKEN.
  3. Add a GitHub webhook to https://YOUR_URL/api/webhooks/github (JSON, pull request events) with GITHUB_WEBHOOK_SECRET.
  4. Protect the main branch so every check must pass.

Check it works

Open a bug in the inbox and choose Send to coding agent, then watch Admin → Agent runs.

What the video covers

Some links are affiliate links: signing up through them may earn us a commission at no extra cost to you.