Skip to content

AI Policy - #530

Merged
ceb8 merged 4 commits into
astropy:mainfrom
ceb8:aipolicy
Mar 5, 2026
Merged

ceb8 merged 4 commits into
astropy:mainfrom
ceb8:aipolicy

Conversation

@ceb8

@ceb8 ceb8 commented Feb 9, 2026 •

Copy link
Copy Markdown
Member

Adding an AI policy document to Astropy's policies.

This policy was drafted by the CoCo, making use the discussion to close #509

The comment period for this policy document is open now (9 February), and will run through 23 February.

@pllim

pllim commented Feb 9, 2026

Copy link
Copy Markdown
Member

Yay, thanks!

  1. Should we also state that maintainer reserves the right to close low-value PRs without further discussions and label them as "Invalid"?
  2. Should we put this policy in https://github.com/astropy/.github for the whole org? And then individual repo can link there? Or am I misunderstanding what the .github is for?

@mhvk mhvk left a comment

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.

Thanks for writing this! Two small comments.

In the end, I'm not sure this addresses my main worry, which is poorly thought-through contributions with minimal improvements by people who have no intent to contribute further, making review essentially a waste of time. But really that is independent of AI, so out of scope here; it is more a question of community building (and how to ensure reviewing does not become a chore).

Comment thread policies/ai-policy.md Outdated
1. Contributors are responsible for all submitted content, regardless of whether generative AI tools were used.
1. Contributors must be able to explain all changes during review.
2. Authentic engagement. The pull request process is collaborative and iterative. Contributors are expected to actively engage with reviewer feedback.
3. Consistency with Astropy conventions and existing style. In the context of Generative AI, this particularly means conveying information (comments, documentation, etc) in a style the Astropy user community will understand.

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.

Maybe add ", and that is appropriate and to the point" -- AI contributions are often incredibly wordy, with no regards for the fact that, e.g., in a docstring one does not explain everything.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Add this at the end of point 3 you mean?

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.

Yes, sorry for not being clear!

Comment thread policies/ai-policy.md
Astropy maintainers welcome contributions, including those developed with the assistance of generative AI tools. However, the use of such tools does not change our expectations for contributor responsibility, engagement, or code quality. The following apply to all contributions.

1. Human ownership and accountability
1. Contributors are responsible for all submitted content, regardless of whether generative AI tools were used.

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.

Should this include something like ", including that the code does not break copyright" - AI is known to copy verbatim code that falls under the GPL.

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 would get my vote, but then I don't see how one could guarantee that without doing more research work than was "saved" by the use of AI, so it seems incompatible with accepting any AI-backed work.
FTR, I would still be very much in favor of banning AI use completely, and considering this important point Marten made, I'm not sure I can support any lesser position without compromising internal consistency in my reasoning.

@astrofrog astrofrog Feb 10, 2026 •

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 would still be very much in favor of banning AI use completely

This is unenforceable though, except for the most obvious cases

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.

Indeed, but obvious cases are frequent enough that it would still be useful, IMO

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.

This is a complex and nuanced issue in general. As an example: how can you guarantee that code you personally write without the use of an AI tool is not partly an output of "saved" code in your own biological neural network? I certainly have read GPL code and thought "oh that's neat, I should use a trick kinda like that" and then surely code I wrote years later has some element of that GPLed code. But legally that is not considered a copyright violation. Whereas if I literally memorized the code and wrote it verbatim a year later, that is infrigement. Whether or not the same rules apply to genAI is of course debatable, but at least to me it seems fairly comparable.

My point then is that I think what's already written implies that we are for now going to apply the same rules as we would for humans. But with the onus on the real live humans to apply the same level of "enforcement" - i.e. best effort, with a healthy dose of trust.

Whether we should explicitly call out copyright, though, I have mixed feelings: I have as much a concern about the "AI slop" (i.e., subtly poorly written code that a human hasn't really tried to understand) as I do about copyright violation. So do we then add that as another important thing to watch out for? Or do we leave it as is and try to address these specific items as we do review? Given that uncertainty I tend towards leaving as-is with the short and succinct policy.

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.

Oh, although... maybe we should have an "examples of mis-use" added below that includes both the copyright violation case and the AI slop case explicitly? Then the policy itself is simple and clear but hopefully people still get their attention drawn to these especially problematic cases?

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.

Having re-read the text and the above discussion, I think I agree with @eteq that given the present text, we should keep this as is -- there already is an expectation that copyright should not be violated. So, happy with no change here.

That said, I'd still be in favour of just adopting an already written policy -- see main comment.

@astrofrog

Copy link
Copy Markdown
Member

@pllim it only makes sense to put in .github if it is a special file GitHub will do something with (like templates for instance)

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

I’m happy with this as a starting point and we can always review in future if it is not sufficient.

@pllim

pllim commented Feb 10, 2026

Copy link
Copy Markdown
Member

Do we want to link to this new policy doc from

a. astropy.org website?
b. astropy core dev doc and readme?

@Cadair

Cadair commented Feb 11, 2026

Copy link
Copy Markdown
Member

Also the PR template?

@pllim

This comment was marked as resolved.

@ceb8

ceb8 commented Feb 11, 2026

Copy link
Copy Markdown
Member Author

Does anyone actually read the stuff in PR template? 😝

I do! ;)

@eteq

eteq commented Feb 11, 2026

Copy link
Copy Markdown
Member

Totally agree with @pllim and @Cadair's suggestions re: linking it, I was just thinking we get the policy done first before adding those links. But I'll add an issue to remind us to add the relevant link/ads.

@eteq eteq mentioned this pull request Feb 11, 2026
2 of 3 tasks
@pllim

pllim commented Feb 11, 2026

Copy link
Copy Markdown
Member

Case study:

@webknjaz

Copy link
Copy Markdown

Additional policy examples and discussions: https://github.com/chaoss/wg-ai-alignment/tree/main/moderation#readme

Comment thread policies/ai-policy.md Outdated
Comment thread policies/ai-policy.md Outdated

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

I'm going to explicitly say here I don't think this goes far enough. I'm not completely sure I know how far I think we should go at this point but this isn't it.

Scikit-learn and llvms policys are a lot closer to where I think we need to be.

@bsipocz

bsipocz commented Feb 15, 2026

Copy link
Copy Markdown
Member

I'm going to explicitly say here I don't think this goes far enough. I'm not completely sure I know how far I think we should go at this point but this isn't it.

Scikit-learn and llvms policys are a lot closer to where I think we need to be.

Full agree with Stuart on all of this! AI is not our friend when it's about library development. Do hack away with it for a website deployment, but here we talk about soaking up a lot of scarce maintainer resources and goodwill on onboarding new "people".

@zacharyburnett

zacharyburnett commented Feb 16, 2026 •

Copy link
Copy Markdown
Contributor

I'm going to explicitly say here I don't think this goes far enough. I'm not completely sure I know how far I think we should go at this point but this isn't it.

Scikit-learn and llvms policys are a lot closer to where I think we need to be.

I do really like sunpy and scikit-learn's policy paragraphs, because they are concise and part of the readme. Perhaps we could combine these points in this PR into a single paragraph in the README? and include something along the lines of "we will block you from contributing if you waste our maintainers' time"?

I'm watching this PR for ideas on how we'll need to write policies for spacetelescope repos, if we ever get hit with AI slop

@Cadair

Cadair commented Feb 16, 2026

Copy link
Copy Markdown
Member

I will say that the sunpy policy clearly isn't working so we are working on drafting more guidance: sunpy/sunpy#8505

@zacharyburnett

Copy link
Copy Markdown
Contributor

Perhaps blocking users from collaborating with the organization should be a more readily-used option if they waste maintainer time with slop PRs and comments (as in, it's clear that they are not engaging with the maintainers themselves). In my (limited) experience with users who submit slop, they usually aren't sources of quality code contributions in the first place, even without using genAI, so indiscriminately blocking them doesn't really seem like a big loss for external collaboration

However, I'm not an active contributor to astropy and don't really have a feel for this community at large, so take my opinion with that in mind

@mhvk

mhvk commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

Perhaps blocking users from collaborating with the organization should be a more readily-used option if they waste maintainer time with slop PRs and comments

The problem is that this effectively forces the maintainers in a kind of policing role (this is a point made by David Hogg in his arXiv white paper on astronomy more generally).

As a maintainer, if every PR from a new contributor has a substantial likelihood (>10%?) of being AI slop, I'll end up not looking at new-contributor PRs anymore (actually happening already...). I'd still prefer a "web of trust" system were we make people introduce themselves -- then, it just happens once, at first entry. Obviously, that poses an extra hurdle, but I think it can also be a way to more immediately make a connection, leading to more friendly review. (And, yes, there will still be bad actors, but surely fewer; lying is different from submitting something that an AI tells you is a good solution.)

@eteq

eteq commented Feb 18, 2026 •

Copy link
Copy Markdown
Member

The problem is that this effectively forces the maintainers in a kind of policing role

This is one of my two biggest concerns with a significantly stronger policy. In practice you cannot know if something was AI slop or just regular 'ol human slop, unless the author tells you. I know of plenty of cases where a junior human wrote something without any AI assistance, but then was told "this is obviously chatGPT-written" or whatever, and that leaves a permanent negative impression... So then how could we expect maintainers to spend even more time on these issues than is already being wasted?

@Cadair or others, I'm not sure what we do with "it needs to be stronger but not sure how". I have found scikit-learn's policy to be a good example except for one key issue: it says both "Please refrain from submitting issues or pull requests generated by fully-automated tools." and also "Review all code or documentation changes made by AI tools and make sure you understand all changes and can explain them on request, before submitting them under your name" - the former statement could be read as "no AI allowed" whereas the latter is "only use AI if you are willing to stand behind everything it wrote when you submit a PR". I think the latter is the intended meaning, and it was exactly that scikit-learn stance that was the original inspiration for this policy, but with some modifications for more straightforward wording. So can someone help me understand what more we could add to strengthen this without making it more confusing?

@eteq

eteq commented Feb 18, 2026 •

Copy link
Copy Markdown
Member

Thought that occurred to me after the above: would it help to add a "this is inspired by scikit-learn, see there for some similar but additional thoughts"?

(we should credit scikit-learn anyway given the inspiration, but I'm curious if folks think it also addresses some of the above cocnerns)

@Cadair

Cadair commented Feb 18, 2026 •

Copy link
Copy Markdown
Member

the former statement could be read as "no AI allowed"

To me the "fully-automated" in that statement is you ask one of the tools "solve this issue and open a PR", i.e. basically no human in the loop at all. The most extreme example of this being the recent mpl debacle.

I think we can have documentation with strict guidelines on what we deem to be acceptable and still only enforce them when we want to. This is the case for many of the technical guidelines we have as well.

For me the main thing this is lacking is some strong words on not pasting the output of a LLM into the comments / OP of a PR. This is the the most egregious thing imo.

@bsipocz

bsipocz commented Feb 18, 2026 •

Copy link
Copy Markdown
Member

I'm not sure if this was on the numpy thread or elsewhere, but someone nicely put it: for those parrotting low quality PRa we really don't need the contributor to play middle-person, the maintainer could prompt the AI themselves and do it better.
So, if the contributor doesn't understand the changes and be to the point in the comments (as opposed to the extremely long comments) then they just add noise which should be closed off as is, without further interaction.
And this is where sklearn is very strict, they in deed close PRs fast and ban repeated offenders.

(And they also run first time contributor sprints, low quality contributions from human first timers really should come through events and not just randomly lashed off on maintainers all the time expecting hand holding and personalised mentoring)

@mhvk

mhvk commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

In practice you cannot know if something was AI slop or just regular 'ol human slop, unless the author tells you.

This is where the web of trust would seem the only option for a real reduction -- i.e., a need for a contributor to be on a whitelist before even submitting a PR. This adds a hurdle, but I think we can make this something that helps attract new contributors. But more importantly, it should help keep maintainers sane.

For me at least, a policy I can point to when closing PRs is actually relatively little help, though I think it is good to have one if only to explain why we have a whitelist.

So, more on topic of this PR, my suggestion would be to not spend too much more time on the exact policy -- as is, I'd tend to simply adopt that of scikit-learn -- and start thinking about how to implement the web of trust.

@eteq

eteq commented Feb 25, 2026

Copy link
Copy Markdown
Member

@Cadair

I think we can have documentation with strict guidelines on what we deem to be acceptable and still only enforce them when we want to. This is the case for many of the technical guidelines we have as well.

Ah I see your point here - totally agree this is similar to e.g. style guidance where sometimes exceptions are ok if they are for good reasons and its left to maintainers to make the judgement call.

For me the main thing this is lacking is some strong words on not pasting the output of a LLM into the comments / OP of a PR. This is the the most egregious thing imo.

I really like this idea! Hopefully @ceb8 can add something to this effect. And combined with the above point maybe this helps with some of the concerns @bsipocz raised? (it doesn't solve them all but at least starts us down a path?)

@mhvk

I think the idea of web-of-trust or similar is a good one, except I'm not as sure we can implement it usefully in a context like Astropy where there are quite different communities that have overlapping but different perspectives that are both needed (i.e. the engineering/developer/technical community and the science community). That is, even if we made a successful web-of-trust model for, say the astronomy research community, it might exclude technical experts who aren't known in the research community but are still valuable contributor/maintainers. It also has the potential to further exacerbate some of the existing issues where e.g. people in the Global South are underrepresented because they aren't plugged into the right communties. I'm sure there are solutions to this but they are not something that I think we can do right now. (which I guess is maybe your point of why we want you want to focus on that instead of this policy?)

Comment thread policies/ai-policy.md Outdated
@zacharyburnett

Copy link
Copy Markdown
Contributor

I'm not sure if this was on the numpy thread or elsewhere, but someone nicely put it: for those parrotting low quality PRa we really don't need the contributor to play middle-person, the maintainer could prompt the AI themselves and do it better. So, if the contributor doesn't understand the changes and be to the point in the comments (as opposed to the extremely long comments) then they just add noise which should be closed off as is, without further interaction. And this is where sklearn is very strict, they in deed close PRs fast and ban repeated offenders.

(And they also run first time contributor sprints, low quality contributions from human first timers really should come through events and not just randomly lashed off on maintainers all the time expecting hand holding and personalised mentoring)

#530 (comment) might need even stronger language to align with what you're saying

@mhvk

mhvk commented Feb 25, 2026

Copy link
Copy Markdown
Contributor

@eteq - agreed that a web of trust needs some thought, which is why I suggested with starting with something like having a welcome message that asks new contributors to introduce themselves, to try to get going with a human connection asap.

To me, the details of the AI policy are less important, since I do not expect them to be read, i.e., the burden is still on the maintainer to be policing it. The only help is that at least there is something to point to.

Aside: the discussion in numpy is (somewhat) going in the direction of adopting the scipy policy (or perhaps a version of llvm); see https://scipy.github.io/devdocs/dev/conduct/ai_policy.html

Personally, I like the idea of a large part of the scientific python ecosystem having the same policy (and making things easier for ourselves by adopting instead of rewriting).

@adrn

adrn commented Feb 27, 2026

Copy link
Copy Markdown
Member

I think this policy is a great start — thanks @ceb8 and others for drafting and opening the PR!

From reading the discussion above, it seems like there is some tension in that some want a stricter policy and others want to keep it simpler (and more easily enforceable). I sympathize with both! But I do think having a policy like the one here could be a good starting point to get something in place, and then we can iterate on it (and other possible changes, like updates to the README or PR template) after some more discussion either in a bigger-picture issue or perhaps at the coordination meeting?

@adrn

adrn commented Feb 27, 2026

Copy link
Copy Markdown
Member

This comment is perhaps less directly relevant to the policy itself, but something that it got me thinking about. I'm happy to move this discussion elsewhere if we decide to continue the broader conversation in a different issue/PR/slack thread/whatever.

One thing I haven't seen mentioned here is the idea of asking for disclosure of LLM usage in contributions, and I'm curious what others think. This has come up in other contexts, like publishing and grant proposals, where it is often just a checkbox. I'm not sure how useful a checkbox would be here, though, since there is a large dynamic range in what "I used an LLM in this PR" means ("I asked Copilot to autocomplete a line" vs. "I generated all the code from a prompt").

One thing we could be after is to have a better record or description of how a PR came to be, and what the broader context of that PR is. As a thought experiment, I was considering what it would look like to make opening a PR closer to publishing a paper. In publishing, there are authors, acknowledgements, and citations. I think of these categories as Authors = "people who contributed and have autonomy to sign off on the content," Acknowledgements = "a place to recognize people, facilities, datasets, etc. that contributed at a more conceptual level", and Citations = "tools/software used, prior work built upon, relevant issues, etc."

Some PRs discuss subsets of these things, some mention all, but many don't. Capturing this information -- or at least requesting it via the PR template -- could be valuable in general (I've certainly worked on PRs where people contributed intellectually but don't appear in the discussion or commit authors), and especially so in the LLM era. For example, it could help us understand how LLMs were used in a given PR to have another metric to assess the level of human review and accountability behind the code changes. Someone could say: "I used a clanker to draft the initial implementation and then manually reviewed and revised it," which gives reviewers more useful context than a yes/no checkbox.

Thinking out loud here (it's confusing to know exactly what to do given that the landscape is changing and the way and extent to which developers are using LLMs is changing), but I guess a concrete suggestion would be to add some more structure to the PR template to ask for some of this information, and to ask for a description of how LLMs were used if they were used?

@pllim

pllim commented Feb 27, 2026

Copy link
Copy Markdown
Member

asking for disclosure of LLM usage

@neutrinoceros and I discussed this somewhere and I am sure similar other conversations had happened here and there as well. My worry is that the people who use "AI" the most are the ones too lazy to also disclose it. I see slops where the PR description itself was generated by AI to the point that I am not even sure if the human even bothered reading it first. While those are obvious, it also shows how human can easily ignore this request. As a result, we would end up penalizing the honest ones. So, I am hesitant on this, but curious what others think.

@bsipocz

bsipocz commented Feb 27, 2026

Copy link
Copy Markdown
Member

@pllim - I don't see a problem. Disclosing doesn't mean rejection, but non-disclosing would just make it easier to auto reject the slop.

@neutrinoceros

neutrinoceros commented Feb 27, 2026 •

Copy link
Copy Markdown
Contributor

I agree with Brigitta. The point of disclosure isn't to penalize honesty, but to reduce our need for suspicion. And yes, asking for it also makes it dishonest not to comply, which facilitates rejection in the cases we need it.

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

I don't think it's just about the user community, but about the whole community. And also it's not about our understanding the comments/documentations but to have a preferred style we use/adhere to.

Comment thread policies/ai-policy.md Outdated
Comment thread policies/ai-policy.md Outdated

@mhvk mhvk left a comment

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.

@ceb8 - thanks for the iteration! I think with @bsipocz's addition, this is pretty good.

That said, in the (not yet completed) discussion about a numpy variant of this, we are tending to simply adopt an AI policy, I do wonder whether that is not the better path for astropy too. It has the advantage of moving towards a state where the AI policies across the scientific python ecosystem align.

In particular, I find the scipy AI policy a rather nice one. It is short and concise, yet well organized, and it has a few things that the current text does not have (at least not explicitly):

  1. It asks to disclose the use of AI.
  2. It discusses "AI slop" and explicitly asks not to waste maintainer time.
  3. It discussed copyright explicitly.
  4. It explicitly forbids using AI agents.

Anyway, I am OK with going with this policy, but prefer simply adopting the scipy one.

Comment thread policies/ai-policy.md
Astropy maintainers welcome contributions, including those developed with the assistance of generative AI tools. However, the use of such tools does not change our expectations for contributor responsibility, engagement, or code quality. The following apply to all contributions.

1. Human ownership and accountability
1. Contributors are responsible for all submitted content, regardless of whether generative AI tools were used.

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.

Having re-read the text and the above discussion, I think I agree with @eteq that given the present text, we should keep this as is -- there already is an expectation that copyright should not be violated. So, happy with no change here.

That said, I'd still be in favour of just adopting an already written policy -- see main comment.

@neutrinoceros

Copy link
Copy Markdown
Contributor

Quick update from the telecon: we (@astrofrog, @taldcroft and I) discussed adopting Scipy's policy and agreed it looked good as is, and that we should do same thing as they did, that is, copy the policy instead of linking to it, so we don't silently endorse any upstream change, and are free to amend it if need be.

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

Community input seems to be addressed properly. Looks good on my end.

@ceb8

ceb8 commented Mar 5, 2026

Copy link
Copy Markdown
Member Author

The CoCo has decided to proceed with the current document rather than adopting that of Scipy, because we wanted to start with something simpler and then reassess once we see how it functions. To this end we will discuss the policy, and how we do or do not want to change it, including whether we want to adopt another project's policy, at the coordination meeting.

Thanks so much everyone who gave feedback!

@ceb8
ceb8 merged commit 999db4f into astropy:main Mar 5, 2026
@pllim

pllim commented Mar 6, 2026

Copy link
Copy Markdown
Member

Thanks, all!

Also, do you notice all the non-astropy repos linking to this? 👀

@zacharyburnett

Copy link
Copy Markdown
Contributor

there's this in-development github action that purports to compare pull requests against a set of metrics (number of emojis, description length, number of code changes, etc.) and give reviewers a score of how much the PR smells like AI; that probably won't catch all of the AI slop PRs, but it might make it easier for / reduce the cognitive load on reviewers and maintainers when looking at PRs

https://github.com/peakoss/anti-slop

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Policy against AI-generated pull requests