# Licensing Code to an AI Lab: Ownership Proof and Rights

> What proof of ownership an AI lab wants before licensing your company's code, the open-source and secrets checks, and the rights a license leaves you.

Canonical: https://origindatapartners.com/guides/license-company-code-to-ai-lab
By: Origin Data Partners
Status: Published
Published: 2026-11-22
Updated: 2026-11-22
Sources checked: 2026-11-22

## Quick answer

An AI lab wants proof that your company owns every line it licenses: signed IP assignments from employees and contractors, the documents for any code you acquired, a list of open-source and third-party components, a scan showing secrets and personal data are out of the commit history, and confirmation that no client owns part of the code. With a non-exclusive license you keep ownership and can still use and license the code yourself; the lab gets defined rights to use a copy for training. Private repositories with years of history, tests and reviews are what buyers pay for.

## Key points

- Chain of title comes first: every contributor, every acquisition, every client contract.
- Third-party code stays out or is listed with its license. Leaked secrets are rotated, not just deleted.
- A non-exclusive license leaves ownership with you. An exclusive one is a transfer under US copyright law.

## Which ownership documents does a code license need?

A clean chain of title: written proof that each part of the code passed from the person who wrote it to your company, plus a list of the repositories in scope. This page covers compliance and rights; for prices and how buyers use code, start with [can a company sell its source code to AI companies for training?](https://origindatapartners.com/guides/sell-source-code-ai-training). Origin Data Partners is an independent data partner that helps business owners value and license their company records: the company pays Origin nothing, and a buyer may pay Origin when a deal completes.

- Employees. Code written within the scope of the job is a work made for hire, and the employer [owns all of the rights](https://www.law.cornell.edu/uscode/text/17/201) unless a signed agreement says otherwise. Keep each contributor's employment and invention assignment agreement. In California, an assignment clause cannot reach an invention made entirely on the employee's own time without company equipment or trade secrets, unless it relates to the business ([Labor Code 2870](https://california.public.law/codes/labor_code_section_2870)).
- Contractors and agencies. An independent contractor usually keeps the copyright unless a contract assigns it, and a transfer [is not valid unless](https://www.law.cornell.edu/uscode/text/17/204) it is in writing and signed. Find the assignment for every outside contributor.
- Founders and acquisitions. Code written before incorporation needs its own written assignment; acquired code needs the purchase or merger agreement that names it.
- Hosting. GitHub [considers the contents of private repositories to be confidential to you](https://docs.github.com/en/site-policy/github-terms/github-terms-of-service). A repository that was ever public, mirrored or forked is a different case.


## Does open-source code in our repositories stop us licensing them?

No, but it has to be found first. Open-source components keep their own licenses, so the usual approach is to deliver only the code your company wrote, with a manifest of every third-party component, its version and its license.

The license type decides how careful to be. MIT requires that "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software." ([MIT License](https://opensource.org/license/mit)). Copyleft goes further: for a conveyed modified GPL work, "You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy." ([GPL v3](https://www.gnu.org/licenses/gpl-3.0.en.html)). The AGPL says a modified version "must prominently offer all users interacting with it remotely through a computer network" its source ([AGPL v3](https://www.gnu.org/licenses/agpl-3.0.en.html)).

Whether training counts as distributing code is not settled, so labs avoid the question: copyleft components, copied snippets and forks are left out, and commercial SDKs usually cannot be passed on at all. Permissive libraries may stay with their notices if the buyer accepts them. A software composition scan gives you the list.


## How do we remove secrets and personal data from the commit history?

Scan the whole history, then rotate every secret you find. GitHub's secret scanning "scans your entire Git history on all branches of your repository for hardcoded credentials, including API keys, passwords, tokens, and other known secret types." ([GitHub Docs](https://docs.github.com/en/code-security/secret-scanning/introduction/about-secret-scanning)). Deleting a file is not enough: "If you only rewrite your history and force push it, the commits with sensitive data may still be accessible elsewhere" ([GitHub Docs](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository)).

Personal data hides in test fixtures, database dumps committed by mistake, logs, and names in commit messages. Some buyers want a seeded database so the system runs end to end; that sample data must be synthetic or de-identified, never a production copy.


## Can an agency license its own framework without the clients' code?

Yes, if the agency owns the framework. Many services agreements give the client the deliverables while the agency keeps its pre-existing tools, often called background IP. Check that clause in each master services agreement first.

Buyers draw the same line. Mercor, an AI data company, lists "Client work an agency doesn't own" as not a fit for code (Mercor listing data). An internal testing framework used across many client projects can still qualify: deliver its repository and history, strip client names and fixtures from commits, and leave client application code out. Origin values a narrower asset like this and handles the licensing. The [design and web agency guide](https://origindatapartners.com/guides/license-design-agency-files-ai) covers agencies' other records.


## What does a buyer's due diligence ask for?

Whether you can transfer the code, whether the buyer can use it for training, and whether it can keep what training produces. As one law firm puts it, "Possessing data is not the same as having an unrestricted right to sell or license it." Limits "may arise from privacy notices, employee policies, customer and vendor contracts, IP assignments, inbound data licenses, open-source terms, confidentiality agreements, and applicable law." ([Nixon Peabody, October 2026](https://www.nixonpeabody.com/insights/alerts/2026/10/26/shopping-for-ai-training-data-five-diligence-questions-before-you-buy)).

Code buyers also ask how the code was written. One listing wants code that is "Mostly human-written: under 10% of commits AI-authored" (Mercor listing data), and the US Copyright Office has said "the outputs of generative AI can be protected by copyright only where a human author has determined sufficient expressive elements" ([Copyright Office](https://www.copyright.gov/newsnet/2025/1060.html)).


## Compliance steps before selling company source code: the checklist

Work through these in order. None needs the code to leave your systems.

| Step | What to check | Proof a buyer accepts |
| --- | --- | --- |
| 1. Scope | Repositories, branches and years offered | Repository list with languages, size and first commit |
| 2. Employees | Everyone who committed code | Signed invention assignment agreements |
| 3. Contractors | Every outside contributor | Written, signed IP assignments |
| 4. Founders and acquisitions | Pre-incorporation or bought-in code | Founder assignments, purchase agreements |
| 5. Client work | Code built under services agreements | Background IP clauses; client code excluded |
| 6. Open source | Vendored libraries, snippets, forks | Component manifest; copyleft excluded |
| 7. Secrets | Keys and passwords anywhere in history | Full-history scan and rotation record |
| 8. Personal data | Fixtures, dumps, logs, commit messages | De-identification note; synthetic seed data |
| 9. Public exposure | Any public or mirrored period | Hosting history and visibility settings |
| 10. AI-written code | Share of AI-authored commits | Tool list and start dates |
| 11. License terms | Use, term, exclusivity, deletion | A license reviewed by your counsel |


## What rights do I keep when I license source code for AI training?

With a non-exclusive license you keep ownership and every right you do not grant. US law counts an exclusive license as a transfer of ownership "but not including a nonexclusive license" ([17 U.S.C. 101](https://www.law.cornell.edu/uscode/text/17/101)). You can keep running the code, sell the product and license the same code to other labs.

Negotiate the edges: use limited to training and evaluation, no redistribution of the code, a term, deletion of the copy at the end, and confidentiality. Expect the buyer to ask "Can the buyer retain and commercialize what training produces?" ([Nixon Peabody](https://www.nixonpeabody.com/insights/alerts/2026/10/26/shopping-for-ai-training-data-five-diligence-questions-before-you-buy)); the trained model usually stays with the buyer, so price for that. See [exclusive vs non-exclusive data licenses](https://origindatapartners.com/guides/exclusive-vs-non-exclusive-data-license) and [source code escrow vs licensing](https://origindatapartners.com/guides/source-code-escrow-vs-licensing).

Exclusivity costs more. For RL environments, founders told Epoch AI that "exclusive deals are roughly 4-5x more expensive than non-exclusive ones" ([Epoch AI](https://epoch.ai/gradient-updates/state-of-rl-envs)), and one code listing counts "Openness to an exclusive license on part of the code" as a plus (Mercor listing data).


## What makes code valuable as AI training data?

History, many authors and proof that it works. Coding agents learn from real tasks: an issue, the fix, the review and the passing tests. Valuations rest on estimates of "how many useful tasks come from, say, 100,000 lines of code" ([MIT Technology Review](https://www.technologyreview.com/2026/10/13/1145755/ai-labs-buying-data-from-dead-startups-to-train-models/)). One AI data company's published requirements, as of 22 November 2026:

| What buyers ask for | Published requirement |
| --- | --- |
| Never public | Private repositories that have never been public, mirrored or open-sourced |
| Years and people | 3+ years of commit history from at least 10 engineers |
| Size | 50,000+ lines of code the company owns outright |
| Reviews | Thousands of pull requests with review discussion (a plus) |
| Runs end to end | 40,000+ lines of code, 1,000+ source files, 2,000+ commits; seeded database that loads sample data |
| Languages | A separate listing for legacy and specialist languages such as COBOL, Fortran and Perl |

Sources: the listing data Mercor publishes as JSON for its software company, production codebase and legacy language listings, which publish $50K to $500K, up to $200K and up to $500K.

For narrower markets, see [chip design code](https://origindatapartners.com/guides/chip-design-firm-data), [COBOL and mainframe code](https://origindatapartners.com/guides/license-cobol-mainframe-code-ai) and [firmware and embedded code](https://origindatapartners.com/guides/firmware-embedded-code-ai-licensing).


## What could our codebase be worth?

One AI data company runs three listings for company codebases alone, as the table above shows. AI data buyers publish payouts of $100K to $5M for established companies' records, and a private codebase with years of history, tests and reviews is near the top of what they ask for. The ownership work above is what turns that demand into a signed license.

[See what your data is worth](https://origindatapartners.com/check-fit), or [estimate your codebase with the source code value calculator](https://origindatapartners.com/tools/source-code-value-calculator). Origin reviews the repositories with you, helps you assemble the ownership documents your counsel checks, and handles the licensing.


## How much do RL environments sell for?

Mostly hundreds to low thousands of dollars per task. Epoch AI reported that "multiple interviewees agreed on a ballpark of $200-$2,000 per task", that website replicas "cost around $20k each", and that "Contract sizes are often six to seven figures per quarter." ([Epoch AI, January 2026](https://epoch.ai/gradient-updates/state-of-rl-envs)).

Company code is raw material for those environments: micro1 says it "uses de-identified company data to build reinforcement learning environments that reflect real business operations" ([micro1](https://www.micro1.ai/blog/micro1-commits-1b-to-enterprise-data-acquisition)). The code owner is paid for the code and its history, not at environment prices. See [what RL environments are](https://origindatapartners.com/guides/rl-environments-company-data) and the [RL environment companies tracker](https://origindatapartners.com/guides/rl-environment-companies).


## How can a company sell its IP before it dissolves?

License or sell it first, then dissolve. A dissolved Delaware corporation continues "for the term of 3 years" to, among other things, "dispose of and convey their property" ([8 Del. C. 278](https://delcode.delaware.gov/title8/c001/sc10/index.html)), but the board, bank account and engineers who answer buyer questions disappear fast after a shutdown.

A SaaS codebase from a closing business is a common fit, because it no longer competes with anything. One founder winding down a startup "netted roughly $25,000 for his code base" ([MIT Technology Review](https://www.technologyreview.com/2026/10/13/1145755/ai-labs-buying-data-from-dead-startups-to-train-models/)). For the choice between open-sourcing and selling, see [shutting down a startup: open source the code or sell it?](https://origindatapartners.com/guides/startup-shutdown-open-source-or-sell-code)

Patents, code and training data can go together or apart. A patent assignment must be in writing, and can be void against a later buyer for value without notice "unless it is recorded in the Patent and Trademark Office within three months from its date or prior to the date of such subsequent purchase or mortgage" ([35 U.S.C. 261](https://www.law.cornell.edu/uscode/text/35/261)). A common split: assign patents and domains to one buyer, license the code and records to AI labs. See [sell intellectual property from a closed company](https://origindatapartners.com/guides/sell-intellectual-property-closed-company) and [how to dissolve a corporation](https://origindatapartners.com/guides/dissolve-a-corporation).


## How we checked this

On 22 November 2026 we read every source cited here, from the statutes and license texts to the published buyer listings, and matched each quote to the live page. Origin Data Partners is not a law firm and this is not legal advice; have counsel review any license before you sign.

Origin Data Partners values the records of companies that own data and handles the licensing. We are independent of the services on this page, and a buyer may pay us when a deal closes ([how Origin is paid](https://origindatapartners.com/referral-disclosure)). [See what your data is worth](https://origindatapartners.com/check-fit).


## Start with a description, not the code

Tell Origin which repositories you have, how many years and engineers they cover, and which clients or contractors touched them. No code leaves your systems for a first review. [See what your data is worth](https://origindatapartners.com/check-fit).


## Questions and answers

### Which ownership documents will an AI lab ask for before licensing our code?

Signed IP assignments from every employee, contractor and founder who committed code, agreements for any acquired code, an open-source component list, a full-history secrets scan, and confirmation that no client owns part of the code.

### What rights do I keep when I license source code for AI training?

Under a non-exclusive license you keep ownership, keep using and selling the software, and can license the same code to others. The buyer gets only the rights the contract grants, for the stated term.

### Can we license code that contractors wrote?

Only if the rights reached the company in writing. 17 U.S.C. 204 requires a signed written transfer, and 17 U.S.C. 101 treats commissioned work as made for hire only in listed categories with a signed agreement. Otherwise the contractor usually keeps the copyright: ask your counsel, or leave that code out.

### Do we have to remove open-source code first?

Not all of it. Leave copyleft components, copied snippets and forks out of the delivery, and list every third-party component with its license. Permissive code with its required notices may stay if the buyer's requirements allow it.

### Is deleting a file enough to remove a leaked key?

No. Copies survive in clones, forks and cached commits. Scan the full history on every branch, rewrite it where needed, and revoke every credential you find.

### Is it easier to sell a SaaS codebase before the company dissolves?

Yes, and it is easier before dissolution, while the board can approve the deal and engineers can answer questions. Delaware corporations can still dispose of property for three years after dissolving.

### How much do RL environments sell for?

Epoch AI reported roughly $200 to $2,000 per task, around $20K for a website replica, and contracts often of six to seven figures per quarter, with exclusive deals costing about four to five times more.

## Sources

- [Mercor: software company listing, JSON from Mercor's public listings API (read 22 November 2026)](https://api.data.mercor.com/data-acq/api/v1/listings/software-company)
- [Mercor: production codebase listing, JSON from Mercor's public listings API (read 22 November 2026)](https://api.data.mercor.com/data-acq/api/v1/listings/production-codebase-seeded-db)
- [Mercor: legacy and specialist-language codebase listing, JSON from Mercor's public listings API (read 22 November 2026)](https://api.data.mercor.com/data-acq/api/v1/listings/legacy-language-codebases)
- [17 U.S.C. 201: ownership of copyright](https://www.law.cornell.edu/uscode/text/17/201)
- [17 U.S.C. 204: execution of transfers of copyright ownership](https://www.law.cornell.edu/uscode/text/17/204)
- [17 U.S.C. 101: definitions (transfer of copyright ownership)](https://www.law.cornell.edu/uscode/text/17/101)
- [California Labor Code 2870](https://california.public.law/codes/labor_code_section_2870)
- [Open Source Initiative: the MIT License](https://opensource.org/license/mit)
- [GNU General Public License v3](https://www.gnu.org/licenses/gpl-3.0.en.html)
- [GNU Affero General Public License v3](https://www.gnu.org/licenses/agpl-3.0.en.html)
- [GitHub Docs: about secret scanning](https://docs.github.com/en/code-security/secret-scanning/introduction/about-secret-scanning)
- [GitHub Docs: removing sensitive data from a repository](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository)
- [GitHub Terms of Service: private repositories](https://docs.github.com/en/site-policy/github-terms/github-terms-of-service)
- [Nixon Peabody: five diligence questions before buying AI training data (Oct 2026)](https://www.nixonpeabody.com/insights/alerts/2026/10/26/shopping-for-ai-training-data-five-diligence-questions-before-you-buy)
- [US Copyright Office: report on copyrightability of AI outputs (Jan 2025)](https://www.copyright.gov/newsnet/2025/1060.html)
- [MIT Technology Review: AI labs buying data from shut-down startups (Oct 2026)](https://www.technologyreview.com/2026/10/13/1145755/ai-labs-buying-data-from-dead-startups-to-train-models/)
- [Epoch AI: the state of RL environments (Jan 2026)](https://epoch.ai/gradient-updates/state-of-rl-envs)
- [micro1: enterprise data acquisition announcement](https://www.micro1.ai/blog/micro1-commits-1b-to-enterprise-data-acquisition)
- [Delaware Code, Title 8, section 278](https://delcode.delaware.gov/title8/c001/sc10/index.html)
- [35 U.S.C. 261: ownership and assignment of patents](https://www.law.cornell.edu/uscode/text/35/261)

## Related reading

- [Can a company sell its source code to AI companies for training?](https://origindatapartners.com/guides/sell-source-code-ai-training)
- [Source Code Escrow vs Licensing Code for AI Training](https://origindatapartners.com/guides/source-code-escrow-vs-licensing)
- [Chip Design Data for AI: What Design Firms Can License](https://origindatapartners.com/guides/chip-design-firm-data)
- [Shutting Down a Startup: Open Source the Code or Sell It?](https://origindatapartners.com/guides/startup-shutdown-open-source-or-sell-code)
- [Sell intellectual property: patents, trademarks and domains](https://origindatapartners.com/guides/sell-intellectual-property-closed-company)
- [Firmware and Embedded Code: Can You License It for AI?](https://origindatapartners.com/guides/firmware-embedded-code-ai-licensing)
- [COBOL and Mainframe Shops: License Your Legacy Code to AI](https://origindatapartners.com/guides/license-cobol-mainframe-code-ai)
- [Exclusive vs non-exclusive data licenses: what sellers should know](https://origindatapartners.com/guides/exclusive-vs-non-exclusive-data-license)
