# Can you put AI-generated code under the MIT licence?

Source: https://codelifter.com/forum/posts/can-you-put-ai-generated-code-under-the-mit-licence/
Site: CodeLifter Forum, category AI code policies
Published: 2026-10-25. Updated: 2026-10-28. Replies: 2.

## Question by CodeLifter editors (staff), 2026-10-25

Yes, you can release a project that contains AI-generated code under the MIT licence, but the licence only passes on rights that someone holds. In the US, purely AI-generated material is not protected by copyright, so MIT effectively covers the parts you wrote, chose or reworked. Code the assistant copied from elsewhere keeps its original licence.

## What does the MIT licence actually grant?

A licence is a permission from a copyright holder to do things the law would otherwise reserve to them. The [MIT License text published by the Open Source Initiative](https://opensource.org/license/mit) starts with a notice line, `Copyright <YEAR> <COPYRIGHT HOLDER>`, then grants permission "to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software". It has one condition: "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software." The rest is a warranty disclaimer saying the software is provided "AS IS".

Two things follow from that wording. First, MIT is not a claim of authorship; it is a grant of whatever rights the named holder has. Second, it asks very little of the people who reuse your code, which is why it is a common choice for small tools and snippets.

## Who owns code an assistant wrote?

This is the part that changes by country and by how the code was made. In the US, the position as of 16 October 2026 rests on three documents:

1. The US Copyright Office's [Copyright and Artificial Intelligence, Part 2: Copyrightability](https://www.copyright.gov/ai/Copyright-and-Artificial-Intelligence-Part-2-Copyrightability-Report.pdf) (January 2025) says copyright does not extend to purely AI-generated material, or to material where there is insufficient human control over the expressive elements. It adds that "prompts do not alone provide sufficient control", and that mixed works "must be analyzed on a case-by-case basis".
2. The Office's 2023 [registration guidance](https://www.federalregister.gov/documents/2023/03/16/2023-05321/copyright-registration-guidance-works-containing-material-generated-by-artificial-intelligence) (88 FR 16190) says that where a person selects, arranges or modifies AI output, "copyright will only protect the human-authored aspects of the work".
3. The D.C. Circuit's decision in [Thaler v. Perlmutter](https://media.cadc.uscourts.gov/opinions/docs/2025/03/23-5233.pdf) (No. 23-5233, decided 18 March 2025) holds that the Copyright Act requires work to be authored "in the first instance by a human being", while saying the rule "does not prohibit copyrighting work that was made by or with the assistance of artificial intelligence".

None of these is a ruling on a specific repository, and none says where the line falls for code that a person prompted, reviewed and edited. Treat any confident answer about your own project with care, and take legal advice if the code is valuable.

## What does MIT cover in a mixed repository?

Most real projects mix all four kinds of code below. The licence file sits over the whole repository, but its effect differs by part.

| Part of the repository | US copyright position (sources above) | What the MIT licence does for it |
| --- | --- | --- |
| Code you wrote by hand | Protected; you (or your employer) hold it | Grants the MIT permissions and adds the warranty disclaimer |
| AI output you selected, arranged or substantially rewrote | Your human contribution may be protected; the AI-generated parts are not | Grants rights in your contribution; the rest is unaffected either way |
| AI output accepted as generated | Not protected if purely AI-generated | Grants nothing, because there is nothing to grant; the disclaimer still sets expectations |
| Third-party code the assistant reproduced | Protected; owned by its original author | Cannot relicense it; the original licence still applies |

The last row is the one that causes real trouble. Putting an MIT file in the root does not turn a GPL function into MIT code.

## How do you find code the assistant copied?

Some tools check for this. GitHub documents that [Copilot code referencing](https://docs.github.com/en/copilot/concepts/completions/code-referencing) compares a suggestion and about 150 characters of surrounding code against an index of public repositories on GitHub.com. When you accept a matching inline suggestion, the log entry "includes the URLs of files containing matching code, and the name of the license that applies to that code, if any was found."

The same page lists the limits. Only accepted suggestions are checked; code you wrote and suggestions you altered are not. Private repositories and code outside GitHub are not in the index, and the index "is refreshed every few months", so new code may be missing. Other assistants may have no equivalent check at all, so a search of your own still matters for any long, distinctive block. The CodeLifter desk article on [snippet licensing](https://codelifter.com/provenance/snippet-licensing/) covers what to do when the source turns out to be Stack Overflow or MDN.

## Steps before you put an MIT licence on the repository

1. Confirm you are allowed to license the code at all. Code written at work may belong to your employer; the employer policies thread covers what to check.
2. Turn on any public code matching your tool offers and read the log for every accepted match.
3. Search the web and GitHub for any long block that looks too polished for its context, and record what you find. The [provenance record thread](/forum/posts/what-should-a-provenance-record-for-copied-code-include/) lists the fields worth keeping.
4. Remove or relicense anything whose original licence is incompatible with MIT.
5. Add a `LICENSE` file with the MIT text, and fill in the year and the holder (your name, or your organisation if it owns the code).
6. Optionally add `SPDX-License-Identifier: MIT` in a comment at or near the top of each source file, the placement the [SPDX specification](https://spdx.github.io/spdx-spec/v2.3.1/using-SPDX-short-identifiers-in-source-files/) describes.
7. Record AI assistance in your commit history, for example with a trailer, as described in the [Assisted-by trailer thread](/forum/posts/how-can-a-team-enforce-an-assisted-by-trailer-on-commits/).
8. If you ever register the copyright in the US, the 2023 guidance says AI-generated content "that is more than de minimis should be explicitly excluded from the application."

The CodeLifter desk article [Who owns AI-generated code?](https://codelifter.com/provenance/who-owns-ai-generated-code/) goes through the same sources at greater length.

## Short version

- MIT is a permission, not a proof of authorship; it only grants rights someone holds.
- In the US, purely AI-generated code is not protected by copyright; your human contribution can be.
- Copied third-party code keeps its own licence whatever file you put in the root.
- Check matches, keep a provenance record, then add the MIT `LICENSE` file.
- This is general information, not legal advice; the answer differs by country.

## Reply 1 by CodeLifter editors (staff), 2026-10-25

**Does GitHub or the AI company own the code an assistant writes for me?** For GitHub Copilot, no. Section J of the [GitHub Terms of Service](https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) (effective 27 April 2026) says "GitHub does not claim ownership of your Input or Output." The same section puts the remaining risk on you: "You are responsible for determining whether your use of Output requires a third-party license." Other vendors write their own terms, so read the output or ownership clause for the tool you use; we have not summarised them here because we have not checked them for this answer.

The more common owner is your employer. Under US law, code an employee writes within the scope of the job is usually a work made for hire, and the D.C. Circuit's [Thaler v. Perlmutter](https://media.cadc.uscourts.gov/opinions/docs/2025/03/23-5233.pdf) opinion notes that section 201(b) of the Copyright Act treats the employer as the author in that case. The same opinion explains that a transfer of copyright otherwise needs "an instrument of conveyance that is signed by the owner". In practice, read your contract's intellectual property clause before you publish anything you wrote on company time or equipment, AI-assisted or not.

## Reply 2 by CodeLifter editors (staff), 2026-10-28

**Is AI-generated code in the public domain?** Not as a general rule, and the answer differs by country. In the US, the Copyright Office's [Part 2 report](https://www.copyright.gov/ai/Copyright-and-Artificial-Intelligence-Part-2-Copyrightability-Report.pdf) treats purely AI-generated material as unprotected, which in practice leaves it free for anyone to use. The report also notes that "programmers and computer engineers use automated tools to modify software code, such as to perform refactoring and translate", a reminder that tool help in programming is not new. The Office's [2023 guidance](https://www.federalregister.gov/documents/2023/03/16/2023-05321/copyright-registration-guidance-works-containing-material-generated-by-artificial-intelligence) compares prompts to "instructions to a commissioned artist" and says that even with repeated feedback "the AI technology is what determines how to implement those additional instructions".

The UK takes a different route. Section 9(3) of the [Copyright, Designs and Patents Act 1988](https://www.legislation.gov.uk/ukpga/1988/48/section/9) says that for a computer-generated work "the author shall be taken to be the person by whom the arrangements necessary for the creation of the work are undertaken." So the same file can be unprotected in one country and owned in another. If your project is used internationally, do not label generated code "public domain" in a header; describe how it was made and let the licence cover what it can.

---
Cite as: CodeLifter Forum, "Can you put AI-generated code under the MIT licence?", https://codelifter.com/forum/posts/can-you-put-ai-generated-code-under-the-mit-licence/, accessed 2026-11-12.
