This question was somewhat inspired by this Meta SO question

I found this other question... but that is more general.

When someone uses GitHub Copilot does the person that is using the tool own the rights to the code generated by it?

GitHub claims yes:

Who owns the code GitHub Copilot helps me write?

GitHub Copilot is a tool, like a compiler or a pen. The suggestions GitHub Copilot generates, and the code you write with its help, belong to you, and you are responsible for it. We recommend that you carefully test, review, and vet the code, as you would with any code you write yourself.

But, people have shown that GitHub Copilot can write code that is very much not original*. In this example, it was the Q_rsqrt from Quake Arena, with comments, profanity and all (here is the original function from the source code, for comparison). So... despite that GitHub claims that you own the rights to the written code, that example makes me think that maybe GitHub's statement isn't true. In that example, IANAL, but I do not think you would own that code.

A general answer is fine, but I'm specifically interested in the United States.

Who owns the rights to the code that GitHub Copilot produces? Does this change if the code produced was taken verbatim from an existing codebase, as was the case for Q_rsqrt?

*I'm aware that GitHub added Q_rsqrt to the list of banned words, but I would be very surprised if other examples of this didn't exist

  • 3
    Another very interesting aspect other than the ownership is the licensing. If the original code had a copyleft license, is it possible to produce closed source code out of it? Or otherwise change the license to something incompatible?
    – VLAZ
    Commented Nov 1, 2021 at 9:12

1 Answer 1


You Own The Code

To answer your question on whether or not it is copyright infringement:

Yes, you do own the rights to the written code but posting it on Github gives Github the

right to store, archive, parse, and display Your Content, and make incidental copies, as necessary to provide the Service, including improving the Service over time. This license includes the right to do things like copy it to our database and make backups; show it to you and other users; parse it into a search index or otherwise analyze it on our servers; share it with other users; and perform it.

To simply put it, no matter what license you use, you give GitHub the right to host your code and to use your code to improve their products and features.

This license does not grant GitHub the right to sell Your Content. It also does not grant GitHub the right to otherwise distribute or use Your Content outside of our provision of the Service, except that as part of the right to archive your Content.

So with respect to code that’s already on GitHub, I think the answer to the question of copyright infringement is fairly straightforward.

Things aren’t quite as clear-cut in a scenario where Copilot is trained on code that is hosted outside of GitHub. In that situation, the copyright infringement question would hinge largely on the concept of fair use. If Copilot is being trained on code outside of GitHub, we accept that at least some of what they’re looking at is copyrightable work. So, the question then becomes if it’s fair use. Now, you ultimately can’t conclude definitively that something is fair use until you go to court and a judge agrees with your assessment. But I think there’s a strong case to be made that Copilot’s use of code is very transformative, a point which would favor the fair use argument.

There is precedent for this sort of situation. Take the case of Google Books, for example. Google scanned millions of books, provided people who were doing research with the ability to search the book, and provided the user a small snippet of the text that the user was searching for in the book itself. The court did in fact find that was fair use. The use was very transformative. It allowed people to search millions of books. It didn’t substitute for the book itself. It didn’t really take away anything from the copyright holders; in fact, it made it easier for readers to access the work and actually opened a broader market for book authors. And, it was a huge value add on top of the copyrighted corpus.

In the latter scenario, a lot depends on the thoroughness and the length of Copilot’s suggestions. The more complex and lengthy the suggestion, the more likely it has some sort of copyrightable expression. If a suggestion is short enough, the fact that it repeats something in someone else’s code may not make it copyrightable expression.

There’s also the question of whether what’s being produced is actually a copy of what’s in the corpus. That’s a little unclear right now. GitHub reports that Copilot is mostly producing brand-new material, only regurgitating copies of learned code 0.1% of the time. But, we have seen certain examples online of the suggestions and those suggestions include fairly large amounts of code and code that clearly is being copied because it even includes comments from the original source code.

  • 2
    "we have seen certain examples online of the suggestions and those suggestions include fairly large amounts of code and code that clearly is being copied because it even includes comments from the original source code." and in that case then what happens? I'd think it would be reasonable to claim original copyright would still stand and "you own the code" is a dubious claim, even if copilot site claims otherwise.
    – eis
    Commented Jun 19, 2022 at 9:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .