> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reliantlabs.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Review every pull request with an AI agent

> Get an AI code review on every GitHub pull request: turn on Autopilot PR review for your repositories, then read, skip or re-run the review the bot posts.

By the end of this guide every non-draft pull request in the repositories you pick gets one review from an AI reviewer, posted by the Reliant bot: defects and risks, each tied to a `path:line`. It never approves and never merges. A person does both.

This is `autopilot-pr-review`, one of the [Autopilot](https://docs.reliantlabs.io/guides/autopilot.md) built-ins. It declares its own GitHub triggers, so you turn it on rather than write it, and it needs no machine.

## Before you begin

* The `reliant` CLI, v1.21 or later, signed in ([Sign in and tokens](https://docs.reliantlabs.io/cli/sign-in.md)), and `gh` for the GitHub side.
* The Reliant GitHub App installed on the repository, and push access to it on your own account ([GitHub integration](https://docs.reliantlabs.io/integrations/github.md#access)).
* In an organization: an organization AI account that can run the reviewer's model (the `powerful` tag by default). See [What this does not do](#what-this-does-not-do).

**1. Create a project for the repository**

Run this in a clone of the repository. `project create` is idempotent: if the path already has a project, it prints that project's ID.

```bash terminal theme={null}
reliant project create --name guides-sandbox-autopilot
```

```text theme={null}
9859294a-8b3c-419f-a5c4-eb85a022fd65
```

**2. Turn on PR review**

`--param repos=` names the repositories to review. Nothing outside that list is ever reviewed. `--no-machine` is right because the reviewer reads code through GitHub only.

```bash terminal theme={null}
reliant trigger activate --workflow builtin://autopilot-pr-review --no-machine \
  --project-id 9859294a-8b3c-419f-a5c4-eb85a022fd65 \
  --param 'repos=["reliant-labs/guides-sandbox"]' \
  --name-prefix "guides-sandbox-autopilot · pr-review"
```

```text theme={null}
TRIGGER            OUTCOME  ACTIVATION
pr-opened          enabled  guides-sandbox-autopilot · pr-review · pr-opened (3796d34b-...)
re-review-label    enabled  guides-sandbox-autopilot · pr-review · re-review-label (d988bcf4-...)
re-review-comment  enabled  guides-sandbox-autopilot · pr-review · re-review-comment (8355854c-...)
```

The three declared triggers turn on together, or none do. A new activation writes as the Reliant bot (`reliant-labs[bot]`), so it can request changes on your own pull requests too. `--param 'review_guidance=...'` gives the reviewer context; every setting is in [Autopilot settings](https://docs.reliantlabs.io/guides/autopilot.md#pr-review). In the app, this is **Workflows → Library → Autopilot · PR review → Set up**.

**3. Open a pull request**

This test change has two bugs on purpose: the loop reads one element past the end, and an empty slice divides by zero.

```go stats/stats.go theme={null}
func Average(xs []int) int {
	sum := 0
	for i := 0; i <= len(xs); i++ {
		sum += xs[i]
	}
	return sum / len(xs)
}
```

```bash terminal theme={null}
gh pr create --title "Add stats.Average" --body "Adds an Average helper for the dashboard."
reliant trigger events 3796d34b-58eb-44e2-88b2-bf9c9a2a7e0c   # the pr-opened activation
```

```text theme={null}
OCCURRED AT           OUTCOME   CHAT                                  DEFINITION
2026-11-20T07:33:44Z  launched  f8536090-c1a0-5b54-825f-47281313c654  builtin workflow builtin://autopilot-pr-review (sha256 4b550ded0f51)
```

`launched` means the review started. Follow it with `reliant workflow follow <chat>` or under **Workflows → Runs**.

**4. Read the review**

```bash terminal theme={null}
gh pr view 1 --comments
```

Look for one review by `reliant-labs[bot]` at the pull request's head commit. Its event is `REQUEST_CHANGES` when the reviewer found a defect that must be fixed before merge, and `COMMENT` otherwise. The body has a **Defects** section, then a **Risks** section, and ends with a footer naming the model and the commit it reviewed. A clean pull request gets one line: "No defects or risks found in the changed code."

After its first review, the workflow creates two labels in the repository, `skip-review` and `agent:re-review`.

**5. Skip or repeat a review**

* Add `skip-review` before opening a pull request, or open it as a draft, and it is not reviewed.
* Add `agent:re-review` to review it again. The workflow removes the label afterwards, so you can add it again later.
* Or comment `/autopilot re-review`. Only you and the accounts in `trusted_ids` can trigger it this way.

A review is not repeated when you push new commits. Ask for one with the label or the comment.

**6. Turn it off**

Pass `--project-id`. Without it, `deactivate` pauses this workflow in every project you own.

```bash terminal theme={null}
reliant trigger deactivate --workflow builtin://autopilot-pr-review \
  --project-id 9859294a-8b3c-419f-a5c4-eb85a022fd65
```

`activate` resumes it. `reliant trigger delete <id>` removes one activation and keeps its firing history.

## What this does not do

* **It never approves or merges.** The review event is computed in one node that can only produce `COMMENT` or `REQUEST_CHANGES`, and the reviewer has no tool that posts a review. If you want something to merge, you compose that yourself: a workflow you write can call `github/pr.merge@1` in an action node, pinned to the reviewed head commit ([Merging is a workflow step](https://docs.reliantlabs.io/integrations/github.md#merging-is-a-workflow-step-never-an-agent-tool)).
* **It does not run your code.** The reviewer reads through GitHub with read-only tools. It runs no tests, builds or linters, so keep your CI.
* **It has no budget of its own.** Each review is capped at 40 agent turns, and every non-draft pull request is reviewed, including the ones agents open. Start with one repository. See [What it costs](https://docs.reliantlabs.io/guides/autopilot.md#what-it-costs).
* **In an organization with two or more members, runs spend only the organization's AI accounts** by default (`Unattended funding: org_only` in `reliant trigger get`). The CLI cannot widen that. A person allows your own accounts on the automation in the app, or an admin adds an organization account.

## Troubleshooting

> [accordion] this automation runs only on its organization's AI accounts, and none of them can run the powerful model
>
> The run launched but paused at the reviewer, and nothing appears on the pull request. `reliant workflow status <chat>` shows `Status: PAUSED` and `call_llm FAIL`; `reliant workflow follow <chat>` prints this error. An admin can add an organization API key or turn on Reliant credits, or you can pick a `review_model` an organization account can run. The paused run then continues by itself.

> [accordion] trigger events shows skipped: filter did not match
>
> The filter refused the event: the pull request is a draft or carries `skip-review`, or the re-review comment came from someone not in `trusted_ids`. The detail line prints the filter.

> [accordion] No firing at all after opening a pull request
>
> Check that the repository is in `repos` (`reliant trigger get <id>` prints `Param repos:`) and that the Reliant GitHub App is installed on it.

## Next steps

> [card] [Turn issues into pull requests](https://docs.reliantlabs.io/guides/workflows/github-issues-to-pull-requests.md)
>
> Label an issue and the issue worker opens a tested pull request for this review.

> [card] [Add a security review](https://docs.reliantlabs.io/guides/workflows/ai-security-review-pull-requests.md)
>
> A second, read-only reviewer that threat-models each pull request.

> [card] [Autopilot reference](https://docs.reliantlabs.io/guides/autopilot.md)
>
> Every setting, label, lease and cost of the five Autopilot workflows.

> [card] [Who an automation acts as](https://docs.reliantlabs.io/automations/overview.md#who-an-automation-acts-as)
>
> The Reliant bot, your own account, and the push check behind both.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.