Guides7 min read

Code Datasets for AI: Why Coding Labs License Private Codebases

Troveo Team

Troveo

If you’re training a coding model or a coding agent, you’ve already used the public code. So has every other lab. The data that’s left, and the data that teaches a model to work like an engineer, is private code with its history attached. Read on to find out the three kinds of code data labs train on, why public repositories aren’t enough, what makes a private codebase useful, what to check before you license one, and where to get it.

Article banner reading Code Datasets, on code data for AI training

The three kinds of code data

Kind of dataWhat it teaches a modelWhere it falls short
Public repositories and open code datasetsSyntax, common patterns, how popular libraries get usedEvery lab has them, and the license on each repository still applies
Benchmarks and expert-written tasksHow to solve a defined problem with a known answerSmall, expensive to write, and a model may have already seen the public ones
Private codebases with their historyHow a team builds, reviews, breaks and fixes a real product over yearsHas to be licensed from the company that owns it, with the rights checked
The three kinds of code data labs train on, what each teaches a model, and where each falls short.

The best-known open sets sit in the first two rows. The Stack and CodeSearchNet collect source code from public repositories, and SWE-bench turns real issues from open-source projects into tasks. They’re where most teams start.

Why public repositories aren’t enough

The last generation of coding models learned from public repositories. Labs want the next generation to work like an engineer (take a vague ticket, read an unfamiliar codebase, make a change, survive code review, and fix what breaks in production). Public code teaches the syntax. It doesn’t teach the process, because the process was never published.

What’s missing is the design argument in a pull request, the incident that led to a refactor, and the three failed approaches before the one that shipped. That record lives inside companies, in the commit history and in the tickets and reviews linked to it.

Coding labs like Magic, Cognition, Poolside and Factory, and frontier labs like OpenAI, Anthropic and Google DeepMind, are all building models and agents that write software. They face the same gap, and public code doesn’t close it.

What makes a private codebase useful

A snapshot of source code with no history is worth little to a training team. Six things raise the value.

  • The full commit history. It shows how the code evolved, what broke and how it was fixed.
  • Pull requests and code review. They capture what was accepted, what was rejected and why.
  • Tickets linked to the code. A linked ticket connects a request to the change that resolved it and to the outcome.
  • Design docs, incident notes and runbooks. They record the reasoning behind decisions.
  • A setup you can run. CI config, Dockerfiles and setup instructions let you execute the code, which is what makes it usable for agents.
  • A production track record. Code that ran real workloads carries real edge cases and real tradeoffs.

The product and the language matter too. A complex product a team built in-house and ran in production is worth more than another simple app, and a private repository in a language that’s thin on public GitHub is worth more than one in a language the models have already seen plenty of. Our guide to what kind of code AI labs pay for covers the languages and signals buyers ask for.

The value is highest when the records link. A ticket, the docs, the code change and the review for the same piece of work let a model follow one job from the request to the merged pull request. Our guide to training data for AI agents covers why that connected record matters.

Training, evaluation and environments are three different uses

Labs do three things with licensed code, and each one is a separate right in the license.

  1. Training. The model learns from the code and its history.
  2. Evaluation. The code is held back and used to test the model on work it hasn’t seen. Private code is useful here because it was never public.
  3. Building environments. A real repository with its tickets becomes a place where a coding agent practices and gets scored. Our guide to what RL environments are covers how that works, and our guide to RL environment companies covers who builds coding environments.

Decide which of the three you need before you negotiate, and get each one named in the agreement.

What to check before you license a code dataset

Code has rights problems other data doesn’t, and they become yours once you train on it. Seven checks cover them.

  1. Does the company own all of it? Every contributor, contractors and agencies included, should have assigned their work to the company.
  2. Are the open-source dependencies listed? Permissively licensed libraries are usually fine. Copyleft code and anything that restricts redistribution needs to be identified.
  3. Are secrets and credentials out of the history, along with customer data in seed files and fixtures?
  4. Have names and personal details in tickets and commit messages been replaced with pseudonyms?
  5. Is anything in it under a customer contract or a confidentiality agreement? That stays out.
  6. Can you run it? Ask for the build and test setup with the code.
  7. Is the license exclusive, and which uses does it name? Our guide to exclusive vs non-exclusive data licenses covers the tradeoff.

Our guide to rights-cleared training data covers what clearing a dataset takes in every category.

Where to get code datasets

You have three routes, and most labs use all of them.

  1. Start with open datasets and public repositories. They’re free and large, and every other lab has them.
  2. Pay engineers to write tasks. Experienced developers write problems, solutions and tests to your brief. You control the format, and every hour is billed. Our guide to AI data collection companies covers the vendors that work to order.
  3. License private codebases from the companies that built them. Operating companies hold years of engineering history and license it selectively (a retired product line, a legacy system that’s been replaced, an internal tool with years of tickets behind it). Our guide for companies on how to sell source code to AI labs covers the owner’s side.

Where Troveo fits

Troveo is a data licensing marketplace, and we’ve paid rights holders more than 20 million dollars. Our business data program covers code alongside documents, messages and operating systems. Companies can license their codebases through us with the history attached, after contributor rights are confirmed, open-source dependencies are listed, and secrets and personal details are out. You see an anonymized snapshot of what a company holds before anything is exported, and you sign one agreement with us. Tell us what your coding model needs to learn from and we’ll show you what we hold.

Frequently asked questions

What is a code dataset for AI training?
A collection of source code used to train or test a model. It comes in three kinds: public repositories and open datasets, benchmarks and expert-written tasks, and private codebases licensed with their commit history, reviews and tickets.
What are examples of open code datasets?
The Stack and CodeSearchNet collect source code from public repositories, and SWE-bench turns real issues from open-source projects into tasks. They’re free and widely used, so every lab trains and tests on the same ones.
Why do AI labs license private codebases?
Because private code with its history shows how engineers work. The commit history, pull requests and linked tickets record what broke, what was rejected and why, and none of that was published with public code.
What makes a codebase valuable for training a coding agent?
Full commit history, code review, tickets linked to changes, design docs and incident notes, a build and test setup you can run, and a record of running in production. The value is highest when those records link to each other.
What rights do you need to train a commercial model on licensed code?
A license from the owner that names each use you need (training, evaluation, building environments), with contributor assignments confirmed and open-source dependencies listed. This isn’t legal advice, and your counsel should review the agreement.
Where can AI labs license private code for training?
From the companies that built it, either directly or through a marketplace that has signed them. A marketplace lets you review an anonymized snapshot first and license from many companies under one agreement.
Is public GitHub code enough to train a coding model?
It’s enough to teach syntax and common patterns. It doesn’t show how a team builds, reviews and fixes a real product, because that record was never published. Every lab also has the same public code, so it doesn’t set a model apart.
Does the programming language of a codebase matter?
Yes. Buyers ask first for back-end languages (C++, C#, Go and Rust). A private repository in a language that’s thin on public GitHub is also worth more, because models have seen less of it.

Related articles

Back to Resources