githubvisual-studio-codegithub-copilot

GitHub Copilot and Privacy - Does GitHub Copilot save locally developed code?


Does GitHub Copilot save locally developed code? For example, if I develop code locally and in my code, there are connection parameters, like user and pass, for calls to remote services, do it save them as an example? Providing them as a suggestion in case someone else develops the same code in the future?

Also, in case of enterprise code development, where code must remain strictly confidential, can GitHub copilot save any sort of code (entirely or even just snippets) and make it public with suggestions?


Solution

  • It depends on your version of copilot and your settings.

    Copilot is trained against a public corpus of data and it will use contents your local files provide context so Copilot can refine the results.

    Copilot for business won't retain any of these snippets and will discard them immediately after returning the suggestion.

    Code Snippets Data

    GitHub Copilot transmits snippets of your code from your IDE to GitHub to provide Suggestions to you. Code snippets data is only transmitted in real-time to return Suggestions, and is discarded once a Suggestion is returned. Copilot for Business does not retain any Code Snippets Data.

    Copilot for individuals may retain the snippets, depending on your settings:

    Code Snippets Data

    Depending on your preferred telemetry settings, GitHub Copilot may also collect and retain the following, collectively referred to as “code snippets”: source code that you are editing, related files and other files open in the same IDE or editor, URLs of repositories and files path.

    When you commit your code to a public repo, it might get indexed in the future. The current index is based on the most recent dataset that GPT was trained against.

    This is one of the advantages of how copilot works compared to similar features that were available in the past. It doesn't need to process and index all your local content into a machine learning model, yet it can still provide you tailored results.