The mechanism of reproduction
A model does not store files, but it can reproduce sequences it saw, and the probability is not uniform. Verbatim reproduction is likeliest when a sequence is distinctive, appeared many times in training, and is prompted with a long matching prefix.
For code that picks out a specific population: famous algorithm implementations, long configuration blocks copied identically across thousands of repositories, distinctive constants, and boilerplate headers. The canonical example is the fast inverse square root from the Quake III source, with its magic constant 0x5f3759df and its memorable comment, a short, distinctive, endlessly copied fragment, which is exactly the profile that gets reproduced.
What this is not: ordinary application code. The typical generated function is a recombination, not a copy. The risk is concentrated, not diffuse, and treating every line as suspect is both wrong and unmanageable.
Why the licence matters commercially
Public code is not free of conditions. Two families behave very differently if a fragment lands in your product.
Permissive (MIT, BSD, Apache 2.0) require attribution and a licence notice. Keeping the notice is easy; the common failure is not knowing there was one to keep.
Copyleft (GPL, and AGPL especially) condition redistribution on releasing the combined work under the same terms. AGPL extends that trigger to network use, which is what makes it consequential for a hosted product. If copyleft-licensed code is incorporated into proprietary software, the exposure is not a fine, it is an argument about whether your whole product must be released. That is why legal teams care about this specific case far more than about attribution.
The controls that exist
Duplication filters. Several assistants offer a setting that suppresses suggestions matching public code above a threshold: around 150 characters in the best-known implementation. Turn it on. Understand precisely what it gives you: it compares against an index of public code, so it says nothing about private code, nothing about code outside the index, and it is a similarity check rather than a legal conclusion.
Similarity scanning on what you ship. ScanCode Toolkit and FOSSology are free and open source and detect licence text and known code fragments in a codebase. Run one before a release, not on every commit; it is slow and the findings need a human.
Keep licence notices you did receive. If a dependency’s licence requires attribution, generate the notice file as part of the build so it cannot be forgotten.
Do not paste proprietary code into a consumer tier. Two directions of the same problem: yours going out, and somebody else’s coming in.
Indemnities, and what they actually cover
Several vendors offer to defend customers against copyright claims arising from their output. These are real and they are narrow. Typical conditions include: the relevant filter must have been enabled, you must not have prompted the model to reproduce a specific work, you must notify promptly and let them control the defence, and coverage may exclude cases where you modified the output.
Read the actual clause. An indemnity described in a keynote and an indemnity in a contract are different documents, and the second one is the one that pays.
What to tell your organisation
A short, honest position that survives contact with both engineers and lawyers:
- Enable duplication filtering everywhere, and record that you did.
- Scan releases for licence text and known fragments; act on findings.
- Do not use assistants to reimplement a specific identified project. “Make this like the X library” is the prompt most likely to produce something recognisable, and it is the least defensible if it does.
- Keep an inventory, so that if a question arrives you can answer it rather than investigate for a month.
- Get a lawyer in your jurisdiction for anything beyond that.
The part that is unsettled
Whether a model’s output can be a derivative work of its training data is not resolved. Whether training itself is permitted is not resolved. Both differ by country and are being litigated now. The next lesson lays out the shape of the disagreement without resolving it, because it is not resolvable from here.
What can be said cleanly: these questions are about the licence and copyright status of code, which is a question your organisation has always had and has always had a process for. The volume changed. The category did not, and the people who handle software licensing in your organisation are the people to involve.
Every lesson here is open. Your progress is recorded once you pass the AI at Work exam.
Check your understanding
Why does the risk of verbatim reproduction concentrate in fragments like a famous algorithm rather than spreading evenly across generated code?
Pick the one you would defend. Your answer stays private.
Stuck on something?Ask Larissa, your AI tutor
