How to gate AI agent pull requests on GitHub (without reading every line)
Описание и применение
Настройка MergeJudge позволяет автоматически классифицировать pull‑request от AI‑агентов в три категории (auto, review, block), гарантируя, что правила, определённые в базовой ветке, не могут быть ослаблены агентом.
Задача
Coding agents create many pull requests that humans cannot review line by line, leading to noisy comments and potential rule bypass.
Результат
The setup ensures AI-generated PRs are automatically classified into lanes, with protected paths always requiring human review, and prevents agents from weakening rules.
Рабочий процесс
- 1. Install MergeJudge GitHub App or set up self-hosted GitHub Action.
- 2. Add provider key as a repo secret (e.g., AI_API_KEY).
- 3. Create .github/workflows/mergejudge.yml with permissions and runner configuration.
- 4. Define protected paths in .mergejudge.yml on the default branch.
- 5. Add judgement rules in AGENTS.md under a "## Code review" section.
- 6. Open a PR; MergeJudge adds a sticky summary comment, a mergejudge/lane check, and inline comments.
- 7. Review outcome: auto (success), review (neutral), or block (failure).
Доказательства
Deterministic rules put every PR in a lane: auto (low risk), review (a human must look) or block.
An AI model reads the diff and adds line comments, but can only make the lane stricter, never looser.
The rules and policy are read from the base branch, never from the PR branch.
Protected paths always land in at least review, with or without an AI provider.
- Дата записи: 2026-10-24T10:26:08.483Z