AI Code License Contamination
The assistant wrote it. Someone else owns it.
What Is AI Code License Contamination?
An AI assistant can reproduce code it learned from word for word, licence and all, and the company that ships it carries the obligation. Here a routine an assistant wrote weeks ago turns out to be copied from a copyleft project. You'll trace it through the provenance gutter, compare it with the upstream source, replace it with your own implementation, prove the fix with a snippet licence scan, and record where your code comes from.
What You'll Learn in AI Code License Contamination
- Explain why code an AI assistant writes can carry another project's licence obligations
- Recognise the signs of reproduced code, such as distinctive comments and unusual names
- Compare suspect code against its upstream source and read the licence it carries
- Replace copied code with your own implementation and confirm it with a snippet licence scan
- Keep a provenance record and a pre-release licence scan for assistant-written code
AI Code License Contamination — Training Steps
-
A notice from counsel
Alice leads the SDK team at Undercott. The Telemetry SDK is a closed library that Undercott hands to customers inside their own devices. This morning Ilse, Undercott's counsel, forwarded an outside notice about it.
-
Open the SDK
The notice points at the bit-packing routine in src/bitpack.c of the SDK repository, ~/work/undercott-sdk . In the gutter, violet dashed lines are code an assistant wrote that nobody has reviewed.
-
Accepted, never read
Weeks ago, Alice asked Claude for a fast routine to pack sensor readings into 64-bit words. Claude produced one, it passed the tests, and she accepted it. It shipped in 4.2.
-
Read the block
Review the block the way you would a colleague's change, and look for anything that does not read like the rest of the codebase.
-
The upstream source
The notice names the upstream file: Crumbfold's src/bitpack.c , on the Githarrow code forge.
-
Line for line
Compare the upstream routine with the block in the SDK beside it.
-
What the licence asks
The file carries a licence. Githarrow summarises it behind the licence badge, and the file's own header states it.
-
Whose problem it is
-
Scan it like a release would
A snippet scanner fingerprints the source and compares it against open-source code, the check that would have caught this before 4.2 shipped.
-
Write it yourself
Renaming the variables would hide the copy, not remove it. The fix is a routine Alice writes herself, from the task rather than from Crumbfold's code.
Security Framework Coverage
OWASP Top 10
- A03:2025 Software Supply Chain Failures
CWE
- CWE-1395 Dependency on Vulnerable Third-Party Component
CIS Controls
- CIS 16 Application Software Security
- CIS 2 Inventory and Control of Software Assets
NIST CSF
- PR.AT-02 Individuals in specialized roles are provided with awareness and training so that they possess the knowledge and skills to perform relevant tasks with cybersecurity risks in mind
- PR.PS Platform Security
- ID.AM Asset Management