Skip to content

Add a PR template and an AI Policy - #2209

Open
rgommers wants to merge 3 commits into
pypa:mainfrom
rgommers:pr-template-and-ai-guidelines
Open

rgommers wants to merge 3 commits into
pypa:mainfrom
rgommers:pr-template-and-ai-guidelines

Conversation

@rgommers

@rgommers rgommers commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

As discussed on gh-2183. We're getting a large amount of AI-generated drive-by PRs, so this will help. I adopted @henryiii's suggestion for a policy verbatim, it is short and gets the key points across.

Closes gh-2183


📚 Documentation preview 📚: https://python-packaging-user-guide--2209.org.readthedocs.build/en/2209/

@rgommers rgommers added the type: maintenance Regular maintenance of the guide, CI and repo label Nov 24, 2026

@webknjaz webknjaz 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.

Since I participated in a few discussions in the past I figured I'd leave this here.

These are the pip-tools conversations:

I was hoping to write those in a way that it could be copied w/ minimal modifications across projects and the same is being adopted over @ @aio-libs: https://github.com/orgs/aio-libs/discussions/44. Some of the points have made it into the Ansible AI policy discussion @ https://forum.ansible.com/t/ansible-ai-policy/42642. And some inspiration has been drawn from the Python Devguide.

I'd like to point out that we have a paragraph explicitly explaining that the "good first issue" label is not a good fit for ai slop. I think it's a must have.

I'll invite @sirosen to review this proposal too..

Comment thread .github/PULL_REQUEST_TEMPLATE.md Resolved

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.

Also note that agentic tools don't tend to load this file deterministically. Moreover, they open PRs via API, supplying a free-form body in the request never seeing this text. Most tools would, however, load an AGENTS.md file. An instruction placed there may encourage an agent to read this template and fill it out. It's still left to chance, but the likelihood is higher.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I know it's not deterministic, that's fine - this is as much for the reviewers' benefit as for the new contributor or agentic tool. If it's clear that they didn't read it, it's an easy automatic close. Which we do now as reviewers already sometimes, it's just harder to justify so takes more work.

Most tools would, however, load an AGENTS.md file.

That's not an option, since it conflicts with valid AGENTS.md by experienced contributors or maintainers. You shouldn't add such a file unless you expect it to apply to everyone who interacts with the repo, which is typically not the case for OSS projects.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tools allow local files generally; usually a harmless specific file overrides AGENTS.md and some harnesses even have a <THING>.local.md specifically for this case.

However, I don't think this repo needs one, you can just make sure there's a link to what you want it to read in the README. If there's no AGENTS.md, all models are very likely to at least read the README as they gather info about where they are.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(Also, we can come up with a valid AGENTS.md that helps experienced contributors while still making sure it follows a process if making PRs - not in this PR though)

Comment thread source/contribute.rst Outdated

.. _ai-policy:

.. include:: ../AI_POLICY.rst

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.

I recommend having MyST-Parser plugged into Sphinx so that the other document could be in Markdown. Agentic tooling often works better w/ MD. Plus GH would render it better too. In pip-tools, we've opted not to call it a "policy", though but, made it a part of the contributing doc.

@henryiii henryiii Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This file name, at least with the markdown extension, is a growing standard and models will often find it and load it automatically. (The title doesn't matter, but the file name does.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm happy to change it to .md; then let's avoid the .. include:: and just make it a link instead.

I'm not really interest in adding heavy dependencies in this PR to accommodate a single small file.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Adding md support longer term might be useful, but not in this PR. I don't think it needs to be linked in.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Third commit reverts back to .md format, and links it from the Contributing guide, keeping a single sentence in that guide.

Comment thread AI_POLICY.rst Resolved
@webknjaz
webknjaz requested review from sirosen and a max review from Copilot November 24, 2026 12:28

This comment was marked as low quality.

@rgommers

Copy link
Copy Markdown
Contributor Author

Copilot started reviewing on behalf of webknjaz 1 hour ago

I think the AI Policy does and should apply to this too - no automated comments. I'm not interested in responding to that to be honest.

@rgommers

Copy link
Copy Markdown
Contributor Author

I'd like to point out that we have a paragraph explicitly explaining that the "good first issue" label is not a good fit for ai slop.

The good-first-issue label is already deleted, see gh-2209.

@rgommers

Copy link
Copy Markdown
Contributor Author

@webknjaz thanks for your thoughts. I'm really hoping to keep it minimal here, and capture the essence we'd collective want as active maintainers. Most importantly "the human is fully responsible". I'd prefer not to make this into a research project about the finer points of various AI policies. Could you please check if this PR captures the essentials you want to see yes or no?

-->


#### AI usage disclosure

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is that policy actually effective against spammers? We have an AI policy in our projects too, but those only farming issues and PRs in high-profile projects don't care. They do not do this because they looked at the project and didn't see a policy, they did it because they don't care.

I can see this being the worst of both worlds: We're adding additional process for those being responsive AI users, while not actually tackling the spam issue.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Quite possible. I think we want to try to make sure interactive harnesses provide a good experience, and we'll probably always have to deal with some low quality contributions.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It is quite useful in my experience. This is the difference between spending review effort to review a low-effort PR or even get it merged (which I've done a bunch over the past weeks), and a 5 second look to auto-close it.

And I took this over from NumPy, so I know it works.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

On the numpy side, is it the disclosure portion that's helpful, or the policy that you close all those low-effort AI PRs? I saw e.g. numpy/numpy#33329 (comment) and numpy/numpy#33282 (comment).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Both of them. As is the "what motivated this" question (because "I have a real-world problem" is a good indicator and lack of an answer or a "I just want to fix this bug" or "I ran a fuzzer" are indicators of low-value PRs).

Comment thread AI_POLICY.md
translation or grammar help is fine. AI output may infringe copyright; it is
your responsibility to make sure it does not.

Unsolicited, undisclosed, or low-effort AI PRs will be closed.

@konstin konstin Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

IMHO, we can just this line and "You need to respond to comments yourself" to the CoC or contributing guidelines, it saves us the additional process for everyone else, while still giving us clear moderation guidelines.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Okay by me, I'll let Ralf decide though.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added a sentence, but kept the policy as that seems preferred here by more people.

Comment thread .github/PULL_REQUEST_TEMPLATE.md Resolved
@sirosen

sirosen commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Since I was tagged in above, I want to note that I am a huge fan of how concise this is.

The most important thing for maintainers handling spam is for it to be easy to close junk and link the policy. No policy effectively stops the spammers.

The PR template questions should be kept short as well. They're a barrier for genuine new contributors and they don't slow down bad actors. 👍 for the current PR text for this.

@rgommers
rgommers force-pushed the pr-template-and-ai-guidelines branch from 093405b to 89da447 Compare November 24, 2026 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: maintenance Regular maintenance of the guide, CI and repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal: improvements to PR template, labels and contribution guide

6 participants