Automate code review on pull requests
An AI code review automation reads every new pull request the way a reviewer would – the linked issue, the description, the diff, and the code around it – and posts only the findings the author has to act on before the merge. Each finding is an inline comment with the problem, the scenario where it fails, and a fix. The review ends with a verdict: Request changes if any finding blocks the merge, otherwise Approve.
You build it from the Code Review template. The quickstart sets up the basic version; this topic covers the choices that make it fit a team: which pull requests get reviewed, how often, and against which rules.
Set up the review
Create a code review automation
On the Automations page, click New Automation. In Instructions, click Use Template and select Code Review under By Air.
Select the repository. To review pull requests for the whole team, select the team's project in the scope selector.
In Triggers, add the pull request event that matches when your team wants a review – see Choose which pull requests get reviewed – and set its change handling to No code changes. The review is posted on the pull request, so the run has nothing to commit.

Add your team's rules to the end of the instructions – see Add your team's rules.
Click Create. To check the result before the next pull request arrives, click Run Now and enter a link to an open pull request in Context – see Run an automation manually.
Choose which pull requests get reviewed
Every review is a run, and every run spends AI credits. Pick the trigger for how your team works:
Review | Trigger and filters |
|---|---|
Every pull request, once | with Ignore drafts, and for pull requests that start as drafts |
Every pull request, after every push | Add with Ignore drafts. A pull request that gets ten pushes gets ten reviews. |
Only when someone asks for it | with a label such as |
Only for some authors | Any of the above with the PR author filter – for example, to review the pull requests that other automations open. |
For every event and filter, see GitHub events.
Add your team's rules
The template judges a change by the code around it, and it already skips style remarks and anything the author doesn't have to fix. Add what only your team knows, as plain sentences at the end of the instructions. For example:
If you review after every push, tell the agent not to repeat itself, so the second review doesn't post the same findings again:
Conventions that apply to every agent – build commands, code style, architecture rules – belong in the repository's project instructions, where cloud tasks follow them too.
Go further
GitLab – the same setup works with and the matching merge request events. Air Teams adds the project webhook when you save the automation – see GitLab events.
Comment only, no verdict – if your team doesn't want an automation to approve pull requests, replace the verdict part of the instructions with "Post comments only. Never approve or request changes."
Add tests where the change needs them – a second automation adds the missing tests to the pull request itself, and can start the review once they're in – see Add missing tests to pull requests.
Check the docs too – the Documentation Maintenance template comments on documentation that the change made wrong.