AI Review Plus Human Approval: CODEOWNERS, Merge Gates, and Audit Evidence
Let AI take the first review pass while code owners, required checks and an audit record decide what merges. A practical setup for GitHub teams.
On this page
AI can review a pull request in minutes. It can scan every changed line and point to risky logic. But it should not be the person who accepts the risk.
A safe flow for AI code review with human approval gives AI the first pass and keeps a named human at the final gate. This is human-in-the-loop code review: CODEOWNERS and merge gates decide who must approve and what must pass. It also records what ran, what failed, who approved the change, and why an exception was allowed.
Start with a risk map
Not every file needs the same review. A typo in a guide is not the same as a change to payments, access control, or deployment code. Map each area to an owner and a minimum gate.
| Change area | AI review | Human approval | Extra evidence |
|---|---|---|---|
| Docs and examples | Logic, links, secrets | One maintainer | Link check |
| App code | Logic, tests, security | Code owner | Required CI checks |
| Auth, billing, data | Deep review and policy checks | Code owner plus security or service owner | Test results and approval record |
| Deploy and infrastructure | Config and blast-radius review | Platform owner | Plan output and rollback steps |
Vera, our AI code review agent, can provide the first AI review on GitHub, GitLab, Bitbucket, or Azure DevOps Repos. It can use Codex, Claude, Gemini, Qwen, or Cursor. The human gate should still match the risk of the change.
Put ownership in the repository
GitHub uses a CODEOWNERS file to request reviews from people or teams that own changed files. Administrators can also require code-owner approval before merge.
Keep the rules short. Use teams, not one person, when possible. Test the patterns on a real pull request because, per GitHub’s code owners documentation, the last matching pattern takes precedence.
.github/CODEOWNERS
* @acme/maintainers
/src/auth/ @acme/security @acme/backend
/src/billing/ @acme/payments @acme/backend
/.github/workflows/ @acme/platform
/infra/ @acme/platform @acme/security This file routes the review request. It does not prove that every required check ran. That job belongs to branch rules, CI, and the final merge record.
Make the merge gate do the enforcement
Use protected branches or GitHub rulesets to require pull requests, named checks, and the right approvals. According to GitHub’s rulesets documentation, rulesets and branch protection rules can both protect a branch, and their rules are aggregated. Where the same rule is defined in different ways, the most restrictive version applies. For the checks themselves, see our guide to quality gates for AI-generated code.
A practical gate follows this order:
- The pull request opens.
- Vera or another AI reviewer scans the diff and posts evidence-backed findings.
- The author fixes blockers and pushes a new revision.
- CI runs tests, security checks, and policy checks.
- CODEOWNERS requests the right human reviewer.
- The owner checks the code, the AI findings, and the CI evidence.
- The repository allows merge only after every required gate passes.
Keep the decision outside the model. The AI can recommend “block” or “pass.” Repository rules decide whether the pull request can merge.
Treat exceptions as controlled work
Some urgent fixes cannot wait for the normal path. Do not hide the bypass. Make it a small, named process.
- Name the person who can approve the exception.
- Write the reason and link the incident or ticket.
- Limit the bypass to one pull request or a short time window.
- Keep the failed check and risk visible.
- Create follow-up work with an owner and due date.
- Review the exception after the incident closes.
Avoid shared admin accounts and vague notes such as “urgent.” They make the audit trail weak and make it hard to learn from the event.
Keep evidence that answers five questions
The final record should let an engineer or auditor answer:
- What code and base revision were reviewed?
- Which AI reviewer, model, rules, and version ran?
- Which checks passed, failed, timed out, or were skipped?
- Who approved the change, and at what revision?
- Was a rule bypassed, by whom, and why?
Store links to the pull request, check runs, findings, approvals, merge commit, and exception ticket. Keep stable IDs so the evidence can be joined later. An AI code review agent should attach the trigger, impact, and proof to each finding. A good review process also measures queue time and human work, not just the number of comments.
Roll it out without blocking the team
Start with one repository and one high-risk path. Run the AI review as advisory for a week. Compare its findings with human review. Fix noisy rules. Then require the AI check, CI checks, and code-owner approval for that path.
Watch false positives, missed blockers, review time, retries, and bypasses. If a check fails often because the tool is down, add a clear failure owner. Do not train teams to ignore a red gate.
AI review and human approval solve different problems. AI brings fast, repeatable coverage. A code owner brings context and accountability. Repository gates join them into one flow, while the evidence record shows exactly why a change was allowed to ship.
For a governed workflow around those gates, VibeFlow keeps implementation, review findings, approvals, and follow-up work connected.
Next step: Pick one risky folder, assign its owners, require its checks, and test the normal and exception paths with a small pull request. Then add Vera AI Code Review as the first review pass.
Sources
Frequently Asked Questions
Should an AI code-review agent block pull request merges?
Start with the agent as advisory while you measure false positives, missed blockers, review time, retries, and bypasses. Once the findings are trustworthy for a path, require the AI check alongside CI and code-owner approval. Repository rules, not the model, should decide whether a pull request can merge.
What does CODEOWNERS prove in an AI review flow?
CODEOWNERS routes review requests to the people or teams that own changed files and can be paired with a required code-owner approval rule. It does not prove that AI review, CI, security, or policy checks ran; those checks and their results belong in the merge record.
How should a team handle an urgent merge-gate exception?
Name the approver, record the reason and incident or ticket, limit the bypass to one pull request or a short window, keep the failed check and risk visible, create follow-up work with an owner and due date, and review the exception after the incident closes.
What evidence should an AI code-review process retain?
Retain the reviewed code and base revision, AI reviewer and model details, rules and versions, every check result including failures and timeouts, the human approver and revision, and any bypass reason and owner. Link the pull request, findings, check runs, approvals, merge commit, and exception ticket through stable IDs.
How can teams roll out AI review without blocking delivery?
Start with one repository and one high-risk path. Run the AI review as advisory for a week, compare its findings with human review, fix noisy rules, then require the AI check, CI checks, and code-owner approval for that path before expanding.
Written by
Axiom Studio