Case study / Legacy codebase as AI training data

From a legacy codebase to AI-processable training data

Through thorough cleaning, a legacy system closed years ago became clean, safe, AI-processable training data that can be licensed on a non-exclusive basis.

10+ years
of development
Tens of thousands
of commits
Several thousand
linked tickets
Closed years ago
no longer in production

At a glance

The case in brief

The client
The owner of a legacy system closed years ago and no longer in production.
The problem
A well-documented codebase developed for more than a decade that no longer had a role in operations.
The challenge
Personal data, customer data and forgotten passwords across the whole history, and team members' names in the code, the commits and the tickets.
The solution
A rights check, a clear scope rule, multi-pass anonymization with stable pseudonyms, and no other change.
The result
Clean, safe, AI-processable training data that can be licensed on a non-exclusive basis. Every requested data cut was delivered to specification.

The problem

What can an owner do with a closed but valuable codebase?

It can be licensed as AI training data. A system that no longer serves any purpose, but was developed over many years with rich documentation and a deep history, is excellent raw material for AI training, once it has been cleaned thoroughly.

The source was a legacy system closed years ago and no longer in production use, which had been in use and under development for more than a decade.

It is well documented, with tens of thousands of commits and several thousand tickets, most of them linked to commits. The code no longer had a role in operations, but its history still shows how experienced engineers built and maintained a real system.

Excellent raw material for AI training

AI developers look for specific qualities when they train and evaluate coding models. A system developed over many years can offer all of them.

A large, real system
Many interacting parts built for real use, not a small project or a single component.
Documentation quality
Documentation that explains what the code does and why, so the material can be understood and checked.
A deep history
Changes recorded over a long period, so the evolution of the system can be followed.
Tickets linked to commits
Most changes are tied to the work item behind them, so the code comes with the intent that produced it.

The challenge

Why is handing over the code not enough?

Because any training or licensing requires thorough cleaning first, and nothing that makes the codebase valuable may be lost along the way.

  • Sensitive data across the whole history

    Personal and real customer data could have ended up in the code or its history. It has to be found everywhere, not only in the latest version.

  • Forgotten security elements

    Internal infrastructure identifiers and passwords once stored in plain text. They may still be in use, or could cause harm even if they are not.

  • Names and copyright

    Team members' names appear in the code, the commits and the tickets. Whose name stays as author is a copyright question, and AI training needs the roles.

  • Rights and authenticity

    Without clear ownership of the code there is nothing to license, and the value of the corpus lies in its authenticity, so nothing may change beyond anonymization.

The solution

How did the codebase become licensable training data?

With a repeatable, verifiable preparation: cleaning first, then five steps that apply the same rules to every copy.

What goes in and what comes out

Illustration, ribbon widths are not measured data. Source code, commits, tickets and documentation pass through cleaning and become licensable training data, while sensitive elements are removed or anonymized.

Cleaning comes first

No sensitive data may leave

Before any training or licensing, the data must be cleaned thoroughly. All personal and customer data has to go, including real customer data that ended up in the code or its history.

Sensitive security elements left in the source code have to go as well: internal infrastructure identifiers, and passwords that were once stored in plain text in code or configuration. They may still be in use, or could cause harm even if they are not.

In the code, the commits and the tickets, team members' names are replaced by stable pseudonyms. Because of the authors' moral rights under copyright law, we keep the mapping. Even more important for AI training is knowing which team member worked in which role, and that is preserved.

Before and after

Before

commit fedcbaeb
Author: Jane Sample <jane.sample@example.com>
Ticket: Fix export error
Role: backend developer
db_password = "spring"
host = srv.internal.example
customer_email = "contact@customer.example"

After

commit acebdfea
Author: Developer Delta <delta@pseudonym.invalid>
Ticket: Fix export error
Role: backend developer
db_password = [removed]
host = [removed]
customer_email = [anonymized]
Fictional, illustrative example. A stable pseudonym replaces the real name, the role and the ticket stay, the password and the internal identifier are removed, and customer data is anonymized. After the rewrite the commit hash differs too.

Our method

A repeatable, verifiable preparation process

The package had to be safe to share and still faithful to the original. Every step is repeatable, so the same rules apply to every copy.

  1. Rights check

    We verified that the code was created by employees and that the owner can license it, with written assignments where they were needed.

  2. A clear scope rule

    Fictitious test data and public company registry data stay in the package, and real customer data is anonymized. Whether the names and contact details of commit authors and of team members in the tickets need to be anonymized is a matter of decision and consent. In this case, we used stable pseudonyms. Whose name stays in the code and the version control system as author is a copyright question. Either way, for AI training it is far more important to know who took part in the process, in what role, and what their responsibilities and tasks were.

  3. Multi-pass anonymization

    A repeatable pipeline removes secrets and internal infrastructure details, anonymizes personal and customer data, and replaces author identities with pseudonyms. Automated secret scanning covers the full history, and a build test runs after the rewrite.

  4. Nothing changed beyond anonymization

    We did not refactor, reformat or otherwise alter the code or the history. The value of the corpus lies in its authenticity.

  5. A watermark when there are several licensees

    Where there are several buyers, we recommend watermarking for traceability. Each licensee then receives its own copy, with its own salt and pseudonym numbering, so pseudonyms and commit hashes differ between licensees, while staying consistent within each copy. Every copy is recorded in an internal register.

What stays and what changes

Stays in the package
  • Source code and its version history
  • Tickets linked to the commits
  • Fictitious test data
  • Public company registry data
  • The role, responsibilities and tasks of each pseudonymous team member
Anonymized or removed
  • Personal and real customer data
  • Passwords and keys, including any once stored in plain text in code or configuration
  • Internal infrastructure identifiers
  • Real personal names, replaced by stable pseudonyms in the code, commits and tickets
The scope rule applied by the anonymization pipeline. The owner decides on ambiguous cases.

Delivery

Prepared exactly to the licensee's specification

AI training data is only useful in the form the licensee needs it. The scope, structure and format of each data cut follow the licensee's specification.

We produced every requested data cut quickly and to specification.

The result

What did the client gain?

The prepared corpus can be licensed on a non-exclusive basis.

A system that no longer served any purpose became clean, safe, AI-processable training data. The work was worth it for both the client and the commissioning party.

  • The owner

    A system that no longer served any purpose became a corpus that can be licensed on a non-exclusive basis, and the owner stayed in control.

  • The licensee

    Every requested data cut arrived quickly and to specification, with authentic code and history, unchanged beyond anonymization.

  • The team members

    Stable pseudonyms replace their names, the mapping is kept because of the authors' moral rights, and it remains clear who worked in which role.

The value is in the history, not only in the final code.

Lesson from the project

Lessons

What should an owner know?

  1. The value is in the history, not only in the final code. Documentation, a deep history and tickets linked to commits are what make a corpus useful.
  2. Cleaning is not optional. Personal data, customer data and forgotten credentials have to be found across the whole history, not only in the latest version.
  3. Anonymization is a process, not a search and replace. It needs explicit scope rules, repeatable passes and checks.
  4. The owner stays in control, and with several licensees every copy can be traced.
  5. Rights come first. Without clear ownership of the code, there is nothing to license.

FAQ

Frequently asked questions

What happens to personal data?

All personal and real customer data is removed, anonymized or pseudonymized across the whole history, not only in the latest version. Fictitious test data and public company registry data stay in the package.

What happens to team members' names and authorship?

In this case, stable pseudonyms replace team members' names in the code, the commits and the tickets. Because of the authors' moral rights under copyright law we keep the mapping, and the role each person worked in is preserved.

What kind of codebase is suitable as AI training data?

A large, real system with good documentation, a deep history and tickets mostly linked to commits.

Does the code change during preparation?

No. Beyond anonymization we do not refactor, reformat or otherwise alter the code or the history, because the value of the corpus lies in its authenticity.

Who decides what stays in the package?

The owner. The anonymization pipeline follows a clear scope rule on what stays and what changes, and the owner decides on ambiguous cases.

What happens when there are several licensees?

We then recommend watermarking for traceability. Each licensee receives its own copy, and every copy is recorded in an internal register.

Let's talk about your codebase

If you also own a similar codebase and would like to know more about the process, get in touch with us.

After a free initial assessment, we propose a business arrangement that fits your codebase.

Get in touch

Talk through your challenge

What would you like to change?

A stalled rollout. Too much manual administration. A business idea worth exploring. Tell us what matters to you.

Talk through your challenge
Open website feedback or report an issue.