Home › Coding › Automated PR review: how to do it with AI

Automated PR review: how to do it with AI

Last checked

From official vendor pages; selected tasks also include dated logged-out free-plan trials. Report an error.

Intermediate Risk: Low 💻 Coding

AI pull-request review adds comments on bugs, unclear code and missing tests before a human reviewer looks. It's a useful first pass that catches small problems; it doesn't replace a teammate who knows the system.

Who it’s for: Development teams, solo developers without a reviewer, and open-source maintainers handling many contributions.

Why low risk: AI review comments can be noisy, miss design problems, or confidently flag correct code.

Best pick

ChatGPT has the highest score on our published rubric (94/100) of the 4 tools listed for this task. Codex includes PR review; Free has limited Codex access.

Step by step

  1. Turn on AI review for one repository first and agree what it's for (bugs, security smells, tests).
  2. Write short review guidelines the tool can follow, if it supports them.
  3. Read AI comments as suggestions: accept, reply or dismiss each one.
  4. Keep a human approval rule for merging.
  5. After a few weeks, check which comments were useful and adjust the guidelines.

AI prompts to review a pull request

Replace the [brackets] with your details. See all prompt examples

Review this diff
Review this pull request diff. Focus on bugs, security issues and missing tests. For each comment give the file and line, why it matters and a suggested fix. Skip style nits.

[diff]
Write review guidelines
Draft review guidelines for an AI reviewer on our [language/framework] repository: what to flag, what to ignore, severity levels. Keep it under 200 words.
Summarise a big PR
Summarise this pull request for a human reviewer: what changed, risky areas, and the 3 files to read first.

Illustrative example

You paste

Diff adds a new endpoint that reads a user ID from the query string.

A good answer looks like

AI comment: "routes/orders.py line 42: user_id comes from the request without checking it matches the logged-in user, so any user could read another's orders. Suggest: compare with the session user and return 403."

Illustrative example written for this guide, not output captured from a specific tool.

Which tool to pick, and why

Reasons come from the capabilities, free-plan details and prices we've checked on official pages (separate from any dated trial above). Sources: github.com/features/copilot/plans · cursor.com/pricing · chatgpt.com/pricing · claude.com/pricing

Common mistakes

Privacy tip

Check the tool's training and retention settings for private code, and whether your organisation's plan excludes it from training.

GitHub Copilot setting · Cursor setting · ChatGPT (incl. Work & Codex) setting · Sources: github.com/features/copilot/plans · cursor.com/help/security-and-privacy/privacy · help.openai.com/en/articles/7730893-data-controls-in-chatgpt

Related tasks

Report an error on this page