Navigation
AI

GitHub and AI Training: Using Private Code and How to Check Your Settings

November 2, 2026 techy.sk

Reports that GitHub is “quietly training AI on private repositories” confuse two different issues. According to available information, GitHub does not use the content of private repositories (stored code) for training. However, it does use data from interactions with Copilot, and that data may contain snippets of private code. This isn’t a secret, but the change from spring 2026 was enabled by default, so many developers aren’t aware of it. This article explains what has changed, what it means, and how to check your settings.

What’s Verified and What Isn’t

  • A quiet investigation of private repositories: I found no evidence that GitHub secretly trains models on stored private repositories in violation of its terms of service. According to GitHub, the content of private repositories is not used “at rest” for training, and GitHub does not crawl such repositories or feed them into models.
  • Policy Change: In late March 2026, GitHub announced that, starting April 24, 2026, it would use data from interactions with Copilot—specifically inputs, outputs, code snippets, and related context—to train and improve its models. This applies to Copilot Free, Pro, and Pro+ users. According to available descriptions, Copilot Business and Enterprise customers are excluded from this training.
  • Dispute regarding timeliness: The extensive discussions on Hacker News and elsewhere that I found date from March and April 2026, not from late October. I have not found any new events from October.

Why is this sensitive?

According to GitHub’s rules, if a user has enabled data sharing for training, code snippets from private repositories may be collected and used for training while the user is working with Copilot. For critics, this changes the meaning of the word “private”: while the code isn’t passively scanned, if you send it to Copilot for a suggestion, it can end up in the training data. This gives rise to specific risks:

  • Personal account in a company project. If a developer contributes to a company repository via a personal Copilot Free or Pro account, their interaction data may be included even though the company has its own privacy agreement.
  • Secrets. If Copilot sees a file containing encryption keys or login credentials, they may be included in the context. Secrets should never be placed in repositories at all, regardless of this change.
  • Client code. Client contracts often prohibit sharing code with third parties.

How to check your settings

  1. Log in to GitHub and open the Copilot settings (address github.com/settings/copilot/features).
  2. In the Privacy section, find the option “Allow GitHub to use my data for AI model training” and turn it off if you don’t want your interactions to be used for training. According to GitHub, previous opt-out decisions are carried over.
  3. If you’re part of an organization, ask your administrator what Copilot plan you’re using and what rules apply to personal accounts.
  4. Check to see if your employer restricts the use of AI tools on client code.

GitHub may change the item name and path in the settings, so please verify them in the current interface and in the privacy policy before using them.

If you want to be more careful

  • Do not use Copilot in repositories containing sensitive code, or use a plan that excludes training on interactions.
  • Never store secrets in a repository, not even a private one. Use a secret manager and environment variables.
  • Consider features to exclude content from Copilot, if your plan offers them.
  • For highly sensitive code, consider self-hosting (such as Forgejo or GitLab). Keep in mind, however, that even these alternatives have their own AI features and data processing policies, so you should review them just as carefully.

Legal Context

Since 2022, a lawsuit has been ongoing in the U.S. brought by programmers against GitHub, Microsoft, and OpenAI, concerning training on publicly available code with open-source licenses. This is a separate dispute from today’s topic of private repositories. Its outcome does not determine what is and isn’t permitted today.

What to Take Away From This

The main problem isn’t secret data mining, but the default setting to train on interaction data and the unclear meaning of the word “private” in AI tools. The best defense is simple: read the settings, turn off sharing if you don’t want to contribute, and don’t send the tools anything that shouldn’t leave your device. When it comes to trade secrets, the decision should not be made by an individual but by company policies.

Share Article

You Might Be Interested