Software and SaaS companies
How to sell source code to AI companies: what buyers pay for in a codebase
On this page
The short answer
You can sell source code to AI companies, or license a copy and keep it. Several programs buy private codebases, and one lists standalone codebases at $10K to $100K+ with a 50K-line minimum (source: program terms, Regulr buyer directory). Each figure on this page is a program's own advertised term; our buyer directory lists the programs and links to their published terms.
What sells is code with its history: every commit, pull requests with review comments, CI results and linked tickets. Before you sell your codebase, confirm the company owns all of it (contractor work included), list the open-source code inside, and clean secrets out of git history.
What AI buyers pay for when they buy source code
People who search for how to sell source code usually find marketplaces for app templates and game scripts. AI buyers want something different: the private code of a real product, built and run in production by a team over years. One data marketplace's code guide puts the profile plainly. Buyers look for “a complex product your own team built and ran in production”, and C++, C#, Go and Rust are the four languages they ask for first (source: program terms, Regulr buyer directory).
The same guide and the programs' own lists point to the same signals:
- Back-end and systems code. Services, data pipelines, infrastructure code and anything with hard performance or correctness constraints.
- Code written before AI assistants. The guide gives extra credit to high-quality code that on-shore teams wrote before large language models, and tells sellers whose product predates AI coding assistants to say so and show it (source: program terms, Regulr buyer directory).
- Size. Buyer program F says codebases need 50K+ lines of code (source: program terms, Regulr buyer directory).
- Code a buyer can run. Setup instructions, a working build and a test suite let a buyer use the code for agent training, not just reading. The guide says buyers pay most for the production history you already have (source: program terms, Regulr buyer directory).
- The records around the code. Buyer program P lists “code and PRs”, Buyer program L lists code and incident history, and Buyer program M lists code and commits alongside decision threads (source: program terms, Regulr buyer directory).
Why git history, PRs and reviews matter more than the code itself
The data marketplace's code guide says “a snapshot with no history is worth little” to buyers, and tells sellers to export every branch and every commit (source: program terms, Regulr buyer directory). History is what turns code into training data with outcomes attached:
| Part of the record | What it teaches a model | Where it lives |
|---|---|---|
| Commits and diffs | What changed, in what order, and what broke afterward | Git history on GitHub, GitLab or Bitbucket |
| Pull requests | A proposed change with a merged or rejected outcome | GitHub PRs, GitLab merge requests |
| Review comments | What was accepted, what was rejected, and why | PR and merge request threads |
| CI runs and test results | A machine-checkable pass or fail for each change | GitHub Actions, GitLab CI, Jenkins |
| Linked tickets | The request behind a change and whether it solved the problem | Jira, Linear, GitHub Issues |
| Reverts and hotfixes | Mistakes and how the team recovered | Git history, incident records |
Some of this is easy to lose. GitHub's migration tools do not carry Actions workflow run history, and Actions logs are kept for 90 days by default. Our guide to exporting from GitHub, GitLab, Jira and Linear lists what each export keeps and what it leaves behind.
Sell your codebase outright, or license a copy
“Sell my codebase” can mean three different deals, and the difference matters more than the price.
- A nonexclusive license. The buyer gets a de-identified copy for an agreed use and term. You keep the code, keep running the product, and can license the same records again.
- An exclusive license. The buyer is the only one that may use the records for AI training, for a period or forever. One buyer program is exclusive by default and another publishes perpetual exclusive licenses (source: program terms, Regulr buyer directory). Exclusivity usually pays more and closes off later deals.
- An outright sale. The buyer takes ownership of the code or the dataset. This is common in wind-downs: one data marketplace says a company winding down usually sells (source: program terms, Regulr buyer directory).
There is also the choice between code on its own and the full operating record. In our view a code-only sale earns less than a license that adds tickets, incidents, specs and engineering chat, so an operating company should price the full license first. If you are closing the company, our guide to shutting down a startup and selling its code covers the timing.
Who owns your code: employees, contractors and agencies
Buyers will ask you to warrant that the company owns the code it licenses. For most software companies, the employee code is straightforward and the gaps are elsewhere.
- Employees. Under 17 U.S.C. 101, a work prepared by an employee within the scope of the job is a work made for hire, owned by the employer (source: 17 U.S.C. 101, work made for hire (Cornell LII)). Many companies also have signed invention assignment agreements.
- Contractors and freelancers. Commissioned work counts as a work made for hire only in nine listed categories (such as a contribution to a collective work or a compilation) and only with a signed written agreement (source: 17 U.S.C. 101, work made for hire (Cornell LII)). Otherwise the company owns contractor code only if the contractor assigned it, and a copyright transfer is not valid without a signed writing (source: 17 U.S.C. 204, transfers in writing (Cornell LII)).
- Offshore agencies and dev shops. The agency's contract decides who owns the code, and some agencies keep rights in their own frameworks and reusable components.
- Founder code from before the company existed. Code a founder wrote before incorporation belongs to the company only if the founder assigned it.
- Acquired code. If you bought a product or a company, the purchase agreement says what transferred.
Missing assignments are the most common fixable gap
The data marketplace's code guide says buyers need every contributor, contractors and agencies included, to have assigned their work to your company (source: program terms, Regulr buyer directory). If a contract is missing, the fix is usually a confirmatory assignment signed now, or leaving that contractor's modules out of scope. You decide the scope in writing before anything is shared.
Open-source code in your codebase: GPL, AGPL and commercial use
Almost every commercial codebase includes open-source code, either as dependencies or copied into the repo. Your own code is yours to license; the open-source parts keep their own licenses.
- GPL. The GPL v3 defines conveying as any propagation that enables other parties to make or receive copies, and section 10 says “You may not impose any further restrictions” on the rights it grants (source: GNU General Public License v3). Handing a buyer a repo that contains GPL code passes those rights along, so the buyer cannot get exclusive rights to those parts from you.
- AGPL. Section 13 of the AGPL v3 requires a modified version to offer its source to users who interact with it over a network (source: GNU Affero General Public License v3). If your product includes modified AGPL code, that is worth knowing before a buyer asks.
- Permissive licenses. MIT, BSD and Apache 2.0 code may be included, but its copyright and license notices must travel with it.
The practical step is a dependency inventory, often called a software bill of materials, plus a search for vendored directories and copied files. Buyers typically ask for that list and either leave third-party code out of the delivered dataset or flag it. Package manifests (package.json, go.mod, Cargo.toml, requirements files) are usually enough to start.
Remove secrets from git history and de-identify committers
Git keeps everything. An API key committed in 2019 and deleted the next day is still in the history a buyer would receive.
- Rotate first. GitHub's guidance says to treat exposed secrets as compromised and revoke or rotate them, noting that a rotated secret can no longer be used for access (source: GitHub Docs, removing sensitive data from a repository).
- Rewrite history if needed. GitHub recommends git-filter-repo for removing files or replacing text across history, and warns that rewritten commits may still be reachable in other clones and forks (source: GitHub Docs, removing sensitive data from a repository). A delivery copy can be cleaned without rewriting your working repo.
- Tokenize people. Committer names and emails, reviewer handles and names in comments are replaced with consistent tokens, so one engineer's commits still link together without naming them.
- Scan the rest. Test fixtures, seed files, logs and config files often contain real customer or employee data.
Customer code and customer data stay out
Two kinds of material sit in many SaaS repos and are not the company's to license.
- Code built for one customer. Custom integrations or forks built under a services contract may belong to that customer, depending on the contract.
- Customer data. Database dumps, fixtures copied from production and customer-specific configuration hold data you process for customers. Under GDPR Article 28, a processor may process personal data only on documented instructions from the controller (source: GDPR Article 28, processors), and most B2B contracts limit customer data to providing the service.
One more check for code hosted on GitHub: its terms say you own your content and grant GitHub a license to run and improve the service, including training AI features (source: GitHub Terms of Service (effective Apr 27, 2026)). That license is nonexclusive, so it does not stop you licensing your code, but a buyer asking for exclusivity should know it exists. The software and SaaS companies guide covers customer data under DPAs in more detail.
Advertised prices for source code and codebases
These are advertised or reported figures, not offers.
- Buyer program F: standalone codebases at $10K to $100K+, with up to $1M for a company's full operating record in one payment (source: program terms, Regulr buyer directory).
- One data marketplace's code guide: closure deals for code of about $10,000 to $100,000, and one platform listing a $5,000 baseline per repository (source: program terms, Regulr buyer directory).
- MIT Technology Review: one shut-down crypto startup's codebase sold for roughly $25,000, with its workspace data expected to bring about $15,000 (source: MIT Technology Review, data from shut-down startups (Oct 13, 2026)).
- Buyer program N, which buys codebases and operational data: “$100K to $1M” for company data (source: program terms, Regulr buyer directory).
What moves a codebase's price, in our reading of these sources: years of history, back-end languages, whether the code runs, whether PRs, reviews, CI and tickets come with it, and how much has to be cut for rights reasons. Our data value checker walks through the factors for a whole company.
How to prepare your codebase before you sell source code
| Step | What to do | Why |
|---|---|---|
| Inventory | List repos, languages, lines of code, first commit date, and whether PRs, CI and tickets are still available | Buyers price on size, age and linked history |
| Ownership | Find employee invention assignments and every contractor and agency contract | You warrant ownership in the license |
| Open source | Produce a dependency list and find vendored or copied code | Third-party code keeps its own license |
| Secrets | Rotate exposed credentials and clean the delivery copy's history | Old secrets stay in git history |
| People | Plan tokens for committers, reviewers and names in comments | De-identification keeps links without names |
| Customers | Find customer-specific code, fixtures and dumps | Customer data stays out |
| Approvals | Check your charter, investor agreements and any loan agreement | Some require consent to sell or license IP |
Once those are done, the code is ready for buyers to review. Regulr takes the description to several buyers and compares the offers for you; see how Regulr gets competing offers for a company's records, or compare the programs yourself in our buyer directory.
How Regulr is paid, and how we write these pages
Regulr is a sell-side advisor. When a business we introduce signs a license, we may be paid a fee by the buyer or through a program's referral terms. We list every program we can verify whether or not it pays us, order is never set by fees, and every figure is the company's own advertised term with a link to where it says so. Regulr has not closed a data deal yet, so nothing here describes our results.
Frequently asked questions
Where can I sell my source code?
There are two markets. Code marketplaces sell app templates and scripts to developers who want to reuse them. AI training-data programs buy or license a company's private codebase, with its history, to train and test coding models, and several of them price codebases separately from other records. Our buyer directory lists the AI programs and links to their published terms.
How do I sell my codebase to an AI company?
Start with an inventory: repos, languages, lines of code, the date of the first commit, and whether pull requests, reviews, CI runs and tickets are still available. Then confirm the company owns all the code, list the open-source code inside it, and clean secrets out of the history. Buyers review a description or sample and make an offer, and the code goes from your systems to the buyer you choose. You can sell it outright or license a copy and keep it.
How much can I get for my source code?
Advertised figures for code alone run from about $5,000 per repository to $100K+. One buyer program lists standalone codebases at $10K to $100K+, and one data marketplace reports closure deals for code of about $10,000 to $100,000. MIT Technology Review reported one shut-down startup's codebase selling for roughly $25,000. Code with years of linked tickets, reviews and incidents is what the larger full-company figures describe.
Can I sell code that contains GPL or AGPL libraries?
You can include your own code, but third-party open-source code keeps its license. The GPL says you may not impose further restrictions on the rights it grants, so a buyer cannot get exclusive rights to GPL-covered parts from you, and the AGPL adds obligations for modified code that serves users over a network. Buyers typically ask for a dependency inventory and leave vendored third-party code out or flag it. Permissive licenses such as MIT and Apache 2.0 still require their notices to travel with the code.
Do I own code written by contractors?
Not automatically. US copyright law treats code an employee writes within the scope of the job as a work made for hire, but commissioned work qualifies only in nine listed categories with a signed agreement, and a transfer of copyright needs a signed writing. Code from freelancers or an outside agency is usually yours only if a contract assigns it. Buyers ask for those assignments, so find them before you list the code.
How do I remove secrets from git history before selling a codebase?
Rotate or revoke every exposed secret first, because GitHub's own guidance says a revoked or rotated secret can no longer be used for access. Then rewrite history with a tool such as git-filter-repo and check that clones and forks are cleaned too. Many buyers also scan for and strip secrets during de-identification, but delivering clean history is the safer path.
Is it better to sell my code outright or license it?
It depends on whether you still need it. A nonexclusive license of a copy lets you keep running the product and license the same records again later. An outright sale or an exclusive license usually pays once and ends that option. One data marketplace notes that a company winding down usually sells, while an operating company licenses.
Sources
Program terms checked against their own pages on October 15, 2026, and one data marketplace's code and SaaS guides rechecked on October 18, 2026; our buyer directory lists the programs and links to their published terms. Statutes, licenses, GitHub documentation and MIT Technology Review read on their own pages on October 18, 2026.
- program terms, Regulr buyer directory
- 17 U.S.C. 101, work made for hire (Cornell LII)
- 17 U.S.C. 204, transfers in writing (Cornell LII)
- GNU General Public License v3
- GNU Affero General Public License v3
- GitHub Docs, removing sensitive data from a repository
- GitHub Terms of Service (effective Apr 27, 2026)
- GDPR Article 28, processors
- MIT Technology Review, data from shut-down startups (Oct 13, 2026)
Brian Boesen · Founder, Regulr AI
Brian runs Regulr AI, which works for established businesses that want to license de-identified records to AI companies. He checks each program's published terms against its own pages and updates these guides when they change. Last updated October 18, 2026.
This page is general information, not legal advice, and Regulr is not a law firm. Rules vary by state, by profession and by contract, and they apply to your facts, not to a category. You approve exactly what is in scope before anything is shared.
Keep reading