AI NewsDev toolsAnnouncement

PyTorch runs an AI code reviewer that can approve its own PRs

PyTorch's test-infra repo carries GreenLight, an AI code reviewer. It approves pull requests from the project's own maintainers on a five-minute schedule.

AI News

Editorial2 min read

LinkedInX
GitHub repository card for pytorch/test-infra, which carries the GreenLight AI code reviewer

Image: GitHub

Why it mattersA maintainer team drowning in AI-written pull requests now has an open-source tool to try. The safety layers in the repo show what a working auto-approval looks like.

PyTorch has an AI code reviewer in its open test-infra repository. The system is called GreenLight. It lives at pytorch/test-infra under the greenlight directory. The README describes a Python service that scans open pull requests in pytorch/pytorch. It then sends eligible ones to a reviewer workflow that can approve them.

What the repo shows

The scan runs in two modes. The default is one pass, like a cron job. The other is a long-lived daemon with the --loop flag. In production, the README says, the scheduled scan runs as an AWS Lambda called greenlight-scan. The Lambda fires on a five-minute EventBridge schedule. State lives in ClickHouse.

The service checks every PR against a set of merge rules. The rules name the people whose PRs are in the review cohort. A PR where a human has already made a decision is skipped. A reverted PR is dropped from every path, for good.

The README lists safety layers for the model itself. A sanitiser strips skill and instruction files from the PR checkout before the model sees the code. A read confinement hook keeps the model inside a safe set of folders. Secrets are scrubbed from the model's verdict message at one single fan-out point. A shadow mode holds verdicts back from the UI until an engineer flips a switch.

The RADAR link

InfoQ reports that GreenLight is PyTorch's open-source take on RADAR. RADAR is a code review system Meta uses inside the company. The article was written by Andrew Hoblitzell. InfoQ attributes the connection to PyTorch developer Edward Yang. Yang noted that "the RADAR approves are good" in Meta's internal use.

Meta's RADAR paper went up on arXiv on 28 May 2026 and was revised 12 June 2026. The paper reports that RADAR approved and landed more than 331,000 diffs at Meta. The paper covers 535,000 reviews in total. The paper says revert rates were one-third lower than non-RADAR reviews. It reports that production incidents were about 50 times less frequent for RADAR-landed diffs.

InfoQ also reports that GreenLight auto-approvals are limited to pull requests from PyTorch maintainers. These are people who already have approval rights by hand. It writes that eligible changes include "dead code removal, refactoring without behavior change, logging additions and new tests". That list is InfoQ's description, not a quote from the README itself.

What a team can take from it

A team watching AI-written pull requests pile up has a working design to read. The whole workflow is in the open. The safety pieces are named. The merge rules are a file in the repo. A team can adopt one piece at a time. One obvious first piece is the reverted-PR block. One more is the single scrub point for secrets.

GreenLight does not remove the need for a human reviewer on the hard pull requests. The design limits auto-approval to low-risk changes from people who already hold review rights. A team that wants to use it on untrusted contributors needs more gates than the repo shows today.

Source

SourceGitHub

This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.

Share
LinkedInX
Start a project