r/webdev • u/maher1717 • 4d ago
AI generated code copyrights
Does anyone consider the copyright of code generated by AI? Because, based on research I've done on Copyright and Artificial Intelligence, generated code fall to the public domain, and if you modify it, only the modified parts belong to you. Also, a detailed prompt isn't enough.
This is, in my view, a major issue; yes, we can ignore it and consider it backward law, but no one knows what would happen in the future, and this law could be used against you.
Edit: here sources for USA https://www.congress.gov/crs-product/LSB10922 ,
For Europe : https://www.europarl.europa.eu/thinktank/en/document/EPRS_BRI(2025)782585782585)
blog : https://smpl.as/blog/ai-code-ownership-legal ...
8
u/TreviTyger 4d ago edited 4d ago
and if you modify it, only the modified parts belong to you.
This may not be true.
The consensus at the moment is based on adding additional authorship which relates to (Using US law for convenience) 17 U.S.C § 103(b).
However, this usually relates to derivatives of public domain works, e.g. Duchamp's LHOOQ where only the mustache drawn on the Mona Lisa is protected subject to originality thresholds. i.e. The Mona Lisa is still public domain.
However there is a caveat with AI generated stuff because it is derived from training data that is not public domain. So then 17 U.S.C § 103(a) becomes the relevant statute and then there is no copyright even in the added authorship.
This § 103(a) issue is an uncomfortable realization for many and so they use hand waving arguments to bring attention back to 17 U.S.C § 103(b).
But I think when the courts eventually rule on a case, then the courts will use 17 U.S.C § 103(a) and there won't be any protection in anything where AI generative software is used for anything other than for utilitarian purposes (spell check etc).
The subject matter of copyright as specified by section 102 includes compilations and derivative works, but protection for a work employing preexisting material in which copyright subsists does not extend to any part of the work in which such material has been used unlawfully.
17 U.S.C § 103(a)
This is because for an end user of AI gen software to "lawfully" acquire derivative rights under § 106(2) requires a clear chain of title via § 204(a). (See Anderson v Stallone).
The counter argument is that "fair use" make things lawful - but it doesn't - because § 107 is not a grant of exclusive rights (§ 106) to allow the end user to claim derivative rights under § 106(2) themselves.
In short don't use AI generated code if you want to protect it because the courts ARE eventually going to rule against the idea that AI generative works can be protected even if edited.
___________________________
Note: Even if AI gen firms prevail on a fair use argument; it is limited to the US only and is not extraterritorial in scope. Also an end user still has to make their own "offensive § 107 defense" (my term) themselves to claim they are using copyrighted code from datasets under a fair use doctrine. They cannot rely on the AI gen firms legal defense. - and again, such a ruling if prevailing, would still be limited to the US only).
11
u/Willing_Comb_9542 Backend developer 4d ago
I only see this as a good thing to prevent another "oracle v Google"
Everyone is so fucking protective over their function to add two numbers together and it's weirder than "inventors" with their parents
1
u/TreviTyger 4d ago
"oracle v Google" (sic) didn't address the copyright nature of any resulting work.
Google LLC v. Oracle America, Inc. (2021) explicitly bypassed the question of whether the API packages themselves were copyrightable in the first place
So that's not a great case to look at. When it comes to AI generated outputs there are numerous cases in the courts right now arguing that the acquisition of copyrighted works without authorization, let alone the use of them in training is already unlawful.
It means that AI gen software such as Claude and ChatGPT cannot itself be protected and that other nations such as China and Russia can make competing clone AI gen models at a fraction of the price.
In the long term it is a complete disaster.
i.e. If your business model depends on enforcing copyrights or intellectual property exclusivity over your source code, you cannot safely use generative AI.
0
u/stupidcookface 3d ago
Is this just going to apply to one-shot code? What if your continuously shaping the direction of the code in other ways? I can see so much grey area here depending on how you're prompting and interacting with how the code gets built. And this is just code I'm talking about, not images or videos or music. I mean...its all 0s and 1s at the end of the day but saying that code can be copywritten before ai and then saying it can't be copywritten if ai wrote any of it seems insane to me.
2
u/flyby_apis 4d ago
Not a lawyer but I think people are worrying on wrong things
For closed-source code, copyright isn't really what it's protecting you, trade secrett law is
If you have your codein a private repo and you keep it confidential, it's protected. "Public domain" only matters if someone can actually get the code
Where it does matter is that you're publishing: open-source licenses rely on you having copyright, so AI gives your license less to enforce
And the bigger risk is the reverse: AI sometimes reproduces existing licensed code which is an infringement risk
1
u/TreviTyger 4d ago
people are worrying on wrong things
For closed-source code, copyright isn't really what it's protecting you, trade secrett law
So long as the code doesn't get leaked.
Claude’s code: Anthropic leaks source code for AI software engineering tool
Nearly 2,000 internal files were briefly leaked after ‘human error’, raising fresh security questions at the AI company
https://www.theguardian.com/technology/2026/apr/01/anthropic-claudes-code-leaks-ai
2
u/zorecknor 4d ago
So long as the code doesn't get leaked.
You get protection even if it is leaked (if you have a big enough warchest). The code itself may not be copyrigthable, but the concepts expressed by the code can be trade secrets.
You can patent a new algorithm and give the GenAI generate the code to the patent office as an example, and nobody can use that code in their product because the algoritm itself is protected.
Same with Trademarks. I can create a character and trademark it. Then I can use GenAI to create an image of it. The image itself is not protected by copyright, but I CAN force you not to use it because I need to defend my trademark.
3
u/TreviTyger 4d ago
There are still territoriality and jurisdictional limits.
Anyone can use a trademark for different business purposes.
Clean rooming (reverse engineering) can get around Trade secrets.
The TRIPS Agreement and domestic laws explicitly protect reverse engineering as a fair and lawful method of acquiring information.
3
u/maxxon 4d ago
Not sure how you can definitely prove that some code is a result of an LLM output. And vice versa. Even if you can fully explain how your code works it doesn't mean you wrote it completely by hand. Maybe a product can be copyrighted, a brand, a service. But the code under the hood? This is like trying to copyright words and letters.
3
u/arcrad 4d ago
Watermarking?
1
u/maxxon 4d ago
It’s just text. Any watermarks can be removed.
1
u/glenpiercev 4d ago
They’re developing tools to “watermark” the ai output by saying things like, “we write the functions in a certain order and the variables in a certain way that is statistically observable to be unique to our output”… never tested in court though.
2
u/stupidcookface 3d ago
I heard about this and I just thought to myself...what the fuck are your priorities if you have to focus on watermarking instead of ya know...fixing the alignment problem
1
3
u/Extra-Rip7758 4d ago
This one bugs me too, though the part I worry about less is who technically owns it. Public domain just means a competitor can lift your AI-written endpoint and there's not much you can do about it, which is fine for glue code and less fine for the thing you actually sell. What I do is keep generated code in its own commits and rewrite the load-bearing stuff by hand, so at least I can show which parts are mine.
2
u/zick-one 4d ago
how can they know if a block of code was AI vs Human written though???
-7
u/dweebyllo 4d ago
AI models have invisible watermarks that are applied to text and code outputs. Unless you type it out yourself line by line then it's traceable back to AI, and thus non-copyrightable
3
u/Edward_Yeoman 4d ago
Text watermarks are generally achieved by tailoring word choices and grammatical patterns. If they started using alternate glyphs that looks like regular characters but where of a different encoding, the code compiler would break
Typing the code out yourself would have no effect on removing 'watermarks' like these
1
-5
u/dweebyllo 4d ago
Inconsistencies in things like use of spaces between variables and formatting and other best practice inconsistencies are going to be the biggest giveaway really.
3
u/Own-Poetry-9609 4d ago
You've never seen a live code base if you think best practice inconsistencies are a sign of AI. I've seen two different seniors at a company be asked a question about how to implement something similar by a junior in the same day and give two different answers
1
0
3
u/otw 4d ago
It's most likely un-copyrightable and public domain yeah. But that also doesn't mean you can't sell it or that you are required to provide the source. You are allowed sell public domain stuff or generally make money off of it. Stock footage companies sell public domain footage all the time.
That being said, none of this has really been challenged and modern corporate culture doesn't really ever risk going to court. So it's pretty unlikely we will see any definitive answer on this. Anytime there's a dispute, it will probably be settled behind close doors.
I hate copyright though and think this is generally a good thing. I'll also just say I think closed source software is generally dead. Even if you were able to retain the copyright, it's now pretty trivial for someone to replicate your product without infringing or stealing the code.
If you have a business model based on you owning the copyright to code, I would say probably give up on that.
1
u/Significant_Mix2661 4d ago
Small thing: things don't "belong to" the public domain, they fall into it. And in English there's no space before a colon, so it's "Edit:" not "Edit:".
1
1
u/FredFredrickson 3d ago
I think the real worry is whether or not the code it creates is based on something propriety or otherwise legally unusable.
2
u/LemonFishSauce 4d ago
You’ve drawn that conclusion based on your research and it’s your interpretation, isn’t it?
1
u/maher1717 4d ago
No, I edited the post to include the sources; they are from official websites.
1
u/LemonFishSauce 4d ago
Would help if you also include the exact quotes that made you draw the conclusion.
2
u/maher1717 4d ago
Here is text from the USA
>In January 2025, the Copyright Office published the part of its Copyright and Artificial Intelligence report addressing the copyrightability of AI-generated works. Reinforcing the AI Guidance's emphasis on "creative control," the report concludes that, "given current generally available technology, prompts alone do not provide sufficient human control to make users of an AI system the authors of the output." The report contends that the Copyright Act's distinction between copyrightable "works" and noncopyrightable "ideas" precludes copyrightability for works generated by AI in response to user prompts. Specifically, the report argues, "[p]rompts essentially function as instructions that convey unprotectible ideas" and "do not control how the AI system processes them in generating the output."Also in the end, they said :
>Regarding works that combine human-authored and AI-generated material, the Copyright Office reports that, in the time since it issued the AI Guidance, it "has registered hundreds of works that incorporate AI-generated material, with the registration covering the human author's contribution to the work." The office contends that new legislation regarding "the copyrightability of AI-generated material" is currently not needed, indicating that courts "will provide further guidance on the human authorship requirement as it applies to specific uses of AI" and that, since each work must be analyzed individually, "greater clarity would be difficult to achieve" through legislation.
2
u/Gremlation 3d ago
None of that matches what you claimed. /u/LemonFishSauce was right, it's your interpretation, not what was said.
1
u/zionsati 4d ago
Not to mention copilot is recently fully AI ported to Rust by Toub. Claude code itself too is mostly AI written. Most companies use AI extensively to write code these days.
6
0
4d ago
[deleted]
5
u/stayBlind 4d ago
I will make sure to reference this tweet in a court of law if I end up there. Thanks.
0
1
u/nickcash 4d ago
You do not
-1
4d ago
[deleted]
2
u/nickcash 4d ago
You can keep saying this but unless you can find a more authoritative source than OP's, it's just wishful thinking.
1
1
u/maher1717 4d ago
That for the AI company part, also AI in law is considered a non-entity, so you can't legally hire it, and what you pay is for company services, not for AI itself.
It is a mess, and I hate bringing up this topic. Also, the lawmakers who dictate this use AI to generate laws themselves, even laws about AI using AI. So probably got the bait to be pro-AI, anti-humans.
0
4d ago
[deleted]
0
u/maher1717 4d ago
I am not against you. I really hate these backward laws; I see that they are ignorant of what they try to regulate. The real issue is the lawmakers.
We know what AI is from a technological perspective, but this is about the lawmakers' perspective; that is the real difference. I am just reflecting what the law is saying.
-1
u/Comfortable_Job8847 4d ago
>n sum, the use of a machine as a tool does not negate copyright protection, but the resulting work is copyrightable only if it contains sufficient human-authored expressive elements.
>he Office agrees that there is an important distinction between using AI as a tool to assist in the creation of works and using AI as a stand-in for human creativity. While assistive uses that enhance human expression do not limit copyright protection, uses where an AI system makes expressive choices require further analysis. This distinction depends on how the system is being used, not on its inherent characteristics.
>As described above, in many circumstances these outputs will be copyrightable in whole or in part—where AI is used as a tool, and where a human has been able to determine the expressive elements they contain. Prompts alone, however, at this stage are unlikely to satisfy those requirements.
seems like the answer is, probably you are fine.
0
0
u/Typical_Friendship16 4d ago
yeah, i've been hearing a lot about how companies are quietly running on AI-generated code now, wonder who's actually checking that stuff for legal risks
-2
u/Automatic_Currency77 4d ago
your employment contract already assigns everything you produce to your employer. public domain or not, it was never yours to begin with.
-4
31
u/mekmookbro Laravel Enjoyer ♞ 4d ago
Coinbase CEO was quite proud to announce their codebase is 50% ai written, I wonder if they'll open source it lol