Rust-lang/rust 正在采纳一项 LLM 政策。
Rust-lang/rust is adopting an LLM policy

原始链接: https://blog.rust-lang.org/inside-rust/2026/08/05/rust-langrust-is-adopting-an-llm-policy/

Rust 项目针对 `rust-lang/rust` 代码仓库引入了一项关于使用大型语言模型(LLM)的新政策。该政策旨在解决人们的担忧:即不受监管的 LLM 使用可能会削弱社区协作、耗尽审查人员的精力,并掩盖贡献者是否真正理解其自身代码的事实。 该政策的要点包括: * **允许使用:** 允许将 LLM 用于回答问题、翻译、分析和优化代码等任务。 * **限制使用:** 严厉限制使用 LLM 生成代码。此类合并请求(PR)的接受门槛更高,包括强制性的测试要求,并禁止提交涉及健壮性(soundness)的关键性修改。 * **强制披露:** 任何公开的 LLM 生成内容(无论是在代码、PR 描述还是问题报告中)都必须明确披露。 * **以人为本的审查:** 审查人员无需评估 LLM 生成的内容,并有权拒绝不符合这些标准的 PR。 该政策并非全面禁止,也不是官方针对整个项目的立场;而是通过规范预期来维持一个透明且由专家驱动的社区。通过设定明确的界限,项目方希望减少“广撒网”式的低质量 PR,并确保贡献者持续关注该语言的长期健康发展。

Rust 项目已正式采纳了一项关于在代码库中使用大语言模型(LLM)的政策。该指南允许将大语言模型用于分析、润色和审查等任务,但不鼓励直接使用其生成代码贡献。 该项目的立场基于这样一种信念:有效的维护工作需要对代码有深刻的人文理解,而非仅仅依赖精良的机器生成产物。通过优先考量人工编写,社区旨在确保长期的可持续性及专业知识的共享。此外,该政策明确禁止针对大语言模型使用情况的骚扰行为,要求必须遵守项目的《行为准则》以维护文明的环境。 Hacker News 上的公众反应各不相同。支持者认为该政策是维持高质量、确保贡献者投入代码库的合理措施。然而,批评者则认为,限制人工智能生成的代码忽视了现代工具带来的效率提升,并可能导致该项目落后于那些拥抱技术加速的项目。归根结底,该政策是在一个两极分化的社区中建立明确预期的妥协方案。
相关文章

原文

Aug. 5, 2026 · Jynn Nelson

Recently, five teams in the Rust project adopted a policy that I originally authored, governing how Large Language Models can be used when contributing to the rust-lang/rust monorepo. Notably, the new policy is not an official stance on LLMs, and does not apply everywhere in the Rust project. I wrote it for a very specific purpose, described below.

This post talks about why we created that policy, what it says, and how this will affect contributors.

The policy affects the following groups of people:

  • People who review or moderate PRs on rust-lang/rust.
  • People who author PRs with LLM-generated code on rust-lang/rust.
  • People who discover issues using LLMs and post them on rust-lang/rust.
  • People who write issues or comments that directly quote an LLM on rust-lang/rust.

If you are not in one of those groups, you don't have to change anything about how you work.

reviewing is made of decisions.

"Shotgunning" PRs at reviewers incurs a high mental cost for them. I think most authors of LLM PRs believe that they are sincerely helping, but from our perspective, the code itself is the smallest and in some ways least important part of the change. We care much more about authors understanding what the code does, planning how it will change in the future, and deciding what it should look like. The code itself cannot help with any of those.

MIR optimizations as their first PR; and people posting "Verification: git diff --check" in their PR description as if that did something. While we had something for moderators to point to in the form of "Empower reviewers to reject burdensome PRs", our enforcement was inconsistent and our rules were not published anywhere. In practice, the rule was "anything goes, as long as it's not obviously horrible". Compared to the previous situation, the new policy is both much more strict and much more clear.

Regardless of your opinions on whether LLMs are good, bad, or a secret third thing, they can no longer be ignored. Our choices are not "no policy" or "policy". Our choice is whether to have the policy be an unofficial list of moderation notes or something we stand by publicly.

Why not ban LLMs altogether, or allow any use of LLMs that we think are pro-social? Because Rust governance doesn't work that way. We do not have a benevolent dictator who can say "No LLM-generated content, whether it be code or prose." or "AI is a tool, just like other tools we use".

Rust operates by consensus. As the policy says:

There is not a consensus within the Rust project—and likely never will be—about when/how/where it is acceptable to use AI-based tools. Many members of the Rust project and community find value in AI; many others feel that its negative impact on society and the climate are severe enough that no use is acceptable. Still others are working out their opinion.

Despite these differences, there are many values we all share:

  • Building a community of deep experts in our collective projects.
  • Building an inclusive community where all feel welcome and respected.

We want it to be possible to change the policy in the future. The policy has several provisions that make it easier to change than it was to originally adopt. The leadership council is also considering creating a sub-team that would handle LLM policy so we have fewer "nightmare" 30-person approval requirements.

I do not think every rule in this policy is wholly good. I do think that writing our rules down is better than not writing them down, and that having a policy that everyone kinda dislikes pushes us to improve our governance structures.

Profession by Isaac Asimov. No programmer tapes.

Code of Conduct at all times when interacting with the Rust project.

See the policy itself for more information.

Some parts of the policy are unenforceable. This is not a bug. The goal is not to catch every violation, but to create a clear bright-line rule: Disclosure is required for all public LLM text, unless specifically exempted by the policy. This allows moderators to identify violations based on actions, not on intent, and only consider intent when deciding how to respond.

"Allowed" section of the policy for a full list of what's meant by that. See rustc-dev-guide for the full list of guidelines.

#llm-mentoring at the same time. See the dev guide for exact circumstances and suggested wording.

You are not responsible for determining whether a PR is LLM-generated; that responsibility lies with the author. We will add a PR template that asks authors whether their code was LLM-generated so that this rarely comes up.

If an author claims their code is not LLM-generated, but you're still not sure, please report the PR privately to moderation. Style is not evidence; please do not accuse people of using an LLM. Reporting is not intended to be a penalty; the mod team is interested in seeing non-violations as well as violations.

the dev guide. The official policy remains canonical.