GreenLight in PyTorch can approve a pull request (PR) without human review, and that approval counts toward one of the project’s merge rules. To qualify, a rule must name the PR’s author and cover every changed file. This mechanism shows how a team can limit automated review authority to a specific group of authors and code areas.

InfoQ reported on November 27 that GreenLight had begun issuing real approvals. The current process and its limitations are set out in the PyTorch contributor guide, while the merge_rules.yaml file lists authors and path patterns.
Who and which changes can be approved
The merge rules specify authors and the path patterns associated with them. A PR is eligible for GreenLight if a single rule both names its author and covers every changed file. Being on the author list alone is therefore not enough: if any part of the change falls outside the corresponding scope, the criterion is not met.
GreenLight scans eligible open PRs every few minutes. The system reads the changes and decides whether they are safe to accept as they stand. If so, it issues an approval sufficient to satisfy the relevant merge rule. A Dr. CI comment indicates whether the PR is eligible for review and whether it needs a human; the approval appears as a review from pytorchgreenlight[bot].
The documentation also describes shadow checking for PRs outside the permitted group: in this mode, the system’s assessments do not become approvals that satisfy a merge rule. This allows teams to observe how the reviewer performs beyond the scope of automated decisions without expanding its authority.
Approval and merging are separate actions
GreenLight’s approval does not automatically put a change into the main branch. The author or a maintainer separately triggers the merge by issuing a command to the PyTorch bot. If the GreenLight decision is the only basis for merging, the bot waits for approval of the exact commit to be included. A new push while it is waiting ends the current command; after the updated code is checked, the merge command must be issued again.
This separation ties the system’s decision to a specific version of the changes and leaves triggering the merge as a separate step. For an engineering team, that is an important part of the policy: automated approval has a limited role in the process, rather than the authority to send any reviewed code to the main branch on its own.
When GreenLight hands a PR to a human
The system does not check drafts, PRs with unresolved change requests, or PRs already approved by a human listed in the rules. It also automatically declines to review changes exceeding 2,000 lines or affecting 200 files. PRs labeled Stale are skipped until the label is removed.
If a change is reverted, GreenLight withdraws its approval and no longer checks that PR. Reintroducing such a change requires human approval. Whenever the system requires human review, the process continues through the usual human review path with someone who has the necessary permissions.
What teams can learn from this
The PyTorch approach starts with an eligibility policy rather than enabling automated approval broadly: the team specifies authors and file scopes, then ties approval to merge rules. For a pilot, this means selecting a limited set of changes and deciding in advance what should be sent to a human—for example, an oversized diff, an ineligible author, or files outside the defined scope.
The main practical takeaway is that GreenLight’s permission is narrow and verifiable: the author, every changed file, and the current commit all matter. If a change is reverted, its approval is withdrawn, and the system will not check the same PR again. Teams should therefore assess this automation as a separate, controlled review step integrated into merge policy—not as a replacement for the entire code acceptance process.