Can I sell or license my company's source code to AI companies?
Yes. Private repositories with full commit history are among the most wanted company records, and published buyer ceilings run from up to $250K for common languages to $250K–$500K for software companies. Before any copy leaves, you must remove passwords and keys, and confirm that you own every line.
What could your company's records earn? Get a range in 30 seconds. Free, no obligation.
Why do AI buyers want private code?
Public code is already in every model. Private code is not, and it shows how real products get built: the first commit, the bug, the fix and the review. History is the prize. One buyer states a floor of 50,000 or more lines of code with tests (buyer program pages, read 20 Nov 2026). The 2026 Spirit Airlines sale shows how much workplace data buyers will take: the dataset holds an estimated 100 million emails and half a billion Teams messages (The Record, 18 Nov 2026).
How is a repository collected?
GitHub documents the method. A mirror clone with the Git command line copies a repository "including the revision history," and GitHub notes that wikis are stored as Git repositories and can be cloned the same way (GitHub Docs, "Backing up a repository"). Two limits matter:
- Large File Storage objects need a separate fetch.
- GitHub's migration archives leave out discussions and packages, and GitHub documents no supported way to restore them, so they suit archiving, not full delivery.
GitLab, Bitbucket and self-hosted Git work the same way. A buyer may instead read through a read-only connection.
What gets removed or excluded?
| Item | Why it comes out |
|---|---|
| Passwords, API keys, tokens | Anyone holding the copy could use them |
| Customer data in test files | Real names or records pasted into fixtures |
| Third-party code under licenses that forbid reuse | You cannot license what you do not own |
| Client-owned code | Contractors and agencies often assign nothing |
| Employee names in commit logs | Authors become placeholders |
GitHub's secret scanning looks through "your entire Git history on all branches" for hardcoded credentials, plus issues, pull requests and wikis (GitHub Docs, "Secret scanning"). GitHub also advises rotating an exposed credential at once, because rewriting history is slow and often unnecessary. Rotate every key found before delivery.
Who owns the code?
Copyright protection in the US exists automatically when a work is fixed in a tangible form, and the US Copyright Office says computer programs can be registered as literary works (US Copyright Office, Circular 1). Ownership then turns on your employment and contractor agreements, which a lawyer should check. Open-source components keep their own licenses.
Which industries hold the most code?
Software and SaaS companies, fintech, cybersecurity, game studios, and hardware firms with firmware. A software company with 15 to 500 staff has a published ceiling of $250K–$500K; production code in common languages for companies of 5 to 2,000 staff tops out at up to $250K (buyer listings, read 20 Nov 2026). Rare-language and specialist code sells higher; see legacy code and GPU code.
What is code worth?
Prices span a wide range. One code marketplace lists a few thousand dollars per repository. A closed startup's founder netted about $25,000 for its code (MIT Technology Review, 13 Oct 2026). Live companies with large, tested codebases report offers above that. Use the calculator to see where you fall.
Questions
Do I lose control of my code?
A license lets the buyer train on a copy. Your repository stays yours, and you should ban resale and require deletion at the end of the term (contract clauses).
Can I sell code from a client project?
Only if the contract says you own it. Most client work belongs to the client.
Does selling code help my competitors?
Models can learn patterns from your code. Ask for a use limit and, if it matters, exclusivity.
Sources
- GitHub Docs, "Backing up a repository": https://docs.github.com/en/repositories/archiving-a-github-repository/backing-up-a-repository
- GitHub Docs, "Secret scanning": https://docs.github.com/en/code-security/secret-scanning/introduction/about-secret-scanning
- US Copyright Office, Circular 1, "Copyright Basics": https://www.copyright.gov/circs/circ01.pdf
- The Record from Recorded Future News, 18 Nov 2026: https://therecord.media/judge-signs-off-google-purchase-spirit-airlines-data
- MIT Technology Review, 13 Oct 2026, report on a closed startup's code and workspace sale.
- Buyer program pages and listings, read 20 Nov 2026 (buyers not named by policy).