r/github • u/IndividualAir3353 • May 15 '26
Discussion What's to stop me from just stealing open source code, rewriting it with AI and calling it my own?
Do any of the FOSS licenses address this (sounds like patent infringment maybe). Just curious what the implications are.
0
Upvotes
8
u/davy_jones_locket May 15 '26 edited May 15 '26
You will be sued.
Hope this helps!
Edit: there are multiple open source licenses
Copyleft licenses (GPL, AGPL, LGPL) require that derivative works also be open-sourced. The key legal question is whether an AI rewrite counts as a "derivative work." This means you will be sued and have to go to court for this to be settled.
Permissive licenses (MIT, Apache, BSD) basically let you do whatever you want as long as you include attribution. If you strip that and AI-rewrite it, you're skirting the attribution requirement. This also results in a lawsuit.
No license means full copyright applies. The code is not free to use at all, AI rewrite or not. Lawsuit.
Copyright still applies to the expression, not just the text. Courts have found infringement based on structural similarity, not just line-by-line copying (the Oracle v. Google saga touched on this). A sufficiently faithful AI rewrite of a creative/original codebase could still be a derivative work.
When we talk about a clean room scenario, and you fed the original code into an AI to generate the rewrite, you've created a paper trail showing the rewrite was derived from it. Legitimate clean-room reimplementations (like how Microsoft reimplemented Java APIs) require strict separation where one team studies the original, and a different team writes new code from spec only.
This still goes to court many times to settle whether it actually clean roomed.
Tl;Dr expect a lawsuit.
2
u/eggplantpot May 15 '26
I mean you can use MIT Licensed code and sell it as long as you give proper credits somewhere. Not sure about the other open source licenses.
Normally it's hidden somewhere and not on the landing page or something. Here's Apple for example, Adobe, META.
So I guess yes if you don't attribute it, it can be considered as stealing, but there's no point on doing so when all it takes to use it freely is just adding some static page with the credits.
3
u/ShowTop1165 May 15 '26
Legally, what you’re thinking of (rewriting a library to not contain any of the original code but have the same functionality) is called a clean-room rewrite so I’d do some research there to start off.
Using AI to do so would not constitute that, because you have source access and there’s also no guarantee the AI model wasn’t trained on that open source library to begin with.
Edit: Definitely not legal advice, just my two cents on the topic.
1
u/deadbeef_enc0de May 15 '26
The same thing that taking a compiled binary, have AI figure out what the code should be, have it change that code, and calling it your own
That would be copyright, mind you if discovery can provide evidence of what happened (ie they used a cloud model and you got the logs of the conversations) you could still make a case
0
u/[deleted] May 15 '26
[deleted] — view deleted comment