# Sell your source code to AI companies for training coding models

> A business can license a copy of its private source code, ideally with its commit history, tests, code reviews and linked issues, to AI companies training coding models and agents. Private code in less common languages, older systems and specialized domains is worth more, because it is scarce in public repositories. Secrets, credentials, customer data and third-party code must be removed first, and the business must actually own the code, which is not automatic for contractor-written or client work.

## What this covers and where it lives

Source code includes your applications, internal tools, scripts, infrastructure configuration, database schemas and the tests that go with them. Most of it sits in [GitHub](https://pergoladata.com/sell/github) or a similar hosted repository, with the surrounding history in issue trackers such as [Jira](https://pergoladata.com/sell/jira) and design documents in [Confluence](https://pergoladata.com/sell/confluence).

Software companies are the obvious holders, but code also accumulates at [MSPs](https://pergoladata.com/industries/msps-and-it-services) (automation and scripts), [engineering firms](https://pergoladata.com/industries/construction-and-engineering) (calculation tools and integrations) and any business that has built its own systems over the years.

## What AI companies use source code for

- **Coding models** that write and complete code, which need large amounts of real, working code beyond what is public.
- **Coding agents** that fix bugs and implement features. They learn best from real tasks: an issue, the code change that resolved it and the tests that confirm it.
- **Code review tools,** trained on pull requests and the comments reviewers made.
- **Modernization tools** that translate or upgrade older code, which need examples of legacy languages and frameworks.
- **Evaluation sets,** where private code the model has never seen tests whether it really works.

## What makes a codebase more valuable

- **Full history.** Commit history with meaningful messages, pull requests, review comments and linked issues, rather than a single snapshot.
- **Tests.** Code with tests that run lets a buyer check whether a model's change actually works.
- **Scarce languages and domains.** Legacy languages, embedded and industrial software, financial or healthcare business logic, and niche frameworks are less represented in public code.
- **Real production code** that has been maintained for years, not prototypes.
- **Size and breadth,** across many repositories and contributors.
- **Builds that work,** so the code can be compiled and run in a buyer's environment.

## What has to be removed first

- **Secrets and credentials:** API keys, passwords, private keys, tokens and connection strings, in current files and throughout the commit history, where deleted secrets often still live. Any secret found should also be rotated, whether or not you sell.
- **Customer and personal data** in test fixtures, seed databases, sample files, logs and comments.
- **Third-party code** copied or vendored into your repositories, including open-source code under licenses that impose conditions. Your license to a buyer can only cover code you own.
- **Identifying details,** such as your company and product names, internal hostnames, email addresses in commit metadata and developer names, so buyers can't tell whose code it is.
- **Security-sensitive material,** such as code describing how your production systems are secured, which you may prefer to leave out.

## Legal checks specific to code

- **Who owns the code.** Code written by employees as part of their job generally belongs to the employer in the US. Code written by contractors may not, unless their agreement assigned it to you.
- **Client work.** If you build software for clients, their contracts often assign ownership of that code to them. Only code you kept rights to can be licensed.
- **Open-source obligations** for third-party code mixed into your repositories.
- **Customer contracts** that restrict use of anything built with or from their data.
- **License scope,** such as exclusive or non-exclusive terms and restrictions on reproducing your code. See [exclusive vs non-exclusive data licenses](https://pergoladata.com/questions/exclusive-vs-non-exclusive-data-licenses) and [what is in a data license agreement](https://pergoladata.com/questions/what-is-in-a-data-license-agreement).

> This is general information, not legal advice. Pergola's rights review checks ownership and contracts with you, with your counsel where needed, and excludes code you can't license before signing.

## Frequently asked questions

### Will licensing our code let a model reproduce our product?

Models trained on large amounts of code learn patterns rather than copying a single product, and buyers never learn whose code it is. License terms can also address reproduction. Code that is central to your competitive position can be left out.

### Is old code in outdated languages worth anything?

Often more than you'd expect, because modernization tools need legacy examples and little of that code is public.

### Do we need to include our issue tracker?

It's not required, but issues linked to the commits that resolved them are among the most valuable things a codebase can include. See [Jira](https://pergoladata.com/sell/jira).

## Related

- [Sell your GitHub code and repository history to AI companies](https://pergoladata.com/sell/github)
- [Sell your Jira issue history to AI companies](https://pergoladata.com/sell/jira)
- [Sell your Confluence wiki and documentation to AI companies](https://pergoladata.com/sell/confluence)
- [What is in a data license agreement for AI training?](https://pergoladata.com/questions/what-is-in-a-data-license-agreement)
- [Exclusive vs non-exclusive data licenses: which should I choose?](https://pergoladata.com/questions/exclusive-vs-non-exclusive-data-licenses)
- [How MSPs and IT service providers sell data for AI training](https://pergoladata.com/industries/msps-and-it-services)

---

Pergola Data Partners. Last updated 2026-10-14. Web version: https://pergoladata.com/data/source-code

Get a free, confidential valuation: https://pergoladata.com/#contact

General information, not legal advice. Pergola reviews each seller's contracts, policies and applicable law before anything is sold.
