AI companies could have the legal right to train their large language models on copyrighted works — as long as they obtain copies of those works legally.

That’s the upshot of a first-of-its-kind ruling by a federal judge in San Francisco on Monday in an ongoing copyright infringement case that pits a group of authors against a major AI company.

The ruling is significant because it represents the first substantive decision on how fair use applies to generative AI systems.

Fair use doctrine enables copyrighted works to be used by third parties without the copyright holder’s consent in some circumstances such as illustrating a point in a news article. Claims of fair use are commonly invoked by AI companies trying to make the case for the use of copyrighted works to train their generative AI models. But authors and other creative industry plaintiffs have been pushing back with a slew of lawsuits.