Command::new.First, add the new llm-assisted label to the PR.
We expect everyone to follow the new policy, not just authors. That means it is your responsibility to check whether an llm-assisted PR touches an area that‘s disallowed by the policy. You may request that the author redo it without LLM-generated code, in which case this section doesn’t apply.
The following areas are currently banned:
// SAFETY comments, must be human-written.“Code that affects soundness” is both broader and narrower than it sounds. It‘s broader because almost all of the compiler is relevant to soundness; it’s narrower because there‘s quite a lot of rust-lang/rust that isn’t the compiler (library, bootstrap, compiletest, rustdoc, CI, ...).
If in doubt, we suggest this criteria: Do not allow LLM-generated code for parts of the compiler where wrong code does not look wrong. Ultimately, this is up to your judgement as a reviewer.
You are still expected to respect your r+ rights. Please do not merge PRs unless you are confident in that part of that code, even if the maintainer does not wish to review LLM PRs.
Point people to #llm-mentoring liberally. Deal with low-quality PRs by closing the PR and asking the author to follow the policy. Deal with borderline PRs by asking the author to put in the work themselves rather than offloading it to you. For example, ask them to reproduce the bug, explain the change in their own words, identify relevant edge cases, or add or justify tests.
If you find yourself suggesting the same fixes on multiple PRs, consider adding them to the dev-guide.
If you see a PR that is “obviously” LLM-created without disclosing that use, you have the option—but not the responsibility—to close it unilaterally.
We suggest using the following wording:
This PR appears to be LLM-generated without disclosing use of an LLM, so I am going to close this PR. You are welcome to open additional PRs as long as they follow our [policy][forge-page]. For more information, see [#llm-mentoring] on Zulip. [#llm-mentoring]: https://rust-lang.zulipchat.com/join/rlfvpemsaacs3pfi6kwqnqjb/ [forge-page]: https://forge.rust-lang.org/policies/llm-usage.html
Examples of “obvious” LLM tells are:
./x test --stage 1 tests/ui/<the-new-test-name>.rs) or useless tests such as git diff --check.You do not have an obligation to detect LLM-created PRs; you don't need to play detective.
PR templates will have a “Did you use an LLM?” question so that this rarely comes up. If the author deleted the question without answering it, you can close the PR, no questions asked.
If the PR discloses use, but does not assign a reviewer following the experiment guidelines, you can close it similarly:
You've opened an LLM-generated PR, but it's in the normal review queue, which breaks our [policy][experiment guidelines]. I am going to close this PR. Please do not re-open it until you find a project member who has volunteered to review it. For more information, see [#llm-mentoring] on Zulip. [#llm-mentoring]: https://rust-lang.zulipchat.com/join/rlfvpemsaacs3pfi6kwqnqjb/ [forge-page]: https://forge.rust-lang.org/policies/llm-usage.html
If a PR is clearly not ready for review, you do not have to review it. It‘s ok to simply skim the PR and tell the author “you need to add tests before I can review this”. If you notice on your skim that the PR is clearly the wrong approach, it’s ok to close the PR and tell the author to talk with you in the #llm-mentoring channel before opening a new PR.