Safeguard
Developer Tools•

Who should review a pull request an AI agent wrote?

A human who did not launch the agent should approve its pull request, with code owners on sensitive paths and fresh approval after any new push.

Safeguard Security Team
3 min read

A pull request written by an AI agent should be approved by a human who did not launch the agent, with code owners reviewing sensitive paths. Require approval again after any new push. The person who prompted the agent is the author in practice, so they should not be the only reviewer.

The reviewer independence problem

When a developer prompts an agent and then approves the result, nobody independent has looked at it. That is not review, it is acceptance. The fix is the same as for human authored code: separate the author from the approver.

GitHub's documentation describes a branch protection option that requires the most recent reviewable push to be approved by someone other than the person who pushed it. That maps neatly onto agents, where the pusher might be the developer or a bot identity.

Settings that support independent review

SettingWhat it doesWhy it helps with agents
Require pull request reviewsNeeds a set number of approvalsBlocks self merge
Require review from Code OwnersOwners must approve files they ownSensitive paths get an expert
Dismiss stale approvalsNew pushes reset approvalAgent cannot add changes after approval
Approve most recent reviewable pushLast push needs someone elseStops pusher approving their own change
Required status checksTests and scans must passMachine checks run every time
Do not allow bypassingRemoves admin exemptionAdmins are exempt by default otherwise

On CODEOWNERS, the docs state that approval from any one listed owner satisfies the requirement and that the last matching pattern wins. Owners need write access.

A review routine for agent changes

  1. Read the description last. An agent's summary can sound sure of itself. Read the diff first, then compare it with the summary.
  2. Look for files the task should not touch. Workflow files, lockfiles, config, and permission settings deserve a second look.
  3. Check new dependencies by name. Confirm each exists, is the one you meant, and is maintained.
  4. Run it. Pull the branch and run the tests, not just the CI badge.
  5. Ask what is missing. Agents often skip error handling and edge cases that a human would add.

For a fuller list, see the AI written pull request review checklist.

Who counts as independent

A second developer on the team, yes. A different bot, no, unless you treat its findings as one input among others. Automated reviewers are useful as an extra reader. They do not replace a person with accountability for the merge.

Try it yourself

Click through it at your own pace, or open it full screen.

Watch which checks run before the merge button unlocks, then picture the human approval sitting on top of them.

Safeguard offers pull request gates and policies you can use alongside required review.

Quick check

Can the agent approve its own pull request?

It should not. Require a human approver who is not the pusher.

Do small changes need the same review?

Apply the same rule everywhere, and use code owners to add depth on sensitive paths. Exceptions for small changes tend to grow.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.