How to sell GitHub repositories for AI training.

Who buys private code, what they have paid, whether the code is yours to license, and how your engineers export and clean a copy. Checked 17 November 2026. If your company has 30 or more office employees, Allied arranges a direct license with an AI lab and gets you a written offer.

I

The short answer

Yes. A startup can license a copy of its private code repositories to an AI lab or to a company that supplies labs with training data. The company grants a written license to a cleaned copy. It keeps ownership, and the originals stay in GitHub.

GitHub does not stand in the way. Its Terms of Service say: “You own Your Content.” They also say GitHub considers the contents of private repositories confidential to you, and that its staff will not access private repository content without your consent except in listed cases such as security and legal compliance.1

Three things decide whether a sale can happen. The code has to belong to the company, not to a contractor or a client. Secrets and personal details have to come out of the history. And someone with authority has to sign. The rest of this page takes them in order, then covers price, timing and what to do if the company is closing.

The short version of the checklist lives on the code repository page. Every system Allied covers is on the sell page.

What sits in the repositoryWhere it is storedWhy a lab wants itWhat your team removes first
Source files and commit historyGit itself; a mirror clone carries it11How a codebase changed, one reasoned step at a timeKeys and tokens in old commits; author emails
Pull request discussions and review commentsGitHub’s database, not the Git history12A reviewer’s objection and the fix that followedNames, handles, links to internal tools
Issues and bug reportsGitHub Issues, Jira or LinearThe problem that started the changeCustomer names and pasted log lines
CI runs and test resultsActions logs, CircleCI, JenkinsWhether a change passed, which lets a grader score an attemptEnvironment variables printed in logs
Design docs, wikis and runbooksWiki repositories, Notion, ConfluenceWhy the system is built the way it isInternal hostnames, IP addresses
II

What company data AI labs are buying right now

The public record shows buyers paying for the working record of a company, not just its files. Code sits near the top of that list because labs are training agents to do software work.

Turing announced Project Lazarus in March 2026 for founders and engineering leaders to share private codebases and “the operational artifacts around them (Jira tickets, PRDs, architecture docs, support threads)” to train frontier models. Its current site describes it as preparing a company’s operating record and licensing it to frontier AI labs.23

micro1 lists software and engineering as one of the functions it licenses data from: “Source code documentation, engineering workflows, bug tracking, product planning, and technical knowledge bases.” It says it wants established companies with 30+ full-time employees.4

Mercor’s company data page shows GitHub among the tools a company can connect, described as “Repositories, commits, PRs, and issues,” next to Slack, Gmail, Salesforce and Notion.5

Data vendors resell what they gather. Defined.ai says it delivered 1,000+ closed-source, production-grade repositories with commit histories to an unnamed AI model builder, in 5 days. Labelbox says it works with fully defunct startup codebases to train and evaluate AI systems.68

Code is rarely bought alone. A founder told MIT Technology Review he netted roughly $25,000 for his code base and expected about $15,000 more for workspace data in Google, Notion, Figma and Slack. The largest reported purchase was Google’s for Spirit Airlines’ records in bankruptcy, which included 100 million emails. The price tag: $10 million.7

For the full list of record types, see what data AI companies buy and who buys AI training data.

III

Why the history matters more than the code

A lab can read open-source code already. What a private repository adds is the path: the bug report, the first attempt, the reviewer who said no, the second attempt and the test run that finally passed. That sequence is what a coding agent has to learn to repeat.

Turing’s launch post priced it that way. Modern codebases paid “$1,000 per PR, up to $10K per codebase,” while legacy codebases in COBOL, .NET or Java were “typically $10K–⁠$100K+ depending on complexity.” Tickets, specs and docs paid “$50 per artifact when bundled with a codebase.”2

Labelbox describes the same preference in words. It favors systems with several contributors, frequent pull requests and an active issue history, spanning frontend, backend, machine learning or infrastructure.8

So a squashed, single-commit copy of the main branch is worth far less than the same code with its history. Before anyone describes the repositories to a buyer, check that the history was not rewritten away during a cleanup years ago.

IV

Is the code the company’s to license

Most of a startup’s code belongs to the startup, but not automatically all of it. Your counsel confirms this before any offer is accepted.

Employees are the simple case. US copyright law treats “a work prepared by an employee within the scope of his or her employment” as a work made for hire, owned by the employer.9

Contractors are not. Software written by an outside developer is not on the statute’s list of commissioned works that can be made for hire by agreement, so the company owns it only through an assignment. A transfer of copyright ownership is not valid unless it is in writing and signed by the owner of the rights.910

Pull the signed contractor agreements for anyone with commits in scope. Founders who wrote code before the company existed need the same check: their early commits belong to the company only if they assigned them.

Client work is a separate problem. An agency or consultancy that built software for clients usually delivered it under contracts that give the client the code. Those repositories stay out unless the client agrees in writing.

Third-party code also stays out. GitHub’s terms put the duty on the account holder: if you post content you did not create, you are responsible for ensuring you have the right to post it and for complying with any applicable licenses. Vendored libraries, copied snippets and forks of open-source projects are not the company’s to grant. Exclude those directories, or list them so the buyer can.1

Customer contracts can add limits. Enterprise customers sometimes negotiated confidentiality over integration code written for them. Read those before including a customer-specific branch. The general legal picture is in is it legal to sell company data and the license terms are in the licensing agreement guide.

V

Getting the repositories out of GitHub

Your own engineers run the export. Allied never sees, reads or receives the code. It sees only a description of the repositories that you approve.

The code and its history come out with Git. GitHub’s documentation says a mirror clone backs up a repository “including the revision history,” and that Git Large File Storage objects have to be pulled separately with git lfs fetch --all.11

The conversation does not come with it. Pull request review comments are, in GitHub’s words, “comments made on a portion of the unified diff during a pull request review,” and they live in GitHub, not in the Git history. Issues and their comments are the same. A buyer who wants the review threads needs them pulled through the API.12

An organization migration archive is the other route. GitHub’s API includes repository metadata by default unless you set exclude_metadata, and it can lock the repositories while the archive is built. Migration archives are automatically deleted after seven days, so download the archive promptly.13

GitHub’s backup guide warns that migration archives do not include all data related to a repository, such as Large File Storage objects, discussions or packages.11

GitLab, Bitbucket and Azure DevOps each have their own export route. The test is the same everywhere: open the copy and confirm the commits, the pull request threads and the issue history are all present, with dates.

VI

How code is anonymized before it is licensed

The cleaning happens inside your company, on a copy, before anything leaves. Buyers run their own checks too. MIT Technology Review reported that suppliers employ data scientists to scrub personally identifiable information, and that buyers say they scrub as well. Neither replaces your own pass.7

  1. Find every secret in every commit

    GitHub secret scanning “scans your entire Git history on all branches of your repository for hardcoded credentials,” including API keys, passwords and tokens. A key deleted from the current code still sits in the commit that added it.14

  2. Rotate first, then rewrite the copy

    GitHub says that if the sensitive data is a secret, “as a first step you need to revoke and/or rotate that secret.” For the licensed copy, rewrite history with git-filter-repo so the old values are gone too. GitHub warns that rewriting does not reach existing clones, forks or pull requests that reference the old commits, which is one more reason to clean a separate copy.15

  3. Replace author names and emails

    Every commit carries a name and an email address. Git’s mailmap file can map author and committer names and email addresses to replacements, so the same engineer becomes the same placeholder in every commit and the history still reads as one person’s work.16

  4. Search the code for customer data

    Test fixtures, seed files, sample exports and log snippets often hold real customer records. So do comments like “fix for the Acme account”. Replace them, or drop the files.

  5. Strip internal infrastructure details

    Hostnames, internal IP addresses, cloud account IDs and webhook URLs show how your systems connect. They teach a model nothing and expose you.

  6. Clean the issues and review threads separately

    Issue text holds pasted stack traces with user IDs, and screenshots that text tools cannot read. Drop attachments unless someone has looked at each one.

Your team approves a sample before the full copy goes to the buyer. The method for every system is in how to anonymize company data for AI training.

VII

What a code repository is worth

Buyers do not agree on price yet. Nick Heiner, who leads Surge AI’s work on training environments, told MIT Technology Review that buyers quote wildly different numbers, because valuations rest on “research theses” estimating how many useful tasks come from, say, 100,000 lines of code.7

Published numbers set a floor and a ceiling. Turing’s launch list capped modern codebases at $10K each. The founder in MIT Technology Review’s report netted roughly $25,000 for his. micro1, which licenses records across a whole company, says payments typically range from $100K to over $3M.274

The gap is scope. A repository licensed on its own prices like the first two. A company that also licenses its tickets, design docs, chat history and CRM is selling the context around the code, and that prices like the third. Allied’s own figure: old operational business data could be worth $100K–⁠$2M. More on price is in what company data is worth.

  1. Years of commits

    A codebase that has been maintained for years shows how a product changed and how old decisions were undone. A repository started last year shows much less.

  2. Reviewed pull requests

    Turing priced modern code per pull request. Merged changes with real review comments are the unit buyers count.2

  3. Linked tickets and test runs

    A commit that names the issue it fixed, plus a CI run that shows the result, gives a buyer a task with a known answer.

  4. Several contributors

    Labelbox looks for systems built by several people with frequent pull requests.8

  5. Code written by people

    Code written before AI coding assistants were common shows how engineers solved problems unaided. Recent code built mostly by a model teaches a model less.

VIII

How long it takes to sell company data to an AI lab

The clock depends mostly on your own team: how fast it can confirm ownership, export and clean the copy. Buyer programs publish their side of it.

Mercor says payment is issued by wire on delivery of the anonymized dataset to the buyer, which “typically occurs within 2-4 weeks of the signed agreement.”5

micro1 says it has 30 days to review and approve data after transfer, then pays within 30 days of invoicing.4

On a direct license arranged by Allied, a written offer naming the lab follows one to two weeks after you sign with Allied. Payment arrives by wire 30 to 60 days after the lab accepts delivery. The license is non-exclusive, so the same repositories can be licensed again.

  1. List the repositories

    Name each one with its first commit date, commit and pull request counts, languages and the tracker it links to. Mark anything built for a client or copied from open source.

  2. Confirm ownership

    Pull the employment and contractor agreements for everyone with commits in scope. Fix any missing assignment before the offer stage, not after.

  3. Request an offer

    Answer a few questions on the request form. If the records fit, a discovery call follows.

  4. Export and clean a sample

    Your engineers mirror one or two repositories, run the secret scan, rewrite the copy and replace author details. The buyer reviews the sample.

  5. Sign and deliver

    You sign the license with the lab and send the full cleaned copy straight to it. Then payment follows on the terms above.

The general process for every record type is in how companies license data to AI labs. How Allied works.

IX

What to do with the code when shutting down a startup

Do not delete the GitHub organization. GitHub says deleting it permanently removes all repositories, forks of private repositories, wikis, issues and pull requests, and that after deletion it cannot restore your content.17

Stopping the bill does not require deletion. GitHub’s own tip is to downgrade the organization to GitHub Free instead of deleting it. Archiving the organization makes it read-only, which keeps a departing engineer from changing the history.17

Then take a full copy the company controls: mirror clones of each repository and an export of issues and pull request threads. Keep admin access with a person who will still answer the phone after the last payroll.1113

Code sales are now part of normal wind-downs. MIT Technology Review reported that 47% of SimpleClosure’s deals now include code or data sales.7

Someone with authority has to sign: the board, or the assignee or trustee once one is appointed. MIT Technology Review also reported that the proceeds typically flow to senior creditors and investors.7 See selling startup data when shutting down, how to wind down a startup and the shutdown checklist.

X

The risks, plainly

  1. A live credential leaks

    The usual cause is a key that was rotated in one system and not another. Rotate everything the scan finds before the copy leaves, whether or not you rewrite it.

  2. Code you did not own goes out

    Contractor code with no signed assignment, client work and vendored libraries. List them and exclude them.

  3. Your product’s weak spots are on show

    A commit history is a record of bugs. The license should limit use to training and evaluating models, forbid redistribution and reidentification, and set a deletion date.

  4. A competitor’s model learns your approach

    Keep core systems out if that matters more than the price. Many sellers license older or retired codebases and keep the current one.

  5. Exclusivity

    An exclusive grant stops you licensing the same history twice. Non-exclusive terms keep that open.

XI

Questions about selling code repositories

Can I sell my startup’s private code repository to AI labs?

Yes, if the company owns the code, the secrets and personal details are removed from the history, and someone with authority signs. What changes hands is a license to a cleaned copy, not the repository itself. GitHub’s terms say the account holder owns its content. Suppliers that serve AI labs, such as Turing and Mercor, take private code with its commit, pull request and issue history.

What company data are AI labs buying right now?

Code with its history, issue trackers, design docs, chat and email archives, CRM records and support tickets. Buyers want the record of how work was actually done, so linked records from several systems are worth more than one system alone.

How is company data anonymized before it is licensed to AI labs?

The company’s own team works on a copy inside its own systems. For code that means scanning every commit for secrets, rotating them, rewriting the copy’s history, replacing author names and emails, and removing customer records from fixtures, logs and issue text. A sample is approved before the full copy is sent. Allied never sees the data.

What should we do with company data when shutting down a startup?

Do not delete the GitHub organization or cancel workspace tools before taking a full copy. Downgrade or archive the GitHub organization instead, export the repositories with their pull request and issue history, and keep admin access with someone who stays reachable. Then decide whether to license the records before they are deleted.

How long does it take to sell company data to an AI lab?

Most of the time is your own team’s: confirming ownership, exporting and cleaning a sample. On a direct license arranged by Allied, a written offer naming the lab follows one to two weeks after you sign with Allied, and payment arrives by wire 30 to 60 days after the lab accepts delivery.

Can a developer sell code written for an employer?

No. Code an employee writes in the course of the job belongs to the employer. Only the company can license it.

Do contractors’ commits belong to the company?

Only if each contractor signed a written assignment. Without one, the contractor usually still owns the copyright, and those commits should be left out until the assignment is fixed.

Can we license public or open-source repositories?

Code that has been public is already available to labs, so buyers pay little or nothing for it. Open-source code you copied in belongs to its authors under its own license and should be excluded.

Does licensing the code give the lab our product?

No. The license limits use to training and evaluating models and forbids redistribution. You choose the repositories and can keep core systems out.

Is it better to sell the code alone or with tickets and docs?

With them, where you can. The tickets and design docs explain why each change was made, which is the part buyers value most.

XII

Sources

  1. GitHub, “GitHub Terms of Service” (effective April 27, 2026), sections D.3 and E
  2. Turing, “AGI Advance: Weekly AI & AGI Insights (Mar 24, 2026)”, announcing Project Lazarus
  3. Turing, Project Lazarus site, read 17 November 2026
  4. micro1, “Monetize your company’s operational data” (company data partnerships page), read 17 November 2026
  5. Mercor, “Mercor Data” (company data page), read 17 November 2026
  6. Defined.ai, case study “Agentic Code from Code Repositories” (vendor’s own account)
  7. Matthew King, “AI labs are buying data from dead startups to train their models,” MIT Technology Review, 13 October 2026 (reporting)
  8. Labelbox, “From dormant codebases to lasting value,” 20 January 2026
  9. 17 U.S. Code § 101, definition of “work made for hire” (Cornell LII)
  10. 17 U.S. Code § 204(a), execution of transfers of copyright ownership (Cornell LII)
  11. GitHub Docs, “Backing up a repository”
  12. GitHub Docs, “REST API endpoints for pull request review comments”
  13. GitHub Docs, “REST API endpoints for organization migrations”
  14. GitHub Docs, “About secret scanning”
  15. GitHub Docs, “Removing sensitive data from a repository”
  16. Git documentation, “gitmailmap”
  17. GitHub Docs, “Deleting an organization account”

This page is general information, not legal advice. Whether your company can license its code depends on your employment and contractor agreements, your customer contracts and the licenses of any third-party code. Vendor terms and buyer programs change; read the current versions. Ask your own counsel.

Find out what your code history is worth.

A few questions. About two minutes. How Allied works.

Request an offer