Sub topic 5
Licensing and intellectual property questions
This chapter assumes you know the basic pull request workflow, have used an AI coding assistant, and understand that open source code comes with license terms. It covers what a team policy should say about licensing and ownership. It is not legal advice. Your policy should be reviewed by someone qualified to give it.
Why licensing matters for AI-assisted code
An AI assistant learns from large amounts of existing code, and some of that code is under licenses with conditions. Three questions come up for teams.
- Reproduction. Can the tool output code that closely matches existing licensed code?
- Ownership. Who owns the code the tool helped write, and can your company claim it?
- Inbound terms. What does the tool vendor's contract say about your inputs, outputs, and liability?
None of these has a single answer that holds everywhere. Laws differ by country and are still changing. A policy cannot settle the law. It can set a repeatable way to handle the uncertainty.
Reproduction of licensed code
Most of the time, assistant output is generic and short, such as a loop or a standard API call. Occasionally a tool can output a longer passage that matches a public project. If that project uses a copyleft license (one that requires derived work to be shared under the same terms, such as the GPL), copying it into a proprietary product can create an obligation you did not plan for.
Practical rules for the policy:
- Authors must not paste in large, distinctive blocks of output without checking where they might come from.
- If a tool offers a setting to block or flag suggestions that match public code, turn it on for the team.
- Reviewers who see code that looks unusually specific, has odd comments, or includes a license header should ask the author to explain its origin.
- Keep the dependency license scan you already run. It does not detect copied snippets, but it still covers packages the assistant suggests you add.
Ownership and vendor terms
Ownership of AI-assisted work depends on two things: the law where you operate and the tool's terms of service. Some jurisdictions require meaningful human authorship for copyright to apply. This means code produced with little human input may have weaker protection than code a developer wrote and shaped. That matters if you license your code to customers or plan to enforce your rights.
When your team approves a tool (see the tool approval chapter), have the right person read the vendor terms and record the answers to these questions:
| Question | Why it matters |
|---|---|
| Does the vendor claim rights in the output? | You need to be free to use it commercially. |
| Is your input used to train models? | Leaked proprietary code may reach other users. |
| Does the vendor offer indemnity (a promise to cover legal costs) for output claims? | It shifts some risk away from you. |
| Are there conditions on the indemnity? | Many apply only when specific filters are enabled. |
Record the answers next to the tool's approval entry so they are easy to find later.
What the policy should say
A short licensing section is enough. It should name an owner, set a few rules, and say what happens when a concern comes up.
## Licensing and IP
- Approved tools only. Vendor terms for each tool are reviewed by Legal
and recorded in the tool register.
- Public-code matching filters must stay enabled where the tool offers them.
- Authors must not merge output they suspect is copied from a project
with an incompatible license. Remove it or rewrite it.
- Do not paste third-party code with restrictive licenses into a tool
as a prompt.
- Questions go to #legal-oss. Legal decides on edge cases.The fourth rule is easy to miss. Licensing runs in both directions: what you send to a tool can also breach someone else's license or contract.
When a concern appears
Suppose a reviewer notices a function that looks lifted from a GPL project. The policy should give a clear path.
- The reviewer blocks the merge and notes the reason in the pull request.
- The author searches for the likely source and reports what they find.
- If a match is confirmed, the author replaces the code with an original implementation or Legal approves a compliant use.
- If the code already shipped, treat it as an incident (covered in a later chapter).
Exercise
Your team's assistant suggests a 40-line function with a distinctive structure and a comment naming another project. What should the author do before merging, and which policy rule supports it?
Show answer
The author should not merge it yet. They should search for the source and check its license, then replace it with an original implementation if it is incompatible or unclear, or ask Legal to approve it. The rule is that authors must not merge output they suspect is copied from an incompatible license, with questions routed to Legal.