Blog · Comparison · 16 November 2026

CODEOWNERS for Agent Pull Requests vs Approval Rules

Using CODEOWNERS for agent pull requests is the natural first move when coding agents start opening changes: the file already says who owns which paths, and GitHub already requests their review. It works well, up to a point. This article explains what CODEOWNERS does according to GitHub's documentation, where agent work strains it, and how Forkit's approval rules differ. The two are complementary, and for many teams CODEOWNERS with branch protection is enough.

What CODEOWNERS does

GitHub's docs define a CODEOWNERS file as the way to name the people or teams responsible for code in a repository. The main facts:

  • Location. The file goes in .github/, the repository root or docs/. If more than one exists, GitHub uses the first it finds in that order.
  • Patterns. Each line is a path pattern followed by owners. The docs' example notes that order matters: the last matching pattern takes the most precedence.
  • Automatic review requests. Code owners are automatically requested for review when someone opens a pull request that modifies code they own. They are not requested on draft pull requests.
  • Base branch. The file must be on the base branch of the pull request for owners to receive requests.
  • Requirements on owners. Owners must have write permission to the repository.
  • Enforcement. People with admin or owner permissions can require that pull requests be approved by code owners before merging, through branch protection.
  • Size. The file must be under 3 MB.

So CODEOWNERS with required code review gives a firm guarantee: a pull request that touches owned paths cannot merge without an owner's approval.

Limits of CODEOWNERS for agent pull requests

None of the following is a flaw in CODEOWNERS. They are consequences of using a merge-time control for work that now happens much earlier and in greater volume.

It starts at the pull request. An agent may run a migration, install a dependency or call a deploy script long before any pull request exists. CODEOWNERS has nothing to say about commands.

Volume. When agents open many pull requests a day, every owner becomes a queue. Cognition and Warp have both written that review is now the bottleneck.

Work without a pull request yet. A person supervising several local agents often wants an owner to look at a direction before it becomes a branch.

One pattern wins. Because the last matching pattern takes precedence, a file that matches two patterns has one set of owners, not both.

Approvals and new commits. Whether an approval survives later commits depends on your branch protection settings, which is something to check when agents push often.

What approval rules are in Forkit

Forkit has its own path-based approvals for review threads. According to its documentation:

  • Rules. Workspace owners map path globs to approvers.
  • Every matching pattern counts. Each pattern that matches a changed file needs one of its people. Approvals accumulate until all patterns are met.
  • Where the file list comes from. If Forkit's GitHub App is installed and has the pull request, the files come from GitHub. Otherwise they come from the agent's review request plus every file the session recorded changing. The docs' reasoning: a short list supplied by the agent cannot hide a file.
  • Unknown files. If rules exist and the files are unknown, a workspace owner must approve.
  • Stale approvals refused. An approval carries the sequence number of the last event the reviewer saw. Any newer event on the thread, including new commits or a failed check reported through the GitHub App, refuses it.
  • Only people decide. An agent cannot approve a review or resolve a thread.
  • Mismatch flag. When GitHub lists files the agent's session never recorded, the review page marks them "not in session".

Anyone can ask for changes, with a note per file, and the notes go back to the agent as one batch.

CODEOWNERS vs approval rules compared

GitHub CODEOWNERS Forkit approval rules
Where rules live A file in the repository Workspace settings, set by owners
Applies to Pull requests on GitHub Review threads, with or without a pull request
When it acts When a non-draft pull request is opened When an agent requests review
Several patterns match one file Last matching pattern takes precedence Every matching pattern needs an approver
Blocks merging Yes, with branch protection No; it records who approved what
Approval after new changes Depends on branch protection settings Refused if anything is newer than what was seen
Versioned with the code Yes No
Covers commands No No; commands go through permission rules

One row matters most: Forkit's approval rules do not block a merge on GitHub. They decide whether a thread counts as approved in Forkit. If you need a hard gate at merge, that is branch protection's job.

When CODEOWNERS is the better choice

  • You need enforcement at merge. Nothing in Forkit stops a pull request from merging. Required code owner review does.
  • You want ownership versioned with the code. A CODEOWNERS change is itself a reviewed change.
  • All agent work arrives as pull requests on GitHub. Hosted agents that go from an issue to a pull request fit CODEOWNERS exactly.
  • You want one mechanism for people and agents. A pull request from an agent is treated like any other.

For most teams, CODEOWNERS plus branch protection should be set up first, whatever else is added.

When approval rules add something

  • Review before a pull request. A thread can be sent for review from a local session.
  • Checking the agent's account of its work. The "not in session" flag and the rule about unknown files exist because an agent's summary of what it changed is a claim, not a fact.
  • Overlapping ownership. If both the security team and the billing team must sign a file under src/billing/auth/, accumulating approvals express that directly.
  • Fast-moving branches. With agents pushing every few minutes, refusing an approval of an older state by default removes a class of mistakes.
  • Teams whose approvers are not all repository writers. Approvers in Forkit are workspace members.

Using both

They stack cleanly:

  1. Keep CODEOWNERS and required reviews as the gate at merge.
  2. Mirror the important patterns as approval rules in Forkit, so the right people are asked while the agent is still working.
  3. Install the GitHub App, so the file list and check results on the thread come from GitHub and not from the agent.
  4. Use command rules for what happens before any diff exists.

The duplication of patterns is a real cost. Keep the Forkit list short: the paths where early review saves the most rework, such as migrations, authentication and infrastructure.

Related: how to review agent pull requests, stale approvals and AI code review vs human review.

Where Forkit fits

CODEOWNERS guards the merge. Forkit's approval rules bring the same idea forward, to the moment an agent says it is done, and check the agent's own report against what was recorded. It is free to try. More at forkit-mcp.com.

Sources

Read on 16 Nov 2026: