Repository navigation
Description
(I am creating an issue to a PR already opened (#31643), because there are many more ways to solve the problem.)
AI tools many people use to create PRs don't care about our Automated Contributions Policy.
Since GitHub Copilot Coding Agent Has Arrived! and people build Github-MCPs that can be integrated with LLM clients, scikit-learn and other open source projects get an increasing amount of AI spam. Many people who care about open source are unhappy about it and request an option to block AI-generated PRs and issues on their projects (Allow us to block Copilot-generated issues (and PRs) from our own repositories) - so far without success.
You can see that there is an increasing amount of partially or fully generated PRs and a decrease in overall quality for PRs on scikit-learn by looking at the last closed PRs (as of June 30th 2025). It is not a flood yet, but bad enough to keep several maintainers busy for some extra hours a week. It could become a flood in the future. This is why it is important to find solutions.
Quite some of the authors of these additional low-quality PRs on scikit-learn also spam llm-based PRs on other open source projects at the same time. I have added repeated cases to @adrinjalali's agents-to-block folder. The pattern of spammers is to open a PR with an unqualified guess of what the project needs or how an issue can be solved, and then not follow up after maintainers reviewed, close and try again.
PRs can look like someone made a genuine attempt to address an open issue, and project maintainers start to interact with the "authors" - but then their review comments are processed by an agent (not manually) and the PR never improves after a certain point.
Many authors of automated PRs did not invest a lot of time into it and don't have enough skin in the game to care.
This creates a huge burden for reviewers because we cannot see if a PR or issue is AI generated and there is no way to foresee how much manual work and thought their "authors" are willing to invest after their llm's first guess wasn't quite helpful.
Reviewers are forced to chose between several options:
a) being helpful to an alleged newbe who makes mistakes but wants to learn (only that they are not),
b) writing our review comments like prompts for someone's llm,
c) closing the PR by writing down a polite-to-humans closing message with a reasoning on why this PR doesn't measure up quality-wise or is not needed, even though the human author might hardly care or might not even read it
Reviewers can loose time on trying option a and b before before closing a PR.
This takes reviewer's attention from PRs that are thoughtful which is unfair to human contributors that create thoughtful PRs and it is ultimately harmful to the whole project.
###############
The issue to solve is to find out how to protect against the effects of AI spam, mark AI based PRs and issues (so reviewers know what they deal with), most efficiently block spam-authors, and discourage LLM agents to automatically open PRs in scikit-learn.
I really think there should be a process-oriented way to deal with this problem. Ideally, we can find technical solutions.
It is not enough to let reviewers deal with on a one-to-one basis.
Activity
[-]AI tools like Copilot Coding Agent don't know about / respect our Automated Contributions Policy[/-][+]AI tools like Copilot Coding Agent don't know about / don't respect our Automated Contributions Policy[/+]glevv commentedon Jul 2, 2025
The only idea that comes to mind as a potential solution is to combat AI with AI. For example, there are several AI detection libraries for text, code, etc., which could be automatically run on issues or pull requests using GitHub Actions. If the score is too high, it could automatically close the issue or pull request. I’m almost certain that something like this already exists, but I haven’t been able to find an example.
StefanieSenger commentedon Jul 2, 2025
Great, thank you @glevv!
I am discovering as I go.
What I just found is AI Watchdog GitHub Action. Unfortunately, it doesn't look like it's getting updated and it would need to be regularly updated to go around prompts like "generate a PR to solve this issue, but make it seem as if it was not ai generated".
I also found Codect: AI-Generated Code Detection which is not a GitHub Action, and also very new, but seems people are working on it still.
There are also tools you can buy and that are closed source, but that's a security risk and I don't think we want tools that we don't know how they work, to recommend us to close PRs.
betatim commentedon Jul 2, 2025
I was looking at https://github.com/scikit-learn/scikit-learn/pulls?q=sort%3Aupdated-desc+is%3Apr+is%3Aclosed+is%3Aunmerged+ and while there are a surprising number of closed PRs, I couldn't find ones that looked like they were AI generated. There are many that I'd class as "low effort made". For example the PR template was not filled in or ones where people make seemingly random changes (eg placeholder for an example, benchmarking docs). These PRs are annoying and suck up time. The good thing is that they clearly don't follow the contributing guide, so we can quickly close (or leave a canned response to please update the PR description).
This made me wonder if we can introduce a label for these low effort contributions. A label is easy to apply (like "mark as spam" for email), we can easily filter for it to get some stats on how bad things are, we could write a contributing guide entry about "My PR got marked as 'spam', what should I do?" to give humans a chance to improve, we could have a bot that closes such issues/PRs a few days after being marked as spam, the bot could post an explanation for the author when the PR/issue is marked 'spam' that links to the guide.
A label (with a bot that acts on it) would lower the amount of effort needed by maintainers. It isn't fully automatic, but maybe good enough? I'm thinking of email spam: I don't get annoyed by it anymore, I just mark it as spam and move on (yes, most of the spam is automatically filtered, which is different here).
adrinjalali commentedon Jul 2, 2025
The difference between scam emails and PRs (at least for me) is that figuring out an email is span takes a split of a second, while for a PR it takes a lot longer. So I rather have a much harsher way of dealing with them, because the consequence of having them is not as low as an email.
An alternative is to have a check box or a field in the PR template, where users need to check that it's not LLM generated, and we simply close all the ones which don't have the check. Not sure if it'd work though, an LLM might fill that out the "right" way.
betatim commentedon Jul 2, 2025
I (anecdotally) encounter more spam-y issues/PR where it is clear that it is spam-y than I have back and forth interactions with some kind of tool (or even the human behind a fully automated tool). I agree it isn't as quick as spam email. But there is a good chunk of PRs that have an empty PR template or something obvious like that.
For me it is "low effort" contributions that need dealing with. The fact that you used a LLM by itself isn't a problem for me, it is what you do with it. And of course you can also create spam-y contributions without using a LLM/agent/tool (eg. someone at a university tells people to make a PR as part of their homework, hacktoberfest, etc)
adrinjalali commentedon Jul 2, 2025
We also need to update our codeofconduct file to make sure this is included there, since this is what users receive if we "notify" them when blocking:
adrinjalali commentedon Jul 2, 2025
Yes, but removing LLM generated ones, removes a good chunk of the bad ones.
betatim commentedon Jul 2, 2025
If we ban all and any use of LLMs several of my PRs and issue comments would be "illegal". This is why I don't want to have something that says "if you used LLMs you are out" but prefer https://scikit-learn.org/dev/developers/contributing.html#automated-contributions-policy
adrinjalali commentedon Jul 2, 2025
That's a different issue @betatim . I agree with you and I use LLMs quite a lot too. It's not about using them, it's about submitting low quality PRs the way a bot or a non-thinking human would do.
We should certainly be careful about our wording there. But I still do desire a tool which can tell me "you might want to block this user"
StefanieSenger commentedon Jul 2, 2025
That is exactly the problem, @betatim.
It is often not obvious unless you have encountered some patterns.
Two examples:
That's not trivial. It forces reviewers to make a decision between being a welcoming project or a burocratic nit pick. Nobody wants to take on a task like this.
That could be part of the solution. And a process that has reviewer's back and doesn't leave us alone on this.
39 remaining items
StefanieSenger commentedon Dec 16, 2025
Continuing our collection of ideas to ease the reviewing process, especially with AI generated PRs:
I hadn't thought of this, but we can actually also convert a PR into a draft (like here: #24769 (comment)) when we think it's not yet ready to be reviewed.
StefanieSenger commentedon Dec 17, 2025
Also a good answer to an AI spammer on matplotlib (matplotlib/matplotlib#30872 (comment)):
"Thank you for your interest in contributing to open source. I see you have opened a lot of PRs in a short space of time, so I assume your contributions are mostly automated. I suggest it would be better to slow down, pick a single project that you are interested in, and take time to thoroughly understand whichever issue you decide to work on. Also take time to read the project’s contribution guide. Note that AI tools often get things wrong so if you choose to use them you need to carefully check everything they produce."
rcomer commentedon Dec 17, 2025
👋
I have been following this thread for a while - lots of useful discussion.
AnneBeyer commentedon Jan 6, 2026
What do you think about trying to add to our
AGENTS.mdthat Issues labeled "Needs Triage" or that already have a linked PR should not be tackled?StefanieSenger commentedon Jan 26, 2026
Summing up a few more measures we had taken in the last few months to improve the situation with AI-based PRs. They might or might not have been mentioned here before.
This issue has raised some awareness on the problem and several measures have come out of it, that in the sum make scikit-learn a little easier to maintain.
Do people think we can close the issue or should this stay open for discussion for a little longer?
If I don't hear anything in a week or so, I assume this issue had served its purpose and I will close.
StefanieSenger commentedon Jan 31, 2026
Closing as completed. 🎉
StefanieSenger commentedon Feb 9, 2026
Recent broader discussions:
Jan 27 2026: Github Community Discussions: Exploring Solutions to Tackle Low-Quality Contributions on GitHub
Jan 29 2026: Scientific Python Blogpost on Community Considerations Around AI Contributions
Feb 3 2026: GitHub ponders kill switch for pull requests to stop AI slop. Code community site begins to see that AI could drive people away
Feb 6 2026: Numpy Mailing List: Current policy on AI-generated code in NumPy
Feb 12 2026: Scott Shambaugh's Blogpost: An AI Agent Published a Hit Piece on Me related to closing an AI-generated PR: matplotlib/matplotlib#31132
Feb 14 2026: GitHub finally acknowledged open source’s spam crisis with a nice timeline on the most recent developments
Feb 19 2026: Melissa Weber Mendonça started a repo collecting open-source-ai-contribution-policies
Feb 25 2025: GitHub has started as community survey for project maintainers; my answers: https://github.com/orgs/community/discussions/185387#discussioncomment-15920617
StefanieSenger commentedon Jun 9, 2026
May 26 2026: Daniel Stenberg's Blogpost: The pressure
May 31 2026: Franck Nijhof's Blogpost: Open source was not ready for AI-speed contributions
Jun 7 2026: stdlib Blogpost: What We're No Longer Seeing: AI and the Invisible Newcomer in Open Source
StefanieSenger commentedon Jul 16, 2026
Cross-referencing issue Licencing issues when contributors had sold their copyright to paid platforms #34489, since it directly touches the topic of low quality fly by PRs led by AI.
StefanieSenger commentedon Jul 23, 2026
Interesting idea at @astral-sh:
astral-sh/ruff#27016 (comment)
I really like the idea of expecting contributors to communicate in their own words. It's a question of etiquette. People are torn to open source because they want to interact with other humans on interesting topics. I don't want contributors or maintainers to be turned off by being forced to talk to people hiding behind bots.
Also, whole AI policy of this project reads pretty clear.
lucyleeow commentedon Jul 24, 2026
Another idea dask has an instruction:
https://github.com/dask/dask/blob/main/.agents/skills/open-pr/SKILL.md
(but of course this may just get ignored)
StefanieSenger commentedon Jul 24, 2026
I like it, too.
I think that enforcing is the hard for any policy, since the only instruments that we have are hiding comments and closing issues/PRs. It boils down to being strict/consistent with enforcement, which is still an extra burden on maintainers.