llms.txt: machine-readable documentation index. Markdown version of this page is also available.

JetBrains Air Help

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

  1. On the Automations page, click New Automation. In Instructions, click Use Template and select Code Review under By Air.

  2. Select the repository. To review pull requests for the whole team, select the team's project in the scope selector.

  3. 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.

    A PR labeled trigger with the label ai-review and No code changes
  4. Add your team's rules to the end of the instructions – see Add your team's rules.

  5. 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

GitHub | Pull request | Opened with Ignore drafts, and Pull request | Moved out of draft for pull requests that start as drafts

Every pull request, after every push

Add Pull request | New changes with Ignore drafts. A pull request that gets ten pushes gets ten reviews.

Only when someone asks for it

Pull request | Labeled with a label such as ai-review. The author adds the label when the pull request is ready. For another pass, they remove the label and add it again.

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:

Don't comment on files under generated/ or on lockfiles. Every new public API endpoint needs an entry in docs/api.md; flag one that doesn't have it as Blocking. Database migrations must be backward-compatible with the previous release.

If you review after every push, tell the agent not to repeat itself, so the second review doesn't post the same findings again:

If you reviewed this pull request before, read your earlier comments first. Review only what changed since then, and don't post a finding again that an earlier comment already covers.

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 GitLab | Merge request | Opened 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.

27 November 2026