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

Policy files ​

Many repos already describe how they want code reviewed: REVIEW_POLICY.md, REVIEW.md, APPROVAL_POLICY.md, AGENTS.md, CLAUDE.md. These five are the defaults, in that order. MergeJudge reads these from the base branch tip (never from the PR head) and puts them in the system prompt as a trusted <repo_policy> block. PR content stays in a separate untrusted block.

  • Policy can only make review stricter. It cannot lower a lane.
  • Edits to a policy file inside a PR don't affect that PR's review.
  • Caps: policy.max_each_bytes (8 KB) and policy.max_total_bytes (8 KB). Longer files are truncated fairly across the listed files so one long file cannot starve the others.
  • A default file you don't have is just listed once under "Not checked". Nothing else changes.
  • An empty policy_files: [] turns injection off.

REVIEW.md is read by default on the hosted GitHub App, the npm runner and the GitHub Action (0.7.0). How closely each rule is followed depends on the model, so treat policy files as guidance, not a guarantee.

yaml
policy_files: [REVIEW_POLICY.md]   # only this file
policy_exclude: ["CLAUDE.md"]      # or skip specific files
# policy_files: []                 # turn it off to save tokens

What to put in REVIEW_POLICY.md or REVIEW.md ​

Both work the same way. If you already keep a REVIEW.md for Claude Code or another reviewer, MergeJudge reads it as is. Use one of them, not both, so the 8 KB budget isn't split.

Keep it short. The model already looks for bugs, security holes and broken logic; use the policy for what is specific to this repo. Aim for a few dozen lines, well under the 8 KB cap.

Include

  • What matters here (auth, payments, migrations, deploy config, public API contracts).
  • Risky areas that should at least go to review, even when the change looks small.
  • Security expectations (secrets, CSRF, authz checks, dependency pins).
  • When a change should be block until a human looks.
  • What to ignore (style nits, formatting, docs-only wording) so the model spends tokens on real issues.
  • An evidence rule (every finding names the file and line) and a nit cap (for example, at most 3 nits per PR).

Skip

  • Long style guides (prefer a linter).
  • Generic "write clean code" advice.
  • Anything that would try to make a risky change safer than the rules floor — that is ignored.

Copy-paste template ​

Save this as REVIEW_POLICY.md (or REVIEW.md) on your default branch and trim it to your repo.

md
# Review policy

## What matters in this repo
- Auth, session and permission checks.
- Database migrations and schema changes.
- Deploy / CI config (`.github/`, `wrangler.toml`, `_headers`).
- Public HTTP APIs and webhook handlers.

## Raise to review even if small
- Any change under `src/auth/`, `**/migrations/**` or `deploy/`.
- New third-party scripts, iframes or outbound webhooks.
- Changes to rate limits, feature flags that gate money or PII, or CORS.

## Block until a human looks
- Removal or weakening of a safety guard (`set -e`, `persist-credentials: false`, lockfile freezes).
- Hard-coded secrets, private keys or live API tokens in added lines.
- Direct writes to production credentials or billing code without a linked ticket.

## Ignore
- Pure formatting / import order.
- Typo fixes in comments and docs that do not change behaviour.
- Test-only renames with no production impact.

## Security expectations
- New endpoints that touch user data must check authz on the resource, not only "logged in".
- Do not log tokens, cookies or raw PII.
- Prefer allowlists over denylists for redirects and CORS origins.

## Evidence and nits
- Every finding names the file and line and quotes the changed code.
- At most 3 style or naming nits per PR.

After you merge it to the base branch, the next review on that repo will load it automatically. See also How it works (step 4) and .mergejudge.yml (policy_files, policy_exclude, policy.max_*_bytes).

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