AI Can Fix Code, but That Does Not Make It Mergeable: Splitting Approval Authority

    This article explains why an AI-fixed code change is not automatically mergeable. It separates code correctness from merge authorization, then shows how default-branch policies can assign approvals by path and risk, define AI's role as evidence generator, advisor, or delegated signer, and preserve auditability and accountability.

    AI Can Fix Code, but That Does Not Make It Mergeable: Splitting Approval Authority

    Imagine a single merge request changes two places: one is API documentation, and the other is billing logic. An AI coding tool has already read the diff and pushed a fix suggestion, and the tests appear to pass. Can the change be merged now? The answer often depends less on whether the code has been fixed and more on the approval policy on the default branch: whether the documentation directory allows automatic sign-off, and whether the billing directory requires sign-off from a specific team. Even if the team is willing to let an AI agent sign documentation changes, the request must still wait as long as the billing directory requires a signature from the payment domain owner. Who wrote the code, or even who fixed it, is not the sole basis for that decision.

    This is the most important point to separate when discussing AI’s entry into the full code review, fix, and approval workflow: a tool being able to fix code correctly and a team being willing to give it signing authority are two decisions that can be made separately. Only by separating them can we clearly explain which waits can be eliminated, which responsibilities must remain, and whom to contact when something goes wrong.

    1. The Core Issue: Correctness and Merge Authorization Are Two Decision Surfaces

    Waiting on traditional merge requests is often broadly attributed to “the code is not ready yet.” After AI participates, that attribution becomes increasingly inaccurate. A change involves at least two types of questions:

    1. Correctness questions: Does the diff match the intent? Is the API documentation synchronized? Does the billing logic preserve boundary conditions? Do tests cover critical paths? Is rollback feasible?
    2. Authorization questions: Who has the right to approve this change on behalf of the team? Does the approval scope cover the relevant directories? Are domain owners, security reviewers, or compliance sign-offs required? Is the AI agent allowed to sign?

    These two types of questions can be related, but they must not be conflated. Code correctness can be supported by evidence from diff review, static checks, test reports, impact analysis, and human review. Merge authorization should be determined by approval policy, separation of duties, and audit mechanisms. Even if a change is “fixed correctly,” it cannot be merged if it touches a highly sensitive directory and lacks the required signatures. Conversely, a low-risk documentation change can use a fast lane even if AI generated it, as long as policy allows it and the evidence is sufficient.

    In the original scenario, the approval file lives on the repository’s default branch, and that design is representative: approval rules should not change arbitrarily with feature branches. Otherwise, a submitter could change both code and rules in the same request, creating “self-authorization.” The policy file on the default branch is the source of truth for the merge gate, and modifying it should itself go through stricter review.

    2. Approval Must Be Mapped to Paths and Risk

    A merge request often mixes multiple kinds of changes: documentation, configuration, business code, billing logic, and database migration scripts. Using the same approver for all paths creates two kinds of waste: low-risk changes are slowed down by high-risk processes, while high-risk changes may be approved “on the side.”

    A more reasonable approach is path-level and risk-level approval:

    • Match the change scope by directory or file pattern.
    • Assign risk levels to different scopes.
    • Define the required signing parties for each level.
    • Specify whether the AI agent in that scope can only suggest, can assist with signing, or must leave final signing to a human.
    • Set rule priority so broad rules do not override sensitive directories.

    For example, the documentation directory may require a documentation owner’s signature and allow an AI agent to assist with signing when evidence is sufficient. The billing directory may require a dual signature from the payment domain owner and a finance or security reviewer, with AI providing review opinions only and not participating in the final signature. In this way, waiting is no longer all-or-nothing; it occurs precisely according to the impact surface of the change.

    3. Three Roles for AI in the Approval Chain

    Putting AI into the approval chain does not mean handing final signing authority directly to AI. A safer design splits the role into three layers:

    1. Evidence generator: AI reads the diff, summarizes the impact surface, generates test suggestions, flags potential regression points, and produces a structured evidence package.
    2. Advisory approver: AI provides a conclusion such as “recommend approval,” “recommend rejection,” or “recommend human review,” but this does not produce final merge effect.
    3. Delegated signer: Under explicit organizational authorization, an AI agent may sign on behalf of a role within a limited path, risk level, and validity period, while leaving a traceable record.

    The third layer requires the most restraint. Delegated signing should at least satisfy the following: authorization scope is configurable, the signing entity is identifiable, the validity period is controllable, high-risk paths require final human signing, exceptions can be revoked, and audit logs are non-repudiable. For sensitive directories such as billing, permissions, security, and data deletion, human final signatures should generally be retained. AI can accelerate “understanding the change” and “preparing evidence,” but it should not blur “who is accountable.”

    4. End-to-End Design: Review, Fix, Approval, and Merge

    A complete AI-assisted development loop can be divided into five stages:

    • Diff review: Identify change types, affected directories, API contract changes, and potential risk points.
    • Fix suggestions: Provide patches or modification notes, but the fix itself still needs to enter the normal review process.
    • Evidence package generation: Summarize the diff description, test results, impact surface, rollback plan, and open questions.
    • Approval gate: Calculate required signatures according to the default branch policy, distinguishing human signatures from AI delegated signatures.
    • Merge and traceability: After merge, retain the policy version, signature records, and evidence package for audit and retrospective analysis.

    The most critical part is decoupling the “evidence package” from the “approval gate.” AI can make evidence more complete, but completeness of evidence must not automatically grant signing authority. Approval policy must not lower the co-signature requirements for high-risk paths just because AI is involved. Only by keeping the two separate can efficiency and accountability both hold.

    5. Optimizing Waiting: Classify Waits Instead of Simply Removing Them

    Waiting before merge can be divided into three categories:

    • Information wait: Reviewers do not know what changed, why it changed, or where the risk is. This can be reduced through structured diff descriptions, impact analysis, and test evidence.
    • Permission wait: Required signers are offline or responsibilities are unclear. This can be reduced through pre-approved roles, parallel sign-offs, timeout escalation, and delegated authorization.
    • Risk wait: High-risk changes must go through domain expert or compliance review. This type of wait should not be bypassed directly by “AI has fixed it,” but should be shortened through tiered approval and moving evidence earlier.

    Therefore, the optimization direction is not “let AI sign for everyone,” but to let low-risk paths pass quickly and help high-risk paths obtain the correct signatures faster. Measurable metrics include wait time by path, reasons for missing signatures, human review rejection rate, AI suggestion adoption rate, and rollback rate.

    6. Audit and Accountability: A Signature Means Responsibility

    Once AI participates in approval, audit records must answer: who or which agent signed, under which policy version, which diffs were reviewed, which test and rollback evidence was attached, what the authorization scope was, and whether human final signing occurred. A signature is not process decoration; it is an attribution of responsibility. If an organization allows AI agents to sign, it should clarify the approver of the agent configuration, the applicable scope, invalidation conditions, and revocation mechanism.

    7. Policy Structure Example

    The following is only a generic policy structure example and does not represent fields on any specific platform:

    1. policy_version: 2026-01
    2. defaults:
    3. require_human_signoff: true
    4. ai_agent:
    5. allowed: false
    6. path_rules:
    7. - match: "docs/**"
    8. risk: low
    9. required_signers: ["doc-owner"]
    10. ai_agent:
    11. allowed: true
    12. mode: "suggest_and_sign"
    13. max_ttl: "24h"
    14. - match: "billing/**"
    15. risk: high
    16. required_signers: ["billing-owner", "security-reviewer"]
    17. ai_agent:
    18. allowed: true
    19. mode: "suggest_only"
    20. require_human_final: true
    21. merge_gate:
    22. require_evidence: ["diff_review", "test_report", "rollback_plan"]

    Such policies should be placed on the default branch and protected, and changes to the policy itself should require separate review. Path matching should have clear priority to prevent documentation rules from accidentally overriding the billing directory.

    8. Implementation Recommendations

    Start with a pilot on low-risk paths: first let AI generate review evidence and suggested conclusions, then gradually open limited-scope assisted signing; retain human final signing for high-risk directories; make all delegated signatures revocable and auditable; and validate the benefits with wait time, rejection rate, and rollback rate. The ultimate goal is not to give AI unlimited signing authority, but to split “whether the code is correct” and “who has the right to approve the merge” into two clear, configurable, and traceable decision surfaces. In this way, teams know which waits can be eliminated and whom to contact when something goes wrong.