Is my private code being used to train AI models?
Your private repositories are not training frontier models by default. Hosting providers and AI coding tools each have their own terms, and some use your code for product features unless you opt out, so the answer depends on which services you have connected rather than on one industry-wide policy. Check the settings rather than trusting a general reassurance.
This question gets answered badly in both directions. One camp says everything you have ever written is already in a model. The other says private means private, relax. Neither is a useful answer.
The three separate questions
They get run together constantly, and they have different answers.
"is my private code training AI?" │ ├── my code host ──────────► stated policy: no │ ├── my AI coding assistant ► depends on the tool and plan │ └── code I license ────────► yes, and you agreed and were paid
Your code host
Major hosting providers state that they do not train models on the contents of private repositories. That is their stated policy rather than a law of nature, and policies are revised, so it is worth reading the current terms of whichever service you use rather than taking it from a website.
Practically, treating private repositories as not feeding frontier model training is the correct working assumption today.
Your AI coding assistant
This is where the real exposure sits, and almost nobody checks it.
An assistant reads your code. That is the product. The question is what happens to what it read: whether snippets are retained, whether they are used to improve the service, and whether that is on or off by default.
The answers vary by tool and by plan, and they change. The pattern across the market has been that business and enterprise tiers exclude your code from product improvement by default, while free and individual tiers often do not unless you turn it off.
If you care about the answer, the place to find it is the settings page and the current terms of the specific tool, not a general article. That includes this one.
┌─ WORTH CHECKING ─────────────────────────────────────────────────────┐ │ │ │ Private, finished, owned by you, and doing nothing. │ │ │ │ [ See what your repos are worth ] │ │ │ └──────────────────────────────────────────────────────────────────────┘
Code you deliberately license
The third case is the one this site is about, and it is different in every respect that matters.
It happens because you agreed to it, in a contract you read, covering repositories you chose. It is non-exclusive, so you keep ownership and keep using the code. Secrets and personal data are stripped from the reviewed copy before any buyer sees it. Nothing is published. And you are paid, repeatedly, each time a licence closes.
The contrast with the previous section is the whole point. The difference between those two situations is not technical. It is consent and payment.
What is actually worth doing
Read the settings on your AI tooling. Ten minutes, and it is the only one of the three where your current behaviour changes the outcome.
Stop treating public and private as the same category. Anything you published is collected and gone. That is done, it is not worth being upset about, and it was the deal you accepted when you chose a permissive licence. See why your MIT-licensed repo is worth nothing.
Do not delete old repositories out of anxiety. Deleting destroys an asset and undoes nothing that already happened. Archive them instead.
If code is going to be used either way, be the one who agreed and got paid. That is not a slogan, it is the only lever you actually hold.
What to read next
- Can you license private repositories, on what private has to mean
- Archiving a GitHub repository, the safe thing to do with dormant code
- What AI labs pay for code, the figures
Common questions
- Does my code host train models on my private repositories?
- Major hosts state that they do not train models on private repository contents. The terms are theirs to change and are worth reading directly rather than taking from a third party, including this one.
- What about AI coding assistants I have installed?
- Different question, different answer. An assistant reads your code by design in order to work. Whether anything is retained or used to improve the product varies by tool and by plan, and is usually a setting. Business and enterprise tiers commonly exclude it by default while free tiers commonly do not.
- Does licensing my code mean it gets published?
- No. Licensing grants permission to train on a reviewed copy. Nothing is published and your repository is not modified.
- How would I even know if my code had been used?
- Generally you would not, which is precisely why the distinction between a licence you signed and a setting you did not read matters.
- Should I just delete old repositories to be safe?
- Deleting removes an asset and does not undo anything that already happened. Archiving keeps the history intact and costs nothing.