# Can a company sell its source code to AI companies for training?

> What private code bases have sold for, why commit history and linked issues matter more than lines of code, and the ownership and license checks to run first.

Canonical: https://origindatapartners.com/guides/sell-source-code-ai-training
By: Origin Data Partners
Status: Published
Published: 2026-10-21
Updated: 2026-10-21
Sources checked: 2026-10-21

## Quick answer

Yes. AI developers buy private code bases to train and test coding agents. One closed startup reportedly received about $25,000 for its code base in 2026, and an app store operator has reportedly offered developers payment for their app code. Buyers value production code with its history: commits, pull requests, review comments, tests and the issues each change fixed. Before selling, confirm the company owns every part of the code, separate open-source and third-party components, remove secrets from the history, and license rather than assign it if the business is still operating.

## Key points

- Repository history is the product. A commit linked to its issue and review shows how engineers reason.
- Ownership gaps kill code deals: contractor code without IP assignment, client work and vendored libraries.
- An operating company should license a copy with use limits, not sell the code outright.

## Do AI companies buy private source code?

Yes. Public code is available to every AI lab, so private production code with its history is what buyers pay for. A crypto startup founder received roughly $25,000 for his code base, [MIT Technology Review reported](https://www.technologyreview.com/2026/10/13/1145755/ai-labs-buying-data-from-dead-startups-to-train-models/) in October 2026; buyers valued code using estimates of how many useful training tasks it could produce, for example per 100,000 lines. In June 2026 a large app store operator was reported to be offering some developers money for their apps' code to train AI, terms undisclosed ([RuntimeWire, citing 404 Media](https://runtimewire.com/article/google-play-store-code-ai-training-pilot)).


## What buyers use code for

Coding agents learn from tasks: here is a bug report, here is the repository, produce the fix and pass the tests. A private repository with real issues, real fixes and real tests can be turned into many such tasks. A repository that is only a final snapshot cannot.


## What makes a code base worth more

| Raises value | Lowers value |
| --- | --- |
| Full git history with meaningful commit messages | A single squashed snapshot |
| Pull requests with review comments and linked issues | Changes with no record of why they were made |
| A working test suite and build configuration | Code that no longer builds |
| Production code used by real customers | Prototypes, tutorials and abandoned branches |
| A specialized domain: payments, logistics, industrial control, healthcare workflows | Generic web templates found in many public projects |


## Ownership and license checks before selling code

- Who wrote it. Code from contractors or agencies belongs to the company only if their contracts assigned the IP. Check every significant contributor.
- Client work. Code built for a client under a services agreement often belongs to the client or carries confidentiality terms. Exclude it unless the contract allows reuse.
- Open-source components. Vendored libraries keep their own licenses, and copyleft licenses such as the [AGPL](https://choosealicense.com/licenses/agpl-3.0/) carry conditions. List third-party code and exclude or document it.
- Commercial SDKs and licensed code. Vendor agreements usually forbid redistribution.
- Secrets and data in history. API keys, passwords and customer data in test fixtures stay in old commits even after deletion. Scan the full history, not just the latest version.
- Competitive exposure. Licensing code that still runs your product gives a third party a copy of your core asset. Limit use to model training, ban redistribution, and require deletion at the end of the term.


## How to describe a code base without sharing it

- Repositories, languages and frameworks, with approximate size.
- Years of history, number of contributors, and whether issues and pull requests are linked.
- Whether tests run and the build works today.
- Known exclusions: client projects, third-party code and anything with customer data.


## When not to sell your code

If ownership of key components is unclear, if the code is the main thing competitors would want, or if customer contracts promised the software stays confidential, the payment rarely justifies the risk. Archived products, retired platforms and the code of a business that is winding down are the most common fits.

Origin Data Partners is not a law firm. This guide summarizes public sources so you can frame questions for your own counsel. It is not legal advice.


## Questions and answers

### How much do AI companies pay for a code base?

One closed startup reportedly received about $25,000 in 2026. Buyers estimate how many useful training tasks the code can produce, so history, tests and linked issues matter more than raw size.

### Can I sell code that contractors wrote?

Only if their contracts assigned the intellectual property to the company. Without an assignment, the contractor may still own it.

### Does selling code to an AI company mean giving up ownership?

Not if you license it. A license grants a buyer defined rights to use a copy while your company keeps ownership.

## Sources

- [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/)
- [RuntimeWire, citing 404 Media: app code bought for AI training (Jun 2026)](https://runtimewire.com/article/google-play-store-code-ai-training-pilot)
- [Choose a License: GNU AGPLv3 summary](https://choosealicense.com/licenses/agpl-3.0/)

## Related reading

- [/blog/license-software-documentation](https://origindatapartners.com/blog/license-software-documentation)
- [/blog/license-software-test-history](https://origindatapartners.com/blog/license-software-test-history)
- [What company data can you sell to AI companies? Compared by type](https://origindatapartners.com/guides/what-company-data-can-you-sell-to-ai)
