Sub topic 1
How copyright applies to software
Prerequisites
This chapter assumes you have used an AI coding assistant, work with Git and code review, and know in general terms what an open-source license is. It is general education, not legal advice. The law differs by country and is still changing.
What copyright protects
Copyright is a legal right that arises automatically when a person creates an original work and fixes it in a lasting form, such as a file on disk. You do not have to register the work or add a notice for the right to exist. In most countries the right comes from the Berne Convention, an international treaty that most countries have joined.
Software counts as a literary work in most legal systems. Copyright covers the way an idea is expressed. It does not cover the idea itself. Two parts of a program are usually protected:
- Source code and object code. The text you write and the binary a compiler produces from it.
- Creative structure and organization. Choices about how a large program is arranged, to the extent those choices are original and not dictated by function.
What copyright does not protect
Several things that matter to developers sit outside copyright:
- Ideas, algorithms and methods. You can copy how a sorting algorithm works and write your own code for it. Patents, not copyright, may cover a method.
- Facts and data. A bare list of values has little or no protection.
- Code that is the only sensible way to express something. If a function can be written in only one or two natural ways, copying it is rarely infringement. Lawyers call this merger of idea and expression.
- Short, trivial snippets. A one-line loop is unlikely to be original enough to protect.
This last group is why "is this snippet copyrighted?" has no yes-or-no answer. Protection depends on how much creative choice went into the code.
What the owner can control
The copyright holder has exclusive rights to copy, modify, distribute and publicly perform the work, and to make derivative works. A derivative work is a new work built from an existing one, such as a port to another language or a modified fork. Anyone else needs permission, and a license is how that permission is granted.
The default owner is the author. There are two common exceptions. Work an employee makes as part of their job often belongs to the employer. Work made under a contract may belong to the client if the contract says so. Later chapters cover both.
A license is permission, not a transfer
A license lets others use the code under stated conditions. The owner keeps the copyright. An open-source license such as MIT or GPL is still a license. If you break its conditions, you may lose the permission it gave you, and then your use counts as infringement.
You can see this in a file header. The SPDX line states the license, and the copyright line names the owner.
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2026 Example Corp.
def clamp(value: float, low: float, high: float) -> float:
return max(low, min(value, high))The header does not create the copyright. It records who claims it and under what terms the project distributes the file.
Why this matters for AI-assisted code
Every later question in this tutorial builds on these basics. Who owns generated code depends on who counts as its author. Whether generated code carries license duties depends on whether it copies protected expression from existing works. Whether you can license your project's code depends on whether you own it in the first place.
Exercise
A teammate says, "Anyone can reimplement the same retry algorithm, so copying a colleague's retry module line by line must also be fine." What is wrong with this reasoning?
Show answer
Copyright protects the specific expression, not the algorithm. Writing your own implementation of the same idea is allowed. Copying the module's code line by line copies its expression, and that needs permission from the owner, usually through a license or the employer's own ownership of the code.
Exercise
A project's file header says "SPDX-License-Identifier: MIT" and "Copyright (c) 2026 Example Corp." Who owns the copyright, and what does the MIT line do?
Show answer
Example Corp. is the claimed owner. The MIT line does not transfer ownership. It grants others permission to use the code under the MIT license's conditions.