Can a company sell its source code to AI companies, and what do buyers want?
A company can earn money from its source code with AI companies, but in practice it licenses the code for AI training rather than selling it. Buyers want private repositories with years of commit history, pull requests and code reviews, after open-source components, client-owned code and secrets are screened out. The company keeps ownership and keeps selling its software.
The short answer: companies license code history, they rarely sell it
A company can earn money from its source code with AI developers, but the usual route is a license, not a sale. The company grants an AI lab or data buyer the right to use a copy of selected repositories for AI training, typically on an exclusive basis for that purpose for an agreed term, and keeps ownership of the code and the product built on it.
That distinction answers the first objection most founders raise. Licensing the history of a codebase does not hand over the product, transfer the intellectual property or stop the company from shipping, selling or being acquired. The company sets the scope, agrees one all-in price and signs only if the terms work.
What AI buyers want from a private codebase
The final snapshot of the code is the least interesting part. Coding agents learn from how software changed and why.
| Asset | What it shows | Why buyers value it |
|---|---|---|
| Commit history over several years | Each change, its author role and its message | Shows how real systems evolve, not just how they end |
| Pull requests and review threads | Proposed changes, reviewer objections, revisions | Captures engineering judgment and critique |
| Linked tickets and issues | The problem behind each change | Connects a request to the code that solved it |
| CI runs and test failures | What broke and how it was fixed | Gives verifiable outcomes for evaluation |
| Incident postmortems tied to fixes | Root cause, remediation and follow-up work | Rare examples of debugging under pressure |
| Design documents and architecture decisions | Options considered and the choice made | Context public repositories seldom include |
A company with 50+ full-time employees at peak, a long-lived product and disciplined review habits usually holds far more of this than a young startup. The GitHub system brief describes what a well-used organization account tends to contain.
What has to be screened out first
Most of the work before a code license is exclusion. The company and its counsel decide each item; a partner never reviews or forwards code.
- Open-source and vendored libraries, which carry their own license terms and are excluded or handled as counsel directs.
- Client-owned code: agencies and consultancies often assign the code they write to clients under statements of work.
- Contractor code without a written assignment. The Copyright Office's circular on works made for hire explains that work an employee prepares within the scope of employment belongs to the employer, while commissioned work qualifies only in listed categories with a signed written agreement, so contractor-written code may need an assignment on file.
- Secrets in history: API keys, passwords, certificates and production data in test fixtures, removed across every commit rather than only the latest one.
- Personal data in commit metadata, such as names and email addresses, handled under the de-identification rules agreed before work begins.
- Third-party SDKs or code received under a nondisclosure agreement.
Ownership can also be divided. Under 17 U.S.C. 201, any exclusive right in a copyrighted work can be transferred and owned separately, which is why a company can grant AI-training rights in code it owns while keeping everything else. This is general information, not legal, tax or financial advice. Confirm with your own counsel before acting.
How a fractional CTO can raise it
Fractional CTOs see the moments when code history is at risk: a monolith being retired, repositories moving between hosts, history being squashed to tidy up a migration, or a product line being sunset. Those are the moments to ask.
The referral overview for fractional CTOs covers the rest of the workflow, and an engineering lead can use the data inventory builder to list repositories, date ranges and linked systems as metadata only. If the company also holds support tickets, documents or other records worth licensing, see how to sell data to AI companies.
When the objection is right
Sometimes no is the correct answer:
- The company is below the size bar of 50+ full-time employees at peak (contractors excluded); the who qualifies page lists the complete criteria.
- Most of the code was written for clients who own it.
- History was lost or squashed in an old migration, leaving only a recent snapshot.
- The repositories are mostly forked open-source projects with light changes.
- The code was generated with AI tools specifically to sell it.
- The same repositories were already licensed for AI training.
- Nobody with authority can approve a license, for example because a lender or trustee has taken control of the assets and is not yet part of the conversation.
Next step
If a company you advise passes these checks, register as a partner and introduce its CEO or CTO, or have the company apply at sourcex.si/apply with your referral link. Partners earn 25% of the eligible platform fees SourceX actually collects from the referred company's licensing deals, capped at $100,000 per referred company, and rewards become payable only after the buyer pays and SourceX receives its fee.
- Step 1Share your linkSend your personal link to a company you know.
- Step 2Company appliesThe company applies itself at /apply.
- Step 3Buyer selects and paysThe buyer selects and pays for the data and SourceX receives its fee.
- Step 4You get your rewardYour share of SourceX fees becomes payable.
Common questions
Does licensing source code let the buyer run or resell our product?
A training license is scoped to AI training under the signed agreement, not to running, reselling or distributing the company's software. The company keeps ownership of its code and product and continues to sell, support and develop it. The permitted uses, exclusivity and term are written into the license, and the company signs only once it agrees them.
Is old or legacy code still valuable for AI training?
It can be, especially when the history around it survives. Legacy systems with long commit histories, migration work, bug fixes and review discussions show how real software is maintained over time. A bare snapshot of retired code with no history, tickets or reviews is much less useful, so preserve full repository history before archiving anything.
What if our repositories include open-source code?
Most commercial codebases include some. Open-source components are identified and excluded or handled as counsel directs, because they come with their own license terms. What buyers value is the company's own work around them: its commits, reviews, tests and fixes. A codebase that is mostly lightly modified forks, however, usually lacks enough original history to qualify.
Can a small startup license its codebase through SourceX?
Usually not. SourceX looks for US companies that reached 50+ full-time employees at peak, contractors excluded, have operated and kept records for several years, can show they hold the rights, and have an owner or executive able to authorize a license. A small team rarely builds enough connected history across code, tickets and reviews to meet it, even if the code itself is excellent.
Who at the company should approve a code license?
An authorized sponsor such as the owner, CEO, CFO or another authorized representative approves the decision. The CTO or engineering lead is well placed to own the repository inventory and the exclusion list, and counsel reviews ownership, open-source and client contract questions. A fractional CTO can make the introduction but should not export or share any repository.
Related pages
Free resources
- Working capital calculator — Net working capital, current ratio and quick ratio.
- Due diligence checklist generator — A tailored document request list by deal type.
- Cash flow calculator — A 12-month cash forecast with shortfalls highlighted.
- All free tools · MCP resource center
By SourceX Partnerships Team · Published 2026-10-09 · Updated 2026-10-09
Know a US company with valuable proprietary data?
Become a referral partner from anywhere we support, get your link and introduce an owner or authorized decision-maker.
Refer a company →I own a business
Explore licensing your company's data to AI developers worldwide. Start a short assessment; no uploads needed.
Start an assessment