News for hackers. Stuff that matters.
Re:Copilot sells code other people wrote by zarzavat on Thursday June 23, 2022 @07:18AM (#31847504)
The entire point of a fair use right is that you don’t need the copyright owner’s permission to be able to exercise it. Fair use allows you to do things that the copyright owner doesn’t like.

Is fair use on a massive scale still fair use? Courts generally think so, otherwise Google would have been out of business a long time ago.

Re:Copilot sells code other people wrote by meheleventyone on Thursday June 23, 2022 @07:20AM (#31847521)
Is this fair use? I don't think that's been established yet. And if it is why didn't MS and OpenAI train it on their private code repositories? Fair use for thee not for me isn't very in keeping with the spirit of that claim.
Re:Copilot sells code other people wrote by komadori on Thursday June 23, 2022 @08:17AM (#31847984)
Gosh, can you imagine if they had trained it on their internal source code repositories and it constantly suggested using Hungarian notation for your variables? ;-)
Re:Copilot sells code other people wrote by jimnotgym on Thursday June 23, 2022 @07:53AM (#31847775)
I sometimes read people's open source code on github and use the ideas from that to develop my own ideas. In fact sometimes I copy and paste short passages and then rework them. I also employ a team of people who may do the same. Is that fair use, yes of course it is. Is co-pilot automating that fair use, I would say so.
Re:Copilot sells code other people wrote by nirvdrum on Thursday June 23, 2022 @08:38AM (#31848171)
Many people would claim what you're doing is a derivative work. I'm not sure the "of course it is" is very clear-cut (at least in the US). I've worked at big companies that have lawyers that care very much about this topic and what you're describing is prohibited. But, maybe it's different if you're not distributing your source.
Re:Copilot sells code other people wrote by zarzavat on Thursday June 23, 2022 @02:10PM (#31853000)
> I've worked at big companies that have lawyers that care very much about this topic and what you're describing is prohibited.

They are doing this to make sure that any lawsuit can be easily dismissed. It has nothing to do with the legality of the action (which sounds like fair use as the parent described it), and everything to do with the expense of a potential lawsuit compared to the cost effectiveness of simply telling developers “don’t do that”.

Most people think that the law has two shades: lawful vs unlawful. But the more practical distinction is expensive lawsuit vs dismissed lawsuit. This is the lens through which corporate lawyers see copyright and it might explain why so many programmers think that copilot is “obviously” breaking the law and “stealing” their code.

Re:Copilot sells code other people wrote by nirvdrum on Thursday June 23, 2022 @03:05PM (#31853767)
If the usage was very clearly fair use, there'd be no need to be defensive about it; the case could be dismissed trivially. In reality, the question would need to be sorted out in court.

Questions of derivative works and fair use come up fairly frequently even in the open source world. This isn't solely a question of corporate lawyer posturing. I don't know any copyleft authors that would be okay with someone copying & pasting their code, making trivial changes, and saying it isn't a derivative work. Of course, their understanding of the law may be flawed. You'll get to find out in court.

You're right. A lot of this boils down to how much you want to spend in court proving your usage is just under fair use. We've moved beyond the question of ethics if you're intentionally violating a project's source license and relying on fair use to do whatever you want with the code. If you want to poke someone with a stick, you can't be surprised when they hit back. I contend what the OP described isn't clearly fair use (note I'm not saying that it clearly isn't fair use either). It ultimately doesn't impact me because I'm just not going to copy & paste code from projects without attribution and following the license, but I'd be worried about anyone reading that comment as objectively true.

Re:Copilot sells code other people wrote by grayfaced on Thursday June 23, 2022 @09:03AM (#31848477)
Or alternately, "I sometimes listen to other people's songs and use those ideas to develop my own. In fact sometimes I copy and paste short melodies and then rework them."

Courts have held that it doesn't apply to music, why do you think different rules apply to code?

Re:Copilot sells code other people wrote by zarzavat on Thursday June 23, 2022 @11:36PM (#31857520)
Courts are definitely aware of the need to protect the creative process and that no song is truly “original” in all aspects. e.g. the Katy Perry case[0]

Songs are different from code, in that the “hook” that makes the money may be only a few seconds long. There are many creative choices that a songwriter/producer can fit into just a few seconds: the harmony, melody, rhythm, lyrics, timbre, effects, ...

Whereas for code, the space of creativity is limited by functional considerations. A creative choice is protected by copyright but not all choices that programmers make are creative. Often the choices are limited by the API/interface or by efficiency considerations and it turns out that there’s only one good way to do something.

A function may be very intricate, yes, while still containing almost no creative value (e.g. a Vulkan setup function). Music doesn’t have an equivalent to this - the placement of every note is a creative act.

[0] https://en.m.wikipedia.org/wiki/Gray_v._Perry

Re:Copilot sells code other people wrote by aahortwwy on Thursday June 23, 2022 @08:31AM (#31848114)
Microsoft's internal policies don't allow their employees to do this without legal approval.
Re:Copilot sells code other people wrote by aaaaaaaaata on Thursday June 23, 2022 @08:35AM (#31848146)
So they don't ask.
Re:Copilot sells code other people wrote by leereeves on Thursday June 23, 2022 @10:00AM (#31849242)
I think aahortwwy's point was that Microsoft won't permit their own employees to do what Copilot does.
Re:Copilot sells code other people wrote by zzo38computer on Thursday June 23, 2022 @05:47PM (#31855556)
> I sometimes read people's open source code on github and use the ideas from that to develop my own ideas.

Yes, I too, and probably many people will do.

> In fact sometimes I copy and paste short passages and then rework them.

This I usually don't unless I check the license first. (Everybody ought to be allowed, but sometimes the license might not be.)

Re:Copilot sells code other people wrote by jcelerier on Thursday June 23, 2022 @08:59AM (#31848422)
What you are doing is very certainly illegal
Re:Copilot sells code other people wrote by MaxBarraclough on Tuesday June 28, 2022 @02:52PM (#31911543)
You're unconvinced it would qualify as fair use?

It reminds me of the Google vs Oracle case. Apparently a court found that copying even a small amount of code in breach of its licence is not permitted. [0]

[0] https://en.wikipedia.org/wiki/Google_LLC_v._Oracle_America,_.... (ctrl-f for de minimis)

Re:Copilot sells code other people wrote by matharmin on Thursday June 23, 2022 @07:57AM (#31847800)
For public repositories, whether copying small parts of code is considered fair use is just a copyright question.

On the other hand, if you copy from private repositories, it quickly gets into the territory of stealing trade secrets.

Re:Copilot sells code other people wrote by jimnotgym on Thursday June 23, 2022 @07:49AM (#31847738)
Just because there has not been a test case yet does not make it illegal! If MS think it is fair use then they are free to go ahead. Business is all about recognising and assesing risks like this.
Re:Copilot sells code other people wrote by tremon on Thursday June 23, 2022 @08:16AM (#31847974)
And even if there had been a legal test case, that does not make it moral! If people think this is socially wrong then they're free to argue their case. Business is all about ignoring ethical quandaries if it gives them an edge.

"Microsoft does it, therefore it must be right" does not a sound argument make.

Re:Copilot sells code other people wrote by aaaaaaaaata on Thursday June 23, 2022 @08:36AM (#31848157)
> Business is all about ignoring ethical quandaries

No, businesses are — not business. Not necessarily...

Re:Copilot sells code other people wrote by jrumbut on Thursday June 23, 2022 @07:45AM (#31847711)
I don't think releasing a commercial product that copies people's code without complying with the license is anywhere near fair use.

Also, the open source community has far less leverage to apply pressure to Google than it does to GitHub. We may be able to do something about this.

Re:Copilot sells code other people wrote by CrazyStat on Thursday June 23, 2022 @08:04AM (#31847869)
> I don't think releasing a commercial product that copies people's code without complying with the license is anywhere near fair use.

The whole point of fair use is that the license doesn't matter. You can have a license that says I'm not allowed to use what you wrote for any purpose ever and I can still use it under fair use.

Re:Copilot sells code other people wrote by jrumbut on Thursday June 23, 2022 @08:17AM (#31847987)
Yes but among the four factors that are used to evaluate fair use claims are whether it is being used commercially (it is) and how it affects the market for the thing that was copied (it clearly would since one way code is used is being imported by other code, if Copilot didn't insert my code into the new app, they might very well use my open source project that provides the same code).
Re:Copilot sells code other people wrote by CrazyStat on Thursday June 23, 2022 @10:30AM (#31849611)
I wasn't staking a position on whether Copilot is fair use, just pointing out that fair use doesn't care about license.

That said, copilot itself is not a replacement for your open source project that it was trained on. The code it generates may or may not be, but that's probably not Github's problem as far as copyright law is concerned.

Re:Copilot sells code other people wrote by Longlius on Thursday June 23, 2022 @09:43AM (#31849009)
IANAL but fair use is primarily about the public interest. What public interest is served by allowing proprietary software vendors to copy GPL code that's reserved for the commons?

I don't really think this argument passes muster.

Re:Copilot sells code other people wrote by pmarreck on Thursday June 23, 2022 @08:33AM (#31848129)
> I don't think releasing a commercial product that copies people's code without complying with the license is anywhere near fair use.

It's just automating the copying and pasting (and slight reworking) of boilerplate code that would normally take me much longer to do, especially when I am working with a language I'm less familiar with but is necessary for my stack. I've literally never seen it suggest code that is more or less almost exactly what I would have come up with given a lot more time. In essence, it eliminates tedium- exactly the point of all of programming: Work elimination.

Re:Copilot sells code other people wrote by RHSeeger on Thursday June 23, 2022 @08:53AM (#31848361)
It seems fairly similar, at least to me, to a search engine copying snippets of other people's web sites and displaying them on a page. Admittedly, there's still some discussion as to whether or not _that_ is fair use, but I think enough of the population think it is (with many news organizations disagreeing).
Re:Copilot sells code other people wrote by izacus on Thursday June 23, 2022 @08:42AM (#31848222)
Unless Copilot is "commenting" or "parodying" the code you've wrote, it's not fair use. Copying and using the code in another project sure as heck IS NOT fair use.
Re:Copilot sells code other people wrote by bayindirh on Thursday June 23, 2022 @09:33AM (#31848881)
An automated system will devour all my code, which is under a case-tested copyleft license, and regenerate its parts in any place, without respecting the license terms, and call it "fair use".

I have two questions:

1. Why have licenses, then?

2. What if I just use leaked sources of closed source software and call it fair use?

Re:Copilot sells code other people wrote by zarzavat on Friday June 24, 2022 @12:18AM (#31857763)
1. Why have licenses, then?

The default under copyright law is that any substantial copy is infringement.

A license is a legal document that grants someone permission to use a work that they otherwise would not have had.

However the law also gives its own permissions to use a work - it defines what is unlawful infringement and what is lawful fair use.

The code snippets that copilot generates look more like fair use than infringement. They are small, adapted to the destination context, and usually not direct copies of one source but more of an average of many different sources. And usually the programmer does not keep the suggestion that copilot suggests unmodified - the programmer does their own editing of the snippet afterwards to further tune it to the surrounding context.

2. What if I just use leaked sources of closed source software and call it fair use?

As pointed out upthread, if it the source code is leaked then there may be trade secret protections. The GPL specifically allows the code to be posted online, so by design it is not secret.

Re:Copilot sells code other people wrote by bayindirh on Friday June 24, 2022 @01:49AM (#31858210)
> As pointed out upthread, if it the source code is leaked then there may be trade secret protections. The GPL specifically allows the code to be posted online, so by design it is not secret.

The reverse maybe true. I may be GPL'ing a code to prevent a useful algorithm from being buried deep inside a commercial code with an incompatible license. What makes it a "trade secret" level code? I have a 25 line algorithm which is worthy of its own paper. What if I open its reference implementation with AGPLv3+?

I have no problems with you reading the paper, and implementing it. I don't obfuscate my papers, but I put the implementation out with AGPLv3+. You can't use that in a codebase with an incompatible license. I expect and want you respect the license of my implementation.

> The code snippets that copilot generates look more like fair use than infringement. They are small, adapted to the destination context, and usually not direct copies of one source but more of an average of many different sources. And usually the programmer does not keep the suggestion that copilot suggests unmodified - the programmer does their own editing of the snippet afterwards to further tune it to the surrounding context.

Emphasis mine. First, there's no consensus on fair use, yet. Second they may be direct copies of the code. Third, they're remixed with other code pieces, which makes it a derivative work of many code pieces at once, then lastly, programmer re-derives the derived work. Which is clearly a derivative of GPL code, which brings in GPL license with itself (if what copilot derives the code from GPL licensed repositories, which it does).

I have no problem with Copilot as a technology. I have no problems with other licenses, which are not breached when used by Copilot and derived and used. The point which makes my blood boil is copilot using this GPL corpus, and don't admitting it publicly, breaching the terms of GPL en masse, and outright ignoring it. Then feeding this GPL derived code to any and all projects which pay for a copilot membership, and calling it a day.

Re:Copilot sells code other people wrote by akagusu on Thursday June 23, 2022 @09:07AM (#31848525)
When co-pilot reproduce substantial parts of someone else code without respecting the license terms, it is not fair use,it is just a disguised license abuse.
Re:Copilot sells code other people wrote by kybernetikos on Thursday June 23, 2022 @09:24AM (#31848757)
> otherwise Google would have been out of business a long time ago.

I do think there are ethical questions around whether it's right for google to digitise physical books without the permission of the authors, and keep them on their servers and make money from them without recompensing the authors. That's something an individual would not get away with doing, so it seems wrong that it's OK for google.

Re:Copilot sells code other people wrote by dkersten on Thursday June 23, 2022 @11:22AM (#31850376)
Fair use is quite narrowly defined though. This doesn’t look like fair use to me, especially when its been shown that copilot does, at least sometimes, spit out code that is completely unchanged from the source material, without advising the user of any license requirements (most permissive licenses require at least attribution).

The SCO vs IBM lawsuit was over only a few lines of code, after all.

I cant use a derivative of Mickey Mouse in my product, even if I change his colour and give him a hat, even if these changes were made by an AI. Why would it be different for code? I cab only use Mickey Mouse as fair use if its done for a specific barrow set of proposes (satire, news reporting etc).

Re:Copilot sells code other people wrote by Hamuko on Thursday June 23, 2022 @07:33AM (#31847613)
What about us that are not Americans?
Re:Copilot sells code other people wrote by zarzavat on Thursday June 23, 2022 @08:06AM (#31847883)
Then you need to check the laws in your country. But that is nothing new to copilot. Copyright laws vary significantly from country to country.
Re:Copilot sells code other people wrote by rurban on Thursday June 23, 2022 @09:02AM (#31848468)
Not really. They are mostly the same across countries: https://en.wikipedia.org/wiki/International_copyright_treati...

There are just minor deviances, not relevant to this case, such as how long Disney bullied the countries to protect a work.

Software is usually considered a work. The AI needs to know if has permissions to copy and use the code, and then offer derived work on the proper terms and conditions. copilot doesn't do that. It might copy GPL code into non-GPL code, thus violating the GPL license, thus being an extreme risk.

Re:Copilot sells code other people wrote by tzs on Thursday June 23, 2022 @06:04PM (#31855689)
What are examples of Disney getting countries to extend copyright terms?

In the US there have only been two extensions of copyright terms since Disney came into existence.

The first was in 1976, as part of a major overhaul of US copyright law to update the previous law (from 1909) to take into account the large changes in technology since then, and to make US law work more like the rest of the world to pave the way for the US later joining the Berne Convention. The changes for Berne compatibility included longer terms.

I assume Disney did support this, but only because as far as I can tell it had pretty widespread support. It had enough support that it would have passed even if Disney had adamantly opposed it.

The second was in 1998, and that was specifically a term expansion (as opposed to a term expansion like that of 1976 that was a side effect of harmonizing US law with the rest of the world). Europe had expanded terms a few years earlier, so the 1998 change in the US might have been motivated at least in part by harmonization, but I don't think the differences in terms between the US and the EU would have been enough to get it passed without some major interests pushing for it, so it is probably fair to give Disney a good part of the credit or blame for this one.

Re:Copilot sells code other people wrote by rurban on Friday June 24, 2022 @03:12AM (#31858618)
I was referring to the extension in 1976 from 28 to 50 years, and the subsequent extension in 1998 to 70 years, which everybody agreed upon that both were on Disney's request (hence its name "Micky-Maus-Schutzgesetz"). Other lobbying partners were the George Gershwin heirs and the Movie Industry (Jack Valenti).

Here you see the countries which did not extend it the 2nd time to 70 years. https://en.wikipedia.org/wiki/List_of_countries%27_copyright...

There was of course no widespread support for these extensions, as all its arguments were flawed and not only violated logic but also several constitutions. https://de.wikipedia.org/wiki/Copyright_Term_Extension_Act#G... (the en version is mostly cleaned on these counter arguments)

Re:Copilot sells code other people wrote by lupire on Thursday June 23, 2022 @08:31AM (#31848103)
"on a massive scale" is one of the legal definitions of unfair use.