> For the complete documentation index, see [llms.txt](https://docs.aviator.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aviator.co/verify/how-to-guides/configuring-branch-protection.md).

# Configuring branch protection

## How to

Require Aviator Verify to pass before PRs can merge by adding it to your GitHub branch protection rules.

### Prerequisites

* Admin access to the GitHub repository
* Aviator Verify enabled for the repository

### Steps

#### 1. Open branch protection settings

In GitHub, go to your repository’s **Settings → Branches**.

Click **Add rule** or edit an existing rule for your protected branch (usually `main`).

#### 2. Require status checks

Under “Protect matching branches,” enable:

```
☑ Require status checks to pass before merging
```

#### 3. Add the Verify check as required

In the search box, type "aviator" and select:

```
☑ aviator/verify
```

This makes verification a required check. PRs cannot merge until verification passes.

#### 4. Optional: Require branches to be up to date

Enable this option if you want PRs to be based on the latest target branch:

```
☑ Require branches to be up to date before merging
```

This helps avoid merge conflicts but can create more CI load.

#### 5. Save changes

Click **Save changes** at the bottom of the page.

### Testing the configuration

Open a PR for a branch where you've submitted an intent with `/verify-submit` or `aviator verify`. You should see:

1. The `aviator/verify` check appears.
2. Merge button is disabled until verification passes.
3. If verification fails, the PR cannot be merged (without admin override).

### Bypassing verification

Admins can bypass branch protection for emergencies. This is logged in both GitHub and Aviator audit trails.

To allow admin bypass:

```
☑ Allow specified actors to bypass required pull requests
```

Add users or teams who should have bypass ability.

### Multiple required checks

You likely have other required checks (CI, tests, linting). The `aviator/verify` check works alongside them:

```
Required checks:
☑ ci/build
☑ ci/test
☑ aviator/verify
```

All checks must pass for the PR to merge.

### See also

* [Connect a repository](/verify/how-to-guides/connect-a-repository.md)
* [GitHub integration](/verify/reference/github-integration.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.aviator.co/verify/how-to-guides/configuring-branch-protection.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
