Can a company sell its source code to AI?
Often, yes. The company has to own the code and be free to share it.
- Labs use code from repositories (repos: each project's code and its history) to teach a model to write and fix code.
- They build private tests that a model has never seen.
- Review comments show a model what a careful engineer checks.
To license means a lab pays to use a copy for training. Your own team runs a read‑only export.
- GitHub
- GitLab
- Bitbucket
- Azure DevOps
- Jira
- Linear
- Confluence
- GitHub Actions
- CircleCI
What can stop a license
Contracts with customers, lenders and vendors can limit what you share, and so can export and privacy rules. Check this with your own lawyer.
How much is a codebase worth to AI labs?
Most companies are paid $50K to $2M. A 100 to 200 person software company starts at about $50K to $157K (indicative, from our estimate), and the range goes up from there.
| People | Starting range |
|---|---|
| 50 to 100 | $50K to $107K |
| 100 to 200 | $50K to $157K |
| 200 to 500 | $79K to $249K |
| 500 to 1,000 | $113K to $356K |
Indicative, from our estimate, by headcount only. Tools and years of records can raise it.
Tools you add in the dashboard, years of history and an exclusive license can raise it. See which code is worth the most.
If no lab buys, you pay nothing.
We check that a lab wants your code before we ask your team for a full export. There are no fees at any step.
Most licenses are not exclusive, so the same code can go to several labs. You can be paid more than once, usually 30 days to 6 weeks after each sale. See what company data is worth.
Read what other buyers report paying for code
Other buyers publish their own numbers. We list them here so you can compare.
- Mercor's listing for software companies says a company earns $50K to $500K, and more for large codebases or exclusive terms (the company says, seen 5 Nov 2026).
- Pangea lists $100 per million tokens of source code and $40 per million tokens of git history, not exclusive (the company says). A token is a short piece of text, about a word.
- MIT Technology Review reported that one closed startup got about $25,000 for its code.
The $25,000 sale was code alone from a closed startup. A running company with linked tickets, reviews and docs has more for a lab to learn from.
Why does git history matter more than the code itself?
History shows the work behind each change. A ticket, the change that fixed it, the review and the test that proves it become one task a model can learn from.
- LIN-873Duplicate invoice email on retry.
- PR #4182Fix opened. 14 review comments.
- ReviewSend it once, even on retry. Key on invoice ID.
- CItest_retry_sends_once fails, then passes.
- INC-2291Write-up after the outage: retries are now safe.
| Record | What it shows a lab |
|---|---|
| Commits | Each saved change: how the code changed, and why |
| Pull requests | A change put up for review: one finished piece of work |
| Review comments | What a careful engineer caught |
| Issues and tickets | The task in plain words |
| Tests and CI runs | Automatic checks on each change: proof the fix works |
| Design docs and postmortems | Write-ups after something broke: the reasoning |
SWE-bench, a widely used coding test for AI, is built this way. Each task is an issue, the fix and the tests. A snapshot of the final code cannot give you that.
Tickets and engineering chat add more when they link to the code. See selling support tickets and selling Slack and Teams chat.
Read why private code makes harder tests
A model may have seen public code already, so a test built from it is too easy. Private code avoids that.
- Scale AI built a coding test called SWE‑Bench Pro. Its paper says it bought engineering repos from startups for it.
- That private set has 18 repos and 276 tasks. The paper says it is kept private for legal reasons.
- A 2026 paper on AI code review trains models on pairs of a code change and the review comment on it.
- Surge AI told MIT Technology Review that buyers price code by how many useful tasks it yields.
What source code can you sell to AI, and what stays out?
Your private code, its history, reviews, tickets and docs can go in. Open-source code, secrets, customer data and personal details stay out.
What a lab can license
- Private repos you own
- Full git history
- Pull requests and reviews
- Tests and CI settings
- Linked Jira or Linear issues
- Design docs and postmortems
What stays out
- Open-source code copied into your repos
- Paid code from other vendors
- Client code, unless your lawyer clears it
- Contractor code with no signed transfer
- Passwords and access keys
- Customer data in test files
You choose which repos go in, and you can remove any before a sale. Check this with your own lawyer.
For support desks, CRM and customer data, read selling software company data.
Read the details on export-controlled code
Some code falls under US export rules, called EAR or ITAR. Defense work and some encryption code are examples.
- Leave that code out unless your lawyer clears it.
- Under the EAR, releasing controlled source code to a foreign person in the US is treated as an export (15 CFR 734.13).
- ITAR has a similar rule (22 CFR 120.56).
- Check this with your own lawyer.
Who owns code written by employees, contractors or an agency?
Under US copyright law, code an employee writes as part of the job belongs to the company. Contractor or agency code moves to you only through a signed, written transfer.
| Who wrote it | Who usually owns it (US law) | What sellers usually do |
|---|---|---|
| Employees, as part of the job | The company | Usually in |
| Freelancers and contractors | The writer, unless they signed a written transfer to you | Leave out unless you hold a signed transfer |
| An agency or dev shop | You, for the parts assigned. The agency often keeps its own starter code | Assigned parts in, agency starter code out |
| Code you built for a client | Often the client | Leave out unless your lawyer confirms the contract allows it |
| Code from a company you bought | You, if the purchase gave you the rights | In, if your lawyer confirms the rights |
17 U.S.C. 101, 201 and 204 (Legal Information Institute, Cornell); WIPO on software development agreements. Checked 19 Nov 2026.
Buyers ask to see four things:
- Signed transfers from contractors and agencies.
- A list of the open-source parts.
- A note of which code, if any, was built for clients.
- A scan of the full history for keys and passwords (we run it).
You can leave out any repo where the papers are missing. If you run an agency or dev shop, your own tools and libraries may count, if your client contracts leave them with you.
Rules in other countries differ, and many software companies have engineers abroad. Read how to license company data safely. Check this with your own lawyer.
What happens to open-source code in our repos?
Open-source and other outside code should be found and listed, so it is never licensed as yours. Nearly every codebase has some, so this is a normal step.
Almost all software uses open source.
In Black Duck's 2026 audit, 98% of commercial codebases held open-source code. 68% had license conflicts.
| Kind of code | What usually happens |
|---|---|
| Permissive (MIT, Apache) | Licenses with few conditions. Listed and left out of what you license. |
| Copyleft (GPL, AGPL) | Licenses that can require you to share your source. Usually left out. |
| Paid vendor code (SDKs) | Left out. Vendor terms often limit sharing. |
| Copied snippets | For example from Stack Overflow. Flagged and left out where found. |
Black Duck, Open Source Security and Risk Analysis 2026; Choose a License (AGPL 3.0). Checked 19 Nov 2026.
Only code your company owns should be licensed. Check this with your own lawyer.
You can see your range without an email or any access to your code.
How are API keys, passwords and personal details removed?
We scan every commit, not only the latest code, for keys and passwords, and remove what the scan finds. We replace engineer names and emails, and you check a cleaned sample.
Fix by Priya Shah (priya@example.com): rotate payments key pk_9f3...
- We look for API keys and access tokens (passwords that let software talk to a service) across the full history.
- We check keys pasted into Jira and Slack too.
- No scan catches everything. Change any key that still works (engineers call this rotating it), because removing it from history does not make it safe.
- We never ask for passwords.
GitGuardian's 2026 report found secrets in 32.2% of internal repos, against 5.6% of public ones. See how de‑identification works.
Read the details on secret scanning
- GitHub's own docs say its secret scanning checks the whole git history on all branches.
- Free tools such as Gitleaks and TruffleHog also scan the full history.
- GitGuardian's report says about 28% of leaks happen outside code, in tools like Slack and Jira.
- A key that leaked once should be treated as known, so the fix is to change it.
Read the details on privacy law for engineers and customers
Names and emails in commits and tickets are personal data. If your engineers or customers are in the EU or UK, the GDPR covers them (GDPR Art. 4). India has the DPDP Act 2023.
Removing personal details is part of the work, but these laws apply to the records before that too. Check this with your own lawyer.
Will a model learn our product and help a competitor?
What a lab learns is how engineers handle ordinary problems, like a safe retry, from many companies. Your pricing logic and business plans can stay out.
- payments-api
- In. 6 years of history, 2,400 pull requests
- billing-web
- In. Linked to Linear issues
- pricing-engine
- Left out by you. Your edge stays home
- client-portal
- Left out. Built for a client
- vendor-sdk
- Left out. Paid code from a vendor
- You pick the repos. Leave out anything you see as your edge, such as a pricing engine.
- If you want one, a mutual NDA (a promise to keep each other's secrets) is signed before you share any detail.
- Labs see your company name, but are barred by contract from identifying anyone in the records.
- Our team works with your people on the export. Everything is stored on secure servers.
Which code is worth the most?
Older, human-written code with tests and many authors, in a specialist field such as banking or health, is worth the most. Code in rarer languages fills a gap that public code leaves.
Mercor's listing names the languages buyers ask for: C and C++, Rust, Swift and Kotlin, Ruby, COBOL and .NET.
Buyers prefer history from before AI coding tools were common. Mercor's listing turns down code mostly written by AI tools. Repos with one author, copies of other projects, weekend side projects and code that no longer builds count for less.
Read about AI coding agent sessions
Some teams save the sessions where an AI coding agent worked on a task. Each step the agent took is in the log.
- These sessions can count, where your terms and the model maker's terms allow it.
- Some model makers' terms limit using their outputs to build other models, so read your terms first.
- Raise it on the call.
- Check this with your own lawyer.
Read about engineering firms and CAD archives
Engineering firms with scripts and models, and firms with CAD and BIM archives, have their own pages.
How do you license your source code to AI, step by step?
Get an estimate in two minutes and book a 20-minute call. Then your own team runs a read‑only export, once a lab wants the code.
- Estimate.Two or three taps on the estimate page. You see the range with no email.
- Work email.Enter it and a 6-digit code to see the full estimate.
- 20-minute call.Book it in the page. We tell you which repos count, what stays out, and what moves your range.
- Dashboard.Six short steps, with a rough count of repos. A mutual NDA first, if you want one.
- Agreement.The offer depends on your size and years of records.
- Read‑only export.Your team runs it with our guidance, or we pull it with your admin through the API or our connectors.
- Clean and approve.We remove personal details and secrets. You check a sample and can take anything out.
- Paid.You are paid when a lab pays, usually 30 days to 6 weeks after the sale.
Read why old check history may already be gone
Since October 2026, GitHub Actions keeps logs and run history 90 days by default, unless your team set it longer. So older records of automatic checks may already be gone.
A plain GitLab export also drops CI logs and the links between issues and merge requests (GitLab's name for pull requests). Those links matter most, so we guide the export.
For design docs, see exporting Google Workspace data and exporting Microsoft 365 data. The full path is in how to sell company data to AI.
Who buys source code for AI training?
AI labs that build coding models buy it, and so do data vendors such as Mercor and Turing that source data for labs. We license to labs and pay you when a lab pays.
| Program | What it takes | How it pays (the company says) |
|---|---|---|
| Mercor, software company listing | Private repos, 3+ years, 10+ engineers | $50K to $500K |
| Turing, Project Lazarus | Code, reviews and tickets, from running or closed companies | Revenue share, 6-month exclusive first |
| Pangea | Source code and git history, not exclusive | Per million tokens |
| Work Data Lab | Code with history, plus email, docs and tickets. Any size, running or closed | $50K to $2M typical, no fees, paid when a lab pays |
Mercor listing seen 5 Nov 2026; Turing Project Lazarus and Pangea code licensing pages checked 19 Nov 2026.
Compare more buyers in who buys company data.
If you are shutting down, read selling before the repos are deleted and closed companies.
Read about in-house software teams
In-house software teams count too, at insurers, manufacturers and logistics companies.
Common questions
Can I sell my company's source code to train AI?
Often, yes, if the company owns the code and no contract or law stops it from sharing it. Open-source, client and unassigned contractor code is usually left out. Check this with your own lawyer.
How much is my codebase worth to AI companies?
Most companies are paid $50K to $2M. A 50 to 100 person software company starts at about $50K to $107K (indicative, from our estimate). Years of history, linked tools and rarer languages raise it.
What if no lab buys our code?
You pay nothing. We check with a lab that it wants the code before we ask your team to do a full export. There are no fees at any step.
Do I lose ownership of my code if I license it?
A license is not a transfer of ownership, and it lets a lab use a copy on the terms you sign. An exclusive license can stop you licensing the same code to others. Check this with your own lawyer.
We have API keys in old commits. Is that a problem?
It is common, and we scan the full history and remove the keys the scan finds. Change any key that still works, because removing it does not make a leaked key safe. We never ask for passwords.
Who sees our code, and will anyone know it came from us?
Our team sees it, then the lab that licenses it. Labs see your company name, not your customers' or engineers' names, which we remove first. Everything is stored on secure servers, and labs are barred by contract from identifying anyone.
Does code written with AI tools still count?
It counts for less. Buyers prefer history from before AI coding tools were common, and Mercor's listing turns down code mostly written by AI. We look at your mix on the call.
Can a startup that is shutting down sell its code?
Often, yes, and we buy from running, paused and closed companies. In a shutdown, check who can sign and whether a lender has rights in the code, and sell before the repos are deleted. Check this with your own lawyer.
Who buys source code for AI training?
AI labs that build coding models, and data vendors such as Mercor, Turing and Pangea that source code for them. We license your code to labs, with no fees, and pay you when a lab pays.
Is Work Data Lab legit?
Work Data Lab is a New York company that buys company work records, removes personal details and licenses them to AI labs. 100+ companies sell their data with us, and we have paid $10M to partner companies. Read facts about Work Data Lab or write to hello@workdatalab.com.
Sources (23)
- 17 U.S. Code 101, Definitions, Legal Information Institute, Cornell.
- 17 U.S. Code 201, Ownership of copyright, Legal Information Institute, Cornell.
- 17 U.S. Code 204, Execution of transfers of copyright ownership, Legal Information Institute, Cornell.
- How to secure IP ownership with a software development agreement, WIPO.
- Open Source Security and Risk Analysis Report 2026, Black Duck.
- The State of Secrets Sprawl 2026, GitGuardian.
- About secret scanning, GitHub Docs.
- Configuring the retention period for GitHub Actions artifacts and logs, GitHub Docs.
- Actions retention will cover checks, workflow runs and statuses (27 Aug 2026), GitHub Changelog.
- Project import and export, GitLab Docs.
- SWE-bench: Can language models resolve real-world GitHub issues?, arXiv (Jimenez et al.).
- SWE-Bench Pro, arXiv (Scale AI).
- Research on training AI code review from pull request comments, arXiv 2607.25851.
- AI labs are buying data from dead startups to train models (13 Oct 2026), MIT Technology Review.
- Software company listing, Mercor.
- Project Lazarus, Turing.
- Code licensing for companies, Pangea.
- How to sell source code to AI companies, Troveo.
- GNU Affero General Public License v3.0, Choose a License.
- 15 CFR 734.13, Export, eCFR.
- 22 CFR 120.56, Release, Legal Information Institute, Cornell.
- General Data Protection Regulation (EU) 2016/679, EUR-Lex.
- Digital Personal Data Protection Act, 2023, Ministry of Electronics and IT, India.
Figures about Work Data Lab come from our own records. Third-party figures link to their source and the date we checked it. Nothing on this page is legal or tax advice.