Let's presume that a chat-based AI, for certain queries/prompts involving specific phrases, is reproducing, verbatim, code that was placed on a publicly accessible website. The code on the website had no explicit licence attached to it.

Presumably its algorithm was trained on code and content scraped from the internet, and when users enter prompts containing enough phrases matching the content of said page, it returns the corresponding code (about 50 lines, including comments).

My question is: am I correct in thinking that the copyright of the original author has been infringed? What could the author of that code realistically do about it?

  • 4
    this may be of interest: githubcopilotlitigation.com Dec 6, 2022 at 0:08
  • 2
    This question already has 3 votes to close it as seeking specific legal advise. I rewrote the question to make it more general to prevent it from being closed. But I would like to encourage you to publish your story on other platforms where it is more appropriate, so people become aware of this problem.
    – Philipp
    Dec 6, 2022 at 9:53
  • 1
    If your code is so generic that it's being reproduced verbatim by a statistical model trained on the entirety of the internet, is it really copyrightable to begin with?
    – nick012000
    Apr 3 at 21:00
  • 1
    @user24890238 That sort of thing should be basically impossible, simply because of how the AIs work, unless you're deliberately fiddling with the AI's settings to cause it to happen. For each word, they generate a list of the most statistically probable words, then randomly pick a word fron the list, weighted so that the top words are the most likely to be picked. Usually there's about an 80% chance it will pick the top word. Unless you deliberately set that to a 100% chance, it will very rapidly spiral off into literal chaos.
    – nick012000
    Apr 4 at 10:59
  • 2
    @nick012000 here’s an example. The AI has not been fiddled with, it just collates two super-common things: a license disclaimer and a super-famous bit of code (it has its own Wikipedia article). It turns out that the AI sticks a (wrong and noncompatible) license on the code.
    – KFK
    Apr 4 at 14:42

1 Answer 1


Copying computer code without permission of the author is copyright infringement. Re-distributing protected material is a further form of copyright infringement. It is legal for a person to read publically-available code that is put out on a web page, and you can take factual knowledge that you gain from understanding the code and implement it in your own works, which you can distribute.

Permission comes in two forms: implicit and explicit. When you post some text in the open (no password required), you can read it. Even though reading an online file requires copying it, there is an implicit license to read anything out in the open. There is no implicit right to redistribute: a bot which redistributes your code has infringed your copyright. A bot which correctly checks for explicit permission to redistribute and does not redistribute without permission complies with copyright law.

There have been cases where simple web scraping has been the subject of a lawsuit and where it has been found that "web scraping is legal", but that refers to gathering of information, and not wholesale redistribution of text. If the extent of copying is minimal, it might be possible to defend against copying plus redistribution via a fair use defense. You describe something that does beyond fair use.

You must log in to answer this question.

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