Skip to content

Add guideline about crediting tools as authors #1950

Open

Description

@merwok

Describe the enhancement or feature you would like

We now have many commits created with so-called AI tools. Many of them default to adding their name in a co-authored-by line in the commit message, which can end up in the upstream repo commit message if the person merging does not clean up the text box (this is a GitHub issue of defaulting to concatenating all commit messages, but can be changed per-repo to take the PR description).

There is an issue with considering this bots as authors. If a program is an author, is its output copyrightable? Does it infringe on the licenses of projects ingested in the training data? Do the bots need to sign a contributor agreement?

I don’t know why these tools do that; maybe it’s just for marketing (as the authors are visible in all pages with lists of commits), and maybe people keep it in good faith in order to disclose tool usage.

I think these lines should not be present, as they have risky implications or are just dubious free publicity.

Thanks for considering!

Describe alternatives you have considered

No response

Additional context

No response

Activity

  1. added
    type-feature
    on Oct 28, 2026
  2. merwok commented on Oct 28, 2026

    @merwok
    MemberAuthor

    Adding some people involved in other policies PR: @hugovk @willingc @Mariatta @nedbat @savannahostrowski @StanFromIreland

  3. willingc commented on Oct 28, 2026

    @willingc
    Collaborator

    Thanks for raising the issue @merwok. Copyright and AI-generated code are still (and likely will be for the near future) a grey area in U.S. Law. I've seen pros and cons to co-author statements in other projects. Personally, I think legal counsel should weigh in on Python's interests and recommend a reasonable approach.

  4. Mariatta commented on Oct 28, 2026

    @Mariatta
    Member

    Personally I have local agents instructions to exclude those trailers as part of the coding/pr creation skill. I wonder if we could add to the agents.md file to never add those commit attribution.
    Not a lawyer so I won't comment about copyright or legality issues.

  5. nedbat commented on Oct 28, 2026

    @nedbat
    Member

    I think these lines should not be present, as they have risky implications

    I guess the risk you mean is the copyright and authorship issue? I don't see how removing the line removes the risk. If the code was written by an LLM, it still was even if the message is gone. In the spirit of transparency, wouldn't it be better to keep the line?

    I know some people don't like them because they are free publicity, but a footer line in a git commit message is hardly "publicity". You have to work pretty hard to find them.

  6. hugovk commented on Oct 28, 2026

    @hugovk
    Member

    The presence or absence of Co-authored-by trailers doesn't make any difference as far as the CLA goes.

    The CLA bot ignores trailers, and ensures that the Git author of each commit has signed the CLA for that email.

    See also @gpshead's reply at
    https://discuss.python.org/t/cla-bot-and-ai-agents/106635/8.

  7. vgnaik2004 commented on Nov 1, 2026

    @vgnaik2004
  8. merwok commented on Nov 2, 2026

    @merwok
    MemberAuthor

    The consensus seems to be that things are fine as is.

    I don’t like the in-between position. Either people believe these chatbots really understand things and really author code, in which case we should hold off until copyright issues are settled. Or they are just text generators with wiring automation and like any other tools shouldn’t be noted as co-authors.

  9. nedbat commented on Nov 2, 2026

    @nedbat
    Member

    I don’t like the in-between position.

    I don't know which position is the in-between position.

    Either people believe these chatbots really understand things and really author code, in which case we should hold off until copyright issues are settled.

    No one can define "understand", so I wouldn't gate anything on agreement about that. And "we should hold off": on using AI tools? That doesn't seem like a possibility at this point.

    Or they are just text generators with wiring automation and like any other tools shouldn’t be noted as co-authors.

    At the very least, the polarizing and strong opinions about AI tooling separate them from other tools like text editors.

  10. Mariatta commented on Nov 2, 2026

    @Mariatta
    Member

    To me llm-generated PRs are not any different than the PRs made by miss-islington and dependabots. In those PRs they already carry commit attribution to the bots. Now everyone could have their own bots/llm agents if they want to.
    Asking contributors to remove the llms attribution is fine to me if the "advertisment" is the part you're concerned with. But just because there is no llm attribution, doesn't mean that llm wasn't used.

  11. willingc commented on Nov 3, 2026

    @willingc
    Collaborator

    The consensus seems to be that things are fine as is.

    I think it makes sense for the SC/PSF to have legal counsel weigh in on "Co-authored."

    I don’t like the in-between position.

    Sadly, the industry has overused anthropomorphism and personification of these tools. It is also unfortunate that attribution wasn't given more thought prior to training these models.

    Personally, I view the tools as tools. People will use them or not, as they see fit. I think the best we can do today is to review PRs thoughtfully, independent of the creation process.

  12. encukou commented on Nov 3, 2026

    @encukou
    Member

    Is attributing backports to miss-islington a feature?
    To me it seems that we don't want to give a bot the rights to push changes to a contributor's fork and open PRs as them, so the bot has its own account, but that comes with the downside of putting the real authors in Co-Authored-By.
    We also don't attribute anything to github.com, even though that's what generates every squash commit.

  13. gpshead commented on Nov 4, 2026

    @gpshead
    Member

    Yes attributing miss-islington is a feature. It says that it was probably blindly automated as a git cherrypick.

    Requiring people to comply with specific formats of commit messages is adding friction to development for a bureaucratic purpose.

    Ex: All of us on the core team are already supposed to manually edit # references into GH- references and we're supposed to craft some ideal squash merge commit message. we really should not have to do any of this toil. github could automate it. but they don't. so the best we can do is either suffer manual the clickops and text box editing or instruct our Claude or otherwise how to do merges of PRs for us to save us the pain. while we could adopt the configuration of "the PR description becomes the message" - even that is often not right as PR descriptions have a different purpose of communication and would then also need editing/rewriting. you'll also see models including attribution in PR descriptions at times. those are even more free-form than what is typically seen in commit messages.

    Our https://devguide.python.org/getting-started/ai-tools/ already covers that AI disclosure is welcome but not required.

    IMNSHO co-authored-by's are not worth worrying about. There is no risk in including them. When they do represent actual people, excluding them can cause unintended harm by appearing to remove credit. I don't even like that I get included in one sometimes when all I did was make a trivial typo fix on someones PR or merge main via the github UI to get around flaky CI. But it's even less worth the time trying to perfect this.

    I intentionally left Claude attribution in my commit messages for a while throughout 2025 to help normalize that it was okay to use AI in public for OSS work. These days, while i haven't meaningfully used an editor for my coding in over a year, I tend to configure my cpython one to leave the Claude line out just to reduce clutter. But if I'm working on landing someone else's PR and the author left an AI co-authored-by line in, I find that useful signal just as much as optional disclosures in PR descriptions and I will often leave one of those in the squash merge commit message when manually editing to respect the PR authors choice.

    I understand the feeling that they are advertising. It probably was initially, in part due to github's sad choice to gamify account activity. At this point I think that ship has sailed and most of the world is already aware of them; the remaining utility is now that iff you believe you can trust the PR author (copycat distilled models often lie), it can indicate the capability level of the model + harness the contributor used. That reputation can be one more signal to shape how you approach a review and how you want to communicate back about issues.

    (if you want project specific legal advice, follow others suggestions: you can't get that here)

  14. encukou commented on Nov 4, 2026

    @encukou
    Member

    Yes attributing miss-islington is a feature. It says that it was probably blindly automated as a git cherrypick.

    Oh, I agree that it's good to have that signal. My point is that the main author field isn't the ideal place for it.

    If I trust the author (to submit code that they understand and are responsible for), I don't care what tools they used. I'm communicating with the human, not their harness.


    An for tools in general, no, I wouldn't add Co-Authored-By: Emacs for code completion or autoindent or copy&paste, even if it happens that most of the bytes in a PR don't actually come directly from my keyboard. And if I saw that message, it would mostly tell me what the author thinks about vim users.

  15. merwok commented on Nov 18, 2026

    @merwok
    MemberAuthor

    Mariatta:

    To me llm-generated PRs are not any different than the PRs made by miss-islington and dependabots. In those PRs they already carry commit attribution to the bots.

    To me there is still an important difference between regular programming (code you can understand, that implements an algorithm that can be studied) and output from maching learning (opaque internal paths, plausible but untrustable output).

    Asking contributors to remove the llms attribution is fine to me if the "advertisment" is the part you're concerned with

    It is only part of it, but I would close this ticket with a degree of satisfaction if this guideline was added.


    Pior:

    Oh, I agree that it's good to have that signal. My point is that the main author field isn't the ideal place for it.

    Agreed!


    Finally, this doc from Twisted matches my opinion on the matter and explains it better than I did here: https://docs.twisted.org/en/stable/development/ai-policy.html (first two sections have the gist: rationale and enforcement)

  16. Praveenredm commented on Nov 24, 2026

    @Praveenredm
  17. Mariatta commented on Nov 24, 2026

    @Mariatta
    Member

    I opened the PRs with wordings about the "AI agent's co-authored-by trailer".

  18. hugovk commented on Nov 24, 2026

    @hugovk
    Member

    I'm not sure there's consensus to ban them? But if we do, let's ban it properly via lint+CI.

  19. Mariatta commented on Nov 24, 2026

    @Mariatta
    Member

    I thought I start with just "guidance" which allows for flexibility, as opposed to strictly forbidding via lint+CI.

  20. gpshead commented on Nov 24, 2026

    @gpshead
    Member

    We use squash merge. there's no point in telling people what belongs in commit messages within their PR branch.

  21. merwok commented on Nov 24, 2026

    @merwok
    MemberAuthor

    Merge message often concatenate commit messages: e4e90eb

  22. gpshead commented on Nov 24, 2026

    @gpshead
    Member

    Please don't make everyone working on a PR suffer useless hurdles to jump though that squash merge automation should be used to solve.

    I don't think we even need to forbid co-authored-by values that someone doesn't like. I see no consensus here, this is a change made without reason - it is trying to encode an opinion. Not improve the codebase.

  23. willingc commented on Nov 25, 2026

    @willingc
    Collaborator

    I think that there are several issues embedded in this discussion:

    1. Who is responsible for authoring a PR
    2. Do we want to know if an AI tool is used
    3. Do we want to personify an AI tool? "Co-authored with <insert ai tool/model>" would better than "Co-authored by "
    4. How do we build consensus and a policy around AI tools? Personally, I think an author should be able to use the tool; yet, I believe that the person not the AI tool is responsible for authoring a pull request.
    5. How are the triage of issues and review of PRs impacted by personifying an AI tool?

    These questions require consideration beyond this issue and related PRs.

    Overall, I agree with @hugovk that using tooling to lint and enforce style and with @Mariatta that being flexible until there is consensus about an AI tool policy.

    My current recommendation would be to move away from personifying a tool/model and to be more explicit that humans author PRs and bear the responsibility of the PR's code.

  24. added
    needs: decision
    on Nov 25, 2026
  25. gpshead commented on Nov 27, 2026

    @gpshead
    Member

    "Co-authored by:" was never intended to personify. It's a GitHub default behavior. Nobody objected to that term when we moved to GitHub and had automatons like Bedevere and Miss Islington making commits. So... why now? We've never assigned any actual meaning to this free form text quasi header in commit messages in the past. It is just github's defacto convention for unverified account-linking.

    History of commit messages suffix "headers"

    other quasi-header text forms that have been popular in various communities for the past 20 years include "signed-off-by", "reviewed-by", "acked-by", "tested-by", "suggested-by" (all Linux kernel dev origins IIUC). "co-authored-by" originated later, possibly within openstack, with the Linux kernel choosing "co-developed-by" a few years later instead. In 2018 GitHub adopted "co-authored-by:" support and started linking to accounts associated with any email address (unverified addresses included); gitlab did similar.

    git itself in 2.32 added support for a --trailer flag to add text to the end of commit messages which can be used to automate adding any such markers without specifying a format or codifying names. I think vscode and jetbrains IDEs also support "co-authored-by" in some way.

    Fast forward to the 2025+ and some projects have proposed "generated-by" or "assisted-by" as their preferred headers when they have an individual project policy need to reserve a header for supposed people only (remember: there is zero authentication and identity in free form text). I'd consider "co-authored-with" to basically be an equivalent. I personally fail to see a difference between "by" and "with" as I don't find the word "by" to imply "human" or "with" to imply it any less so.

    cpython specifics

    CPython has never had our CLA apply to "co-authored-by:" or made any presumption about the contents of such headers. We should not make any change to ascribe such compliance meaning without official PSF-legal advice. Asking people to use a different trailing header name for agentic attribution is okay; that is separate from attaching a new meaning to co-authored-by.

    We should not do things because of FUD (fear, uncertainty, and doubt) or other personal opinions. We're not a political project. We've rejected changes in the past that were motivated by individual political leanings (ex: requests to change our license).

    Implementation, if we adopt such advice

    re: CI checks on commit messages - we may lack a proper place to put these. Ideal would be pre-squash-merge on the squash merged commit message itself since that seems to be the primary objection ("what winds up in cpython repo commit history"). GitHub doesn't really offer a way to do this that is fits any of our workflows IIUC.

    Doing CI checks sooner such as pre-push is workable (that can check commit messages), but it can hamper PR developer experience. We shouldn't care about the individual branch commit messages. At least for people who have yet to adopt a fully agentic workflow where arbitrary rule compliance makework gets automatically handled without wasting human attention.

    Why I find pre-push the wrong place: I find it actually useful to retain indicators in commit messages within a PR branch because that lets me see which things I used what for when I have a long series of commits working on something. A pre-push hook would effectively cause those to be left out without jumping through hoops. When reviewing PRs I like seeing what other people claim to have used (specifically the model version) in their local branch commit messages. I would never require this of them, but it can be helpful to set my reviewer context for what to expect when present.

    I believe that the person not the AI tool is responsible for authoring a pull request.

    Responsible, yes, always have been. But that doesn't mean that people are the ones that directly do the mechanical aspects.

  26. nedbat commented on Nov 29, 2026

    @nedbat
    Member

    My feeling is that especially while AI authoring remains controversial, we are better off being transparent about AI use (keep the footers). It's true we expect humans to own the code, but no one will be confused that "Co-authored-by: Claude" means that Claude is a human. We can see who the human is.

    As Greg points out, the footers carry no legal weight, and every commit has a human as the primary author.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs: decisiontype-feature

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions