Under U.S. law, to prove that an AI output infringes a copyright, a plaintiff must show the copyrighted work was “actually copied”, meaning that the AI generates output which is “substantially similar” to their work, and that the AI had access to their work.[4]
I’ve found a similar formulation in a official German document before posting my above comment. Essentially, it doesn’t matter if you’ve “stolen”copied somebody else’s code yourself and used it in your work or did so by using an AI.
If the AI generated code is recognisably close to the code the AI has been trained with, the copyright belongs to the creator of that code.
And they should obey the license of the code.
Since AIs are trained on copyleft code, either every output of AI code generators is copyleft, or none of it is legal to use at all.
I may be wrong but I think current legal understanding doesn’t support this
Wikipedia – AI and copyright
I’ve found a similar formulation in a official German document before posting my above comment. Essentially, it doesn’t matter if you’ve
“stolen”copied somebody else’s code yourself and used it in your work or did so by using an AI.