Skip to content

docs(ai): introduce an AI_POLICY - #4277

Open
seanmonstar wants to merge 2 commits into
masterfrom
sean/sruvvvmkstwx
Open

seanmonstar wants to merge 2 commits into
masterfrom
sean/sruvvvmkstwx

Conversation

@seanmonstar

Copy link
Copy Markdown
Member

For better or worse, LLMs are upon us. We are getting many more contributions using them. We may have personal preferences on how to use them ourselves. But best to at least define a policy for contributing, to have something to point to, and to try to align best practices.

This takes a balanced view, recognizing that policing usage is a recipe for sad times. Intent, understanding, and respect are what matters most.

Feedback welcome. Rendered

Comment thread docs/AI_POLICY.md Resolved
@seanmonstar
seanmonstar requested a review from a team November 18, 2026 16:12
Comment thread docs/AI_POLICY.md Resolved

@cratelyn cratelyn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for taking the time to write this policy, @seanmonstar! i can only
speak for myself, but i can say that in the last few months, i've been feeling
a need for a formal policy of some kind as well. i am glad to see this, and
having clarity about our stance towards LLM's will help remove ambiguity that
i currently feel when triaging issues and reviewing pull requests.

as written, this policy is too permissive for my personal taste. personally, i
would like to see something closer to the LLM policy that the rust project
adopted, here: https://forge.rust-lang.org/policies/llm-usage.html.

to summarize the core tenets of that policy: private usage of LLM's for
answering questions, summarizing discussions, reviewing drafts, exploring
potential solutions are all admissable. their policy bans usage of LLM's when
writing issue bodies or pull request descriptions, "non-trivial" code comments,
or structuring any processes such that they require participants to use LLM's
when contributing to a project.

there are some caveats, one notable one being machine-translation. this helps
contributors that may not speak english fluently, which helps avoid language
barriers from preventing participation in the project. similarly, use of LLM's
for discovering bugs, so long as one personally verifies the bug, is permitted.

i particularly appreciate this point in the section that outlines the "spirit"
of their policy: showing LLM output to another human without solicitation is
likely banned.

another collection of AI policies whose general rules i agree with are the
policies used by Fedora, LLVM, and wasmtime. see:
https://github.com/llvm/llvm-project/blob/347dc1321ed50578bb09da6fa10ccec581d8a2b6/llvm/docs/AIToolPolicy.md

there's a section of this policy that gets at the issue of "understanding"
one's contributions:

We expect that new contributors will be less confident in their
contributions, and our guidance to them is to start with small contributions
that they can fully understand to build confidence. We aspire to be a
welcoming community that helps new contributors grow their expertise, but
learning involves taking small steps, getting feedback, and iterating.
Passing maintainer feedback to an LLM doesn’t help anyone grow, and does not
sustain our community.

this policy goes on to describe a phenomenon they call "extractive
contributions", which i would comfortably say that we experience as well, as
another high-profile project in the Rust ecosystem:

The reason for our “human-in-the-loop” contribution policy is that processing
patches, PRs, RFCs, and comments to Bytecode Alliance projects is not free –
it takes a lot of maintainer time and energy to review those contributions!
Sending the unreviewed output of an LLM to open source project maintainers
extracts work from them in the form of design and code review, so we call
this kind of contribution an “extractive contribution”.

Our golden rule is that a contribution should be worth more to the project
than the time it takes to review it. These ideas are captured by this quote
from the book Working in Public by Nadia Eghbal:

"When attention is being appropriated, producers need to weigh the costs
and benefits of the transaction. To assess whether the appropriation of
attention is net-positive, it’s useful to distinguish between extractive
and non-extractive contributions. Extractive contributions are those where
the marginal cost of reviewing and merging that contribution is greater
than the marginal benefit to the project’s producers. In the case of a code
contribution, it might be a pull request that’s too complex or unwieldy to
review, given the potential upside." – Nadia Eghbal

Prior to the advent of LLMs, open source project maintainers would often
review any and all changes sent to the project simply because posting a
change for review was a sign of interest from a potential long-term
contributor. While new tools enable more development, it shifts effort from
the implementor to the reviewer, and our policy exists to ensure that we
value and do not squander maintainer time.

i strongly agree with this approach to fostering contributions. we can, and
should, welcome good-faith contributions from people of varying backgrounds,
skillsets, and languages. i believe that we can do this while simultaneously
pushing back on "extractive" contributions.

i also recognize that LLM's are powerful tools that can empower engineers to
quickly prototype software, answer questions about large codebases, and find
bugs in existing software. however, they pose significant externalities upon
projects like ours. we don't have the same incentives that corporate
engineering teams have, for example.

hyper has a broad base of dependents, and drives a significant amount of
production traffic on the internet today. users care about correctness and
stability, and because of that, we should strive to place an emphasis on
shipping changes that we are confident in. in my opinion, sheer delivery speed
is of much less relative importance to us than sustainability and reliability.

i'll note that the rust project's AI policy leaves open the potential for LLM
usage when prior consent is obtained. this is a valuable escape hatch,
because it leaves open a mechanism for cases like a production user that might
not have the bandwidth to manually craft a fix themselves, or a junior
contributor that is still learning how to write Rust. outlining extenuating
circumstances like this in advance effectively removes the cost on maintainers'
time when trying to "understand why [a contribution fails to adhere to the
policy], given the time and energy we have.
"

one another addition that i believe would be helpful to include in this policy
would be a boilerplate response that we can use when we observe violations.
this similarly saves maintainers the effort of writing a response themselves,
which is valuable in part because we regularly see violations today.

in closing, the primary changes i would like to see to this policy would
be to strengthen its defense of maintainers' time. i believe that we can most
easily do this by (1) prohibiting unsolicited review of LLM-generated code and
prose, and (2) pushing back firmly upon "extractive" contributions.

@seanmonstar

Copy link
Copy Markdown
Member Author

@cratelyn I greatly appreciate this write up, thanks! And I agree with the points you've brought up.

Apologies it if feels short. In other guidelines I've written, I tend to lean towards more succinct, defining principles and letting those drive. I think it's easier to read and comprehend, and easier to apply than trying to imagine all scenarios. That said, I could see more rationale written up in an appendix, kind of like Rust did.

Also, I've added the ability for the pr-template-check workflow to add a comment directly to the pull request. I prefer automating as much as possible, so that the critique of rules doesn't feel like it came from a specific person, but from the project directly.

From your comment, I'd like to add the following the policy:

  • That reviewers should not be forced to engage with LLM prose.
  • Notes about we care more about being careful than fast, because it underlies waves hands um, much of the internet. I recall writing something about that elsewhere, but where exactly escapes me.
  • A section on "extractive contributions", I remember liking this a while ago but had forgotten about it.

One thing I'll note that I purposefully left out of the policy: besides understanding code, I didn't want to police if the code itself was generated by an LLM or auto complete or by hand. I find as opposed to prose, code on the smaller scale looks the same either way (to me). I certainly don't want to get PRs that wrote up 2000 lines of changes in 2 minutes. (Maybe this is something that can be worked into the policy in a principles way?) But if someone used an LLM to generate boilerplate, or "claude, fix all the other types errors of my code refactor", or similar... I'd merge it, once I was certain I understood what was submitted (and it was decided we should even do that thing).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants