Advisory AI Review, Enforced Merge Gate: A Ruleset Reference Config
Automated pull request review is early signal, not approval. Here is the ruleset configuration that keeps merge eligibility enforced and accountability traceable to a named human.
It is Thursday afternoon. A developer opens a pull request with a schema migration, an automated reviewer posts three comments (two nits and one compliment on naming), the developer resolves them, the merge button turns green, and the change lands. Nobody with context on that table read the migration. The reviewer sidebar had shown an avatar, a name, and resolved threads, which is exactly what a reviewed pull request looks like.
Here is the short answer to the question that follows: automated pull request review is advisory signal, not approval. Merge eligibility belongs in enumerated ruleset configuration. Require a pull request before merging on protected branches, require a minimum number of approving reviews from human code owners, dismiss stale approvals when new commits are pushed, and enumerate your security and build checks as required status checks so a finding blocks the merge on its own.
GitHub documents Copilot code review as a reviewer you can request on a pull request, and its output is feedback and suggestions on the diff [1]. That is useful and cheap. It is also why your approval rules have to reference human approvers explicitly rather than counting whatever appears in the reviewer sidebar. This article gives you a reference ruleset, a method for turning convention-blind review noise into path-scoped instruction files, and a one-paragraph statement your developers can quote when they are unsure whether a comment counts as sign-off.
The Comment That Looked Like an Approval
The confusion is structural, not a training problem. An automated reviewer appears in the same sidebar as your staff engineers, leaves comments in the same threads, and its comments can be resolved with the same button. Resolution feels like closure. Closure feels like approval.
The honest design is to separate the two concerns completely. Advisory review produces suggestions on a diff. Merge eligibility is a property of branch configuration: a set of enumerated conditions that either hold or do not. If the second thing is not written down as configuration, it is being decided by whoever is in a hurry.
That separation also makes your governance legible to people outside the team. Rulesets express required reviews, required status checks, and related merge conditions as configuration defined at the repository or organization level rather than hand-set per branch [4]. Configuration can be read, versioned, and compared against what you said your policy was. A shared understanding in Slack cannot.
Why Convention-Blind Comments Erode Trust Faster Than False Negatives
A missed bug is bad. A stream of technically correct comments that contradict decisions your team already made is worse, because it trains developers to resolve threads without reading them. Once that habit sets, the automated reviewer's genuinely useful finding gets resolved with the same reflex.
Most of this noise falls into four categories, and each has a different fix location:
- Style preferences already settled by a formatter. A comment about import ordering or line breaks when Prettier, Black, or gofmt already owns that decision. Fix in formatter config and stop discussing it in review.
- Patterns the team explicitly rejected. Suggestions to add a service layer you removed on purpose, or to introduce a dependency injection container you decided against. Fix with a committed decision record plus a path-scoped instruction.
- Library choices fixed by an architecture decision. A recommendation to use a different HTTP client or ORM than the one you standardized on. Fix in the instruction file governing the paths where that choice applies.
- Test conventions specific to the repository. Advice to mock a dependency you deliberately exercise against a real container, or to split a table-driven test. Fix in the instructions covering the test directories.
GitHub documents repository custom instructions as files committed to the repository, including path-scoped instruction files that apply to the directories they govern [2]. That matters because a single global instruction file produces generic advice. Narrow rules belong on the paths they actually constrain.
Treat every repeated review comment as a candidate durable decision. If three different reviewers have typed the same correction in the last two months, the constraint is not a nit. It is an undocumented rule, and both humans and agents are paying for the gap. We have written more about this pattern in nested agent instruction files for monorepos.
The Reference Ruleset: Five Settings That Carry the Enforcement
Treat the following as the intent you are encoding, then express it in your ruleset UI or API. The names below describe the conditions, not a literal payload schema.
# Intent for protected branches. Express in rulesets, not per-branch clicks.
target_branches: [main, release/*]
require_pull_request: true # no direct push path bypasses review
required_approving_reviews: 1 # minimum; raise for risk-bearing repos
require_code_owner_review: true # routes approval to CODEOWNERS
dismiss_stale_approvals: true # new commits invalidate prior approval
required_status_checks:
- build
- unit-tests
- sast # findings block merge, not just annotate
- secret-scanning
- dependency-review
merge_queue: true # validate against latest target stateRequire a pull request before merging. Without this, the rest is decoration, because someone with write access can push straight to the branch and skip every condition you configured.
Set a minimum approving review count and point it at code owners. CODEOWNERS makes directory-level accountability explicit and machine-readable [3]. Use it for the directories that carry real consequences: authentication, authorization, secrets handling, migrations, build and release configuration. The people who own the context should be the people whose approval unblocks the merge.
Dismiss stale approvals when new commits are pushed. This closes the approve-then-amend gap, and agent workflows widen that gap considerably. An agent that pushes three follow-up commits after a human approval has changed the artifact that was approved. Without dismissal, your record says a senior engineer approved code they never saw.
Enumerate security and build checks as required status checks. A finding that only annotates a diff depends on reviewer attention. A finding attached to a required check blocks the merge regardless of who is reading. Rulesets support required status checks as part of the same configuration surface as required reviews [4], so both live in one reviewable place.
Add a merge queue on busy branches. On a branch with many concurrent candidates, each pull request passed its checks against a target state that no longer exists by the time it lands. A queue revalidates against the current head before the merge completes.
Advisory Versus Enforcing: Where Each Signal Belongs
| Signal | Mode | What it catches | Who acts | Configured in |
|---|---|---|---|---|
| Automated reviewer comments | Advisory | Convention drift, likely bugs, missing edge cases | Author, before requesting human review | Reviewer settings plus committed instruction files [1][2] |
| SAST and secret scanning | Enforcing | Injection patterns, hardcoded credentials, unsafe output handling | Author fixes; security owner grants any exception | Required status checks in rulesets [4] |
| Build and test checks | Enforcing | Compilation breaks, regressions, contract failures | Author | Required status checks in rulesets [4] |
| Code owner approval | Enforcing | Judgment on trust boundaries, data handling, public interfaces | Named human owner of the path | CODEOWNERS plus required review [3][4] |
| Merge queue validation | Enforcing | Semantic conflicts between concurrent merges | Queue, then author on failure | Merge queue in ruleset [4] |
The failure mode to design against is approval theater: an automated review satisfies a reviewer requirement, the pull request turns green, and no human reads the diff. Verify directly that your automated reviewer cannot alone satisfy the required-approval condition [1][4]. Do not assume it. Open a test pull request, request only the automated review, and confirm the merge stays blocked.
Triaging Noise Into Path-Specific Instruction Rules
Run a two-week comment audit before you write a single instruction. Export the automated reviewer's comments across your highest-volume repositories and tag each one: actionable, duplicate of an existing formatter or linter rule, or contradicting a convention your team already committed to. The third bucket is your instruction backlog.
Write each rule short, imperative, and testable, and state the rejected alternative explicitly. A reviewer that does not know what you rejected will keep proposing it.
<!-- db/migrations/.instructions.md -->
Every migration must be reversible: provide an explicit down step.
Never drop or rename a column in the same migration that stops writing to it.
Use two deploys: stop writing, then remove in a later migration.
Do not add a NOT NULL column without a default on large tables;
use a backfill migration instead. Rejected: single-shot ALTER with
a table lock. Reason: the orders table lock caused the March outage.<!-- api/handlers/.instructions.md -->
Handlers return typed error envelopes, never raw exception strings.
Validate request bodies at the handler boundary, not in the service layer.
Use the shared httpclient package. Rejected: net/http directly or
adding a second client library. Reason: retry and timeout policy is
centralized and audited there.
Do not add a new public route without updating the OpenAPI spec in
the same pull request.Map each instruction area to the matching CODEOWNERS entry so the same people own the written context and the approvals for changes to it [3]. If the database team owns db/migrations, they should also be the approvers when someone edits the migration instructions. Otherwise the context drifts away from the people who know whether it is still true.
Ship instruction updates in the same pull request as the architectural change that invalidated the old rule. An instruction file that lags the codebase becomes a source of confident wrong advice, which is worse than no advice.
Making the Approval Record Hold Up Under Questioning
Because commit authorship no longer implies human judgment, your durable evidence shifts. The useful question is not who typed the code. It is which identity approved the merge, under which enforced rules, and which build produced the shipped artifact.
Start by giving agent identities distinct, least-privilege accounts. If an agent commits under a shared service account or a human's token, your audit entries cannot separate agent activity from human approval, and you will be reconstructing that distinction by hand under time pressure. Then export the organization audit log and alert on events that disable or bypass protections and required checks, since GitHub records changes to protective settings as logged events [6]. A weakened control should generate a notification, not a surprise during a questionnaire.
For release evidence, enable artifact attestations in your release workflows so a shipped build carries signed provenance linking it to the source commit and the workflow that produced it [7], which follows the SLSA provenance model for describing how an artifact was built [8]. Map the whole control set against NIST's Secure Software Development Framework practices and list the practices with no corresponding automated check [5]. That list is your real backlog. If your agents read issues, comments, or fetched pages, review that tooling against the OWASP LLM application risk categories as well, since those inputs are untrusted text acting on your repository [9].
This is where Guardian merge gate enforcement and typed institutional memory in Genie earn their place in the workflow. The durable decisions behind your instruction files get recorded as typed memory with an owner rather than living in a markdown file nobody reviews, and merge exceptions get recorded with a named owner and an expiry date instead of a verbal waiver in a thread. Then rehearse one evidence request end to end: pick a shipped artifact, trace it back to approvals, enforced rules, and build provenance, and fix whatever step needed manual reconstruction.
The One-Paragraph Statement Developers Should Be Able to Quote
Pin this in your contributing guide and your pull request template, adjusted to your settings:
> Automated code review on this repository is advisory. Its comments are suggestions and are not approval. Merging to main requires a pull request, at least one approving review from a human CODEOWNER for the paths touched, and passing build, test, SAST, secret-scanning, and dependency-review checks. New commits dismiss prior approvals. If an automated comment conflicts with a committed convention, follow the convention, link the instruction file in your reply, and open an issue tagged review-context if the instruction is wrong. The platform team resolves conflicts and records the outcome as a decision record.
Specify who resolves conflicts by name or team, not by role in the abstract. The value of the paragraph is that a developer at 5pm on a Friday knows exactly what blocks their merge and who to ask.
Set a revisit trigger rather than a calendar reminder. Any change to agent permissions, reviewer configuration, or the required check list invalidates the statement and should force a reread.
Watch three signals weekly: comment threads resolved with no reply, approvals older than the latest commit on an open pull request, and checks that were marked non-required shortly after they failed. The third one is the clearest indicator that your gate is being negotiated rather than enforced.
Frequently Asked Questions
Can an automated reviewer satisfy a required approval on GitHub?
Do not rely on assumption. GitHub documents Copilot code review as a requestable reviewer that provides feedback and suggestions on a pull request [1], while required reviews and required status checks are conditions you configure in rulesets [4]. Test your specific configuration with a throwaway pull request and confirm the merge stays blocked until a human approves.
Should security findings be advisory or blocking?
Blocking, as enumerated required status checks. An advisory finding depends on reviewer attention and competes with everything else in the diff. Allow exceptions, but record each one with a named owner and an expiry date rather than silently unchecking the requirement.
How many approving reviews should we require?
One from the right code owner beats two from people without context. Scale the requirement by blast radius rather than applying one number everywhere, which we cover in risk-weighted merge gates.
Does dismissing stale approvals slow us down too much?
It adds a re-approval step when an author pushes after approval. That is the point. If the cost feels high, the underlying problem is usually oversized pull requests, not the dismissal rule. DORA's ongoing research program is a reasonable place to start if you want to study the relationship between change size, review practice, and delivery performance [10].
What to Do This Week
Open a throwaway pull request against a protected branch today, request only your automated reviewer, and see whether the merge unblocks. That test takes a few minutes and tells you more about your real policy than any settings screenshot.
Then do three things in order. Enumerate your security and build checks as required status checks in a ruleset rather than relying on reviewer attention. Turn on stale-approval dismissal. Export two weeks of automated review comments and tag the ones that contradict conventions you already decided, which becomes your first path-scoped instruction file.
Start tracking one signal this week: approvals that are older than the latest commit on an open pull request. That number is a direct count of the gap between what was approved and what will ship.
The developer who merged that migration on Thursday was not careless. The interface told them the pull request had been reviewed, and no configuration said otherwise. Fix the configuration and the interface stops lying.
References
[1] GitHub Docs, "Using GitHub Copilot code review," 2025. https://docs.github.com/en/copilot/using-github-copilot/code-review/using-copilot-code-review
[2] GitHub Docs, "Adding repository custom instructions for GitHub Copilot," 2025. https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot
[3] GitHub Docs, "About code owners," 2025. https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
[4] GitHub Docs, "About rulesets," 2025. https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/about-rulesets
[5] NIST, "SP 800-218: Secure Software Development Framework (SSDF) Version 1.1," 2022 (still the current published version of the framework). https://csrc.nist.gov/pubs/sp/800/218/final
[6] GitHub Docs, "Audit log events for your organization," 2025. https://docs.github.com/en/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/audit-log-events-for-your-organization
[7] GitHub Docs, "Using artifact attestations to establish provenance for builds," 2025. https://docs.github.com/en/actions/security-for-github-actions/using-artifact-attestations/using-artifact-attestations-to-establish-provenance-for-builds
[8] SLSA, "Provenance specification, version 1.0," 2023 (current released specification version). https://slsa.dev/spec/v1.0/provenance
[9] OWASP, "Top 10 for Large Language Model Applications," 2025. https://owasp.org/www-project-top-10-for-large-language-model-applications/
[10] DORA, "Accelerate State of DevOps Report research," 2025. https://dora.dev/research/