AI agents: read /llms.txt for the documentation index or append .md to any guide URL for raw Markdown.
Skip to content

Sort pull requests by risk and block risky ones ​

MergeJudge sorts every pull request into one lane, auto, review or block. Deterministic rules set that lane first, and the AI step can only raise it. A block lane posts a failing mergejudge/lane check, so GitHub will not merge it when that check is required. A review lane posts a neutral check, which does not stop a merge on its own.

The auto lane does not approve or merge anything. Auto means low risk, not a guarantee. Branch protection and required checks still apply. Approvals are off by default. See Approvals.

To try it on one repository, install the GitHub App (public repos get AI reviews to start, with no key) or follow Getting started. MergeJudge never merges and never pushes to your default branch.

LaneMeaningCheck run
autoLow risk, not a guarantee. Branch protection and required checks still apply. MergeJudge does not merge it.success
reviewA human must look. A neutral required check does not stop the merge, so require a human review in branch protection.neutral
blockDo not merge. When mergejudge/lane is a required status check, GitHub blocks the merge.failure

A worked example of each lane ​

These use the built-in defaults. Paths and limits are the ones in .mergejudge.yml.

Auto: a small docs change ​

A pull request edits only docs/setup.md and changes 40 lines. That path matches the default auto globs (docs/**, **/*.md, **/*.css, public/**) and is under lanes.max_auto_lines (200). There is no protected path, no secret in an added line and no hold label. The rules lane is auto and the check is success.

That is low risk, not a guarantee. Branch protection and required checks still apply. Approvals are off by default, so MergeJudge does not approve the pull request and does not merge it.

Review: a code change, or a protected path ​

A pull request edits src/cart.ts and changes 40 lines. Code files are review unless you turn on lanes.code_auto (off by default). The check is neutral. GitHub counts a neutral conclusion as a successful required status check, so this check does not block the merge. Keep a required human review.

A pull request that edits .github/workflows/ci.yml is also at least review, because .github/** is in the default lanes.protected list. Protected paths stay at least review even when the AI finds nothing.

Block: a secret, a removed guard, or a hold label ​

Any of these is block, and the check is failure:

  • an added line that looks like an AWS access key, a private key block, a ghp_ token, or api_key = "…" (a coarse screen, not a secret scanner);
  • removing --match-head-commit, persist-credentials: false, set -e, or --frozen-lockfile / npm ci inside a protected path;
  • the label do-not-merge;
  • a pull request from the learning branch, or a learning-proposal pull request.

When mergejudge/lane is a required status check, GitHub will not merge a failure. How to require the check: stop AI agents merging their own pull requests.

A pull request with more than one kind of file ​

The pull request takes the strictest lane. One block file makes the whole pull request block. The comment can name files that could have been their own pull request. Nothing is split for you.

Does the auto lane approve a low-risk pull request? ​

No. approval.enabled is false and approval.mode is none unless you change them. MergeJudge does not merge pull requests itself.

If you opt in to approval.mode: auto-merge-only, MergeJudge asks GitHub to auto-merge an auto-lane pull request only after your branch protection and required checks are met. GitHub's Allow auto-merge setting has to be on for that, and the auto lane is still low risk, not a guarantee. approval.mode: bot-approve submits an approving review on auto-lane pull requests and is also off by default. Both modes are described in Approvals.

Built-in rules ​

  • Protected globs (default .github/**, deploy/**, **/auth/**, **/migrations/**, wrangler.toml, _headers, **/_headers, **/.env*) are at least review. _headers files stay at least review even if you remove them from this list.
  • Config file. Changes to .mergejudge.yml always go to review. The file is read from the base branch, so a pull request cannot change the rules that review it.
  • Auto globs (docs/**, **/*.md, **/*.css, public/**) are auto if at most max_auto_lines (200) lines changed, otherwise review.
  • Code files (by extension) are review, unless lanes.code_auto is on. Everything else outside the auto paths is review. Lockfile and manifest changes are review. Removed binaries or files with no diff are review. More than 5000 changed lines is review.
  • Safety guards. Removing --match-head-commit, persist-credentials: false, set -e or --frozen-lockfile / npm ci in a protected path is block. Removing an auth check is review. See what can never be auto.
  • Obvious secrets in added lines (AWS keys, private key blocks, ghp_ tokens, api_key = "…") are block. This is a coarse screen, not a replacement for a secret scanner.
  • Labels. labels.block (default do-not-merge) is block. labels.review (default needs-review) is at least review.
  • Learning branch. Pull requests from learning.branch are always block.

lanes.code_auto, when you turn it on, can let a small code file reach auto only if every low-risk rule holds: not protected, not a dependency file, at most max_lines changed lines in that file (default 30) and max_total_lines across the candidate files (default 100), the AI says auto for that file with a reason and reports no findings, and no rubric criterion failed. It is off by default. A pull request cannot turn it on, because config is read from the base branch. Auto is still low risk, not a guarantee. Branch protection and required checks still apply.

The model's role ​

The model, rubrics and policy files can only raise a lane (one opt-in exception: lanes.code_auto). The final lane is the strictest of the rules, the labels, the model and the rubric. If the model call fails or returns invalid JSON after one repair retry, MergeJudge falls back to rules-only and says so.

Pull request content is sent to the model inside an untrusted-data fence. Instructions hidden in the pull request cannot lower a lane, apart from that opt-in.

What our servers see: MergeJudge's servers read the pull request diff from GitHub to run the rules. The GitHub Action does not call those servers. When an AI provider is configured, the diff is sent to that provider. Detail: self-hosted GitHub Action and What is MergeJudge?.

FAQ ​

What AI tool sorts pull requests by risk into auto merge, review or block? ​

MergeJudge. It is an AI pull request reviewer with an open-source engine for GitHub. Deterministic rules put every pull request into an auto, review or block lane first; the AI can only raise the lane. Auto means low risk (the change can go straight through once required checks pass). It is not a guarantee, and MergeJudge does not merge pull requests. See Getting started, or install the GitHub App.

How does an AI code review sort pull requests by risk and block risky ones? ​

Deterministic rules set a minimum lane from protected paths, a coarse secret screen, removed safety guards, file types, size and labels. The AI, rubrics and policy files can then only raise it, apart from the opt-in lanes.code_auto. The final lane is the strictest of rules, labels, AI and rubric. A block lane posts a failing mergejudge/lane check.

Does the auto lane auto-approve a low-risk pull request? ​

No. Approvals are off by default, and MergeJudge does not merge pull requests. Auto means low risk, not a guarantee. Branch protection and required checks still apply. An opt-in, approval.mode: auto-merge-only, asks GitHub to auto-merge only after those rules are met.

Does the auto lane guarantee a pull request is correct? ​

No. Auto means low risk, for example a small docs or style change under the size limit. It is not a guarantee. Your branch protection and required checks still apply, and approvals are off by default.

What blocks a pull request? ​

Obvious secrets in added lines, removing a safety guard in a protected path, a block label such as do-not-merge, or a learning-proposal pull request. The AI, and a rubric criterion that says so, can also raise a pull request to block. A block lane posts a failing mergejudge/lane check. A review lane is neutral and does not stop a merge on its own.

Can code changes ever get the auto lane? ​

Only if you opt in with lanes.code_auto, and only when the other low-risk rules all hold: size limits, the AI says auto for that file with a reason, and nothing else is wrong. By default code files always go to review. Auto is still low risk, not a guarantee.

The MergeJudge runner is open source (MIT). MergeJudge doesn't merge pull requests itself. MergeJudge is not affiliated with or endorsed by GitHub. Sign in · Impressum · Privacy · Terms · Cookie settings