Your profile

One profile for every MSDEVBUILD site. Only you can see it, and the site owner if you write in.

Lesson 16 of 30
❮Prev Next❯

How GitHub Copilot Handles Your Data

Module 3: Data & Architecture ⏱ 9 min read Updated

Your note

My notes for this lesson

Select any text in the lesson to highlight it or add a note. Saved in this browser.

    No highlights yet. Select a sentence in the lesson, then pick a colour or add a note.

    All my bookmarks and notes

    Reading settings

    For every lesson, saved in this browser.

    Text size
    Line spacing
    Font

    With IaaS you rent the virtual machine. Microsoft looks after the building, power and hardware; you patch the operating system.

    30-second answer

    When you use GitHub Copilot, the IDE extension collects context (code around your cursor, the file name and language, related open tabs), builds a prompt and sends it encrypted over HTTPS to the GitHub Copilot proxy. The proxy authenticates you and runs pre-filters, the large language model generates a reply, and post-processing checks it before it reaches your editor. With Copilot Business and Enterprise, your code isn't used to train the models. Per the GitHub Copilot Trust Center at the time of writing, prompts and suggestions from IDE code completions aren't retained once the response is returned, while other features such as chat and the CLI may keep them for up to 28 days. Engagement data (accepts, rejects, errors) is kept to run the service and power usage metrics.

    Simulate it » No Azure account needed

    Exam objective: 3.1.1 Explain data usage, flow, and sharing. (Skills measured as of August 7, 2026)

    Simulations

    Feel it before you read it. No account needed, nothing leaves this page.

    VS Code & GitHub: What happens to your code and prompts The privacy settings, the request flow and the metrics an org sees.
    </> Embed

    Embed this simulation

    Free for trainers, teachers and bloggers. Paste this into your page:

    Loading…

    On individual plans you control whether GitHub may use your prompts and suggestions for product improvements. With <strong>Copilot Business or Enterprise</strong>, your code and prompts are <strong>not used to train</strong> GitHub’s models.

    👆 Click the glowing item on screen to continue

    Read the steps as text
    1. On individual plans you control whether GitHub may use your prompts and suggestions for product improvements. With Copilot Business or Enterprise, your code and prompts are not used to train GitHub’s models.
    2. The flow: the IDE builds a prompt from context, sends it encrypted to the Copilot proxy and model, and the reply is filtered before you see it. Engagement data (accepts, rejects, errors) is kept to run the service and for usage metrics.
    3. Organizations see usage metrics built from that engagement data, not your code.

    🧪 Simulation for learning. Screens are simplified versions of Visual Studio Code and github.com with GitHub Copilot; names, files and suggestions are examples. Not affiliated with GitHub or Microsoft, and nothing here touches your real account.

    😟 THE PROBLEM

    Security asks where your code goes when Copilot is on.

    😊 THE SOLUTION

    Explain the data flow and what is kept, plan by plan.

    • Unclear destination✓ Encrypted to the Copilot service
    • Fear of training on our code✓ Not for Business and Enterprise
    • What is stored?✓ Engagement data for metrics
    🛠️ Solved with: Copilot data handling

    Start with a question

    When you press a key and Copilot finishes your line, where did your code just go, and who kept a copy?

    Think of sending a parcel through a courier. You don’t ship your whole house. You pack the few things that matter, the courier checks the label and scans the box, the parcel arrives, and the courier keeps a delivery record (sent, delivered, signed for), not the contents.

    GitHub Copilot works much the same way. The extension in your editor packs a small prompt from the code around your cursor, sends it encrypted to GitHub’s Copilot proxy, and gets a suggestion back. What’s kept afterwards depends on your plan and the feature, and companies care a lot about that answer.

    Explain it like I’m 10

    The technical explanation

    The round trip

    Every Copilot request makes the same journey. Here it is for an inline suggestion in src/discount.js of the contoso-shop repo.

    1. 1 Gather context

      The IDE extension reads the code before and after your cursor, the file name and language, and related snippets from open tabs.

    2. 2 Build the prompt

      It ranks that context and trims it to fit the model's limited context window. Excluded files are left out.

    3. 3 Send over HTTPS

      The prompt travels encrypted to the GitHub Copilot proxy.

    4. 4 Proxy pre-filters

      The proxy authenticates you and filters for harmful or offensive content and prompt injection.

    5. 5 Model generates

      The large language model predicts a completion.

    6. 6 Post-processing

      The reply is checked for quality, insecure patterns, offensive content and (if blocked by policy) public code matches.

    7. 7 Back to the editor

      You see ghost text or a chat answer and decide what to do with it.

    One Copilot request, there and back

    Two things to notice. First, for a completion the extension sends context it picked, not your whole repository. Second, the proxy sits on GitHub’s side, so filtering happens before the model sees your prompt and again before you see the answer. The next two lessons zoom into each half.

    What’s kept, and what isn’t

    DataWhat it isWhat happens to it (Business and Enterprise)
    Prompts and suggestions (IDE code completions)Your code context and the completionPer the GitHub Copilot Trust Center at the time of writing, not retained once the response is returned
    Prompts and suggestions (other features, such as chat and the CLI)Your question, attached context, the answerMay be retained for up to 28 days, per the Trust Center at the time of writing
    Engagement dataEvents: shown, accepted, dismissed, errors, latency, editor and languageKept to operate the service and to build usage metrics
    Model trainingUsing your data to improve modelsYour code isn’t used to train GitHub’s models

    Everything travels encrypted in transit. Retention numbers can change, so treat the Trust Center as the source of truth and quote it with a date.

    On individual plans (Copilot Free, Pro and Pro+), you’ll find a personal setting on github.com under your Copilot settings that controls whether GitHub may use your data for product improvements. The walkthrough in the VS Code & GitHub tab shows that setting next to the request flow.

    Who sees what inside a company

    Admins don’t get a feed of everyone’s code. They get metrics built from engagement data: active users, acceptance rate, chat turns. The seats API shows each person’s last_activity_at and last_activity_editor. Settings changes, seat changes and content exclusion changes appear in the audit log as copilot. events. That’s enough to manage adoption and licences without reading anybody’s prompts.

    Architect level Why sending less context is a privacy feature too

    The context window limit is usually explained as a quality problem: the model can only read so much. It also helps privacy. Because the extension sends nearby code and short snippets from related tabs instead of the whole project, less of your code travels for each completion. Chat is different: when you use #codebase or @workspace, Copilot searches your workspace and may attach more files to the request. If some paths should never leave the machine as context, the right tool is a content exclusion, set by a repository, organization or enterprise admin on Business or Enterprise.

    Real-world business scenario

    E-commerce

    Contoso Retail (fictional)

    The problem
    Contoso's legal team blocked a Copilot rollout for the contoso-shop team. They assumed every keystroke uploaded the full repository and that GitHub would train on their pricing logic.
    What they used
    GitHub Copilot Business, with the platform team walking legal through the data flow, the Trust Center retention table, the org metrics page and content exclusions for the /secrets/ folder.
    Why that choice
    Business data isn't used for training, completions send only nearby context, engagement data powers the metrics, and exclusions keep the most sensitive paths out of prompts.
    The result
    Legal approved a pilot for 40 developers. The platform team now reviews the Copilot metrics page monthly instead of guessing at adoption.

    When to use it and when not to

    ✓ Use it when…

    • You need to explain Copilot to security, legal or compliance before a rollout.
    • You're choosing between individual plans and Copilot Business for a team that handles private code.
    • You want usage numbers without collecting anyone's code.

    ✕ Think twice when…

    • Pasting real secrets or customer personal data into chat. Retention and filtering don't make that a good idea.
    • Quoting retention numbers from memory in a policy document. Link the Trust Center and date it.

    ↔ Alternatives to consider

    • Content exclusions when specific files must never be used as context.
    • Organization policies to turn off features (for example chat on github.com or the CLI) that a team isn't allowed to use yet.
    Ready for more?The full lesson adds the technical explanation, when to use it, interview questions and revision notes.

    Test yourself with exercises

    5 original practice questions in the GH-300 style. Pick your answers, then check them. You will see why each option is right or wrong. Score 75% or more and this topic is marked complete.

    Question 1

    Question 1 of 5

    Your company uses GitHub Copilot Business. The security team asks whether code from the company's private repositories is used to train the models that power GitHub Copilot. What should you tell them?

    Question 2

    Question 2 of 5

    A developer accepts an inline suggestion in Visual Studio Code. Which component receives the prompt directly from the IDE extension?

    Question 3

    Question 3 of 5 · Select 2

    An organization administrator views Copilot usage metrics showing active users and acceptance rates. Which two types of data does GitHub retain to provide these metrics and operate the service? Each correct answer presents part of the solution.

    Question 4

    Question 4 of 5

    A developer with a Copilot Pro plan does not want GitHub to use their prompts and suggestions for product improvements. What should the developer do?

    Question 5

    Question 5 of 5

    Which statement describes how data travels between the IDE and GitHub when Copilot generates a suggestion?

    Interview preparation

    Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

    Beginner What leaves my machine when Copilot gives me an inline suggestion?

    Model answer

    A prompt built by the extension: the code before and after my cursor, the file name and language, and short snippets from related open tabs. It goes over HTTPS to the Copilot proxy. My whole repository isn't uploaded for a completion, only the context the extension picks.

    Interviewer follows up

    Does that include excluded files?

    You

    No. If an admin has set a content exclusion for a path, supported IDEs don't use that file as context and don't give suggestions inside it.

    Intermediate A security lead asks whether Copilot Business trains on company code. What do you say?

    Model answer

    No. For Copilot Business and Enterprise, GitHub doesn't use your code, prompts or suggestions to train its models. I'd also explain retention: per the Trust Center at the time of writing, IDE completion prompts aren't kept after the response, other features like chat may keep prompts for up to 28 days, and engagement data is kept to run the service. I'd point them to the Trust Center for the current wording.

    Experienced developer Your org dashboard shows acceptance rates per editor. Does that mean GitHub is storing everyone's code?

    Model answer

    No. Those metrics come from engagement data: events like a suggestion shown, accepted or dismissed, with the editor and language. That's different from the prompt and suggestion content. Metrics and the seats API tell you who uses Copilot and how much, not what code they wrote.

    Scenario A developer on a Copilot Pro plan worries about their side-project code being used to improve products. What can they change?

    Model answer

    On individual plans they control it in their Copilot settings on github.com: the setting that allows GitHub to use their data for product improvements. They can turn it off. Business and Enterprise users don't need to, because their data isn't used for training anyway.

    Quick revision

    Key points

    • Flow: IDE extension gathers context → builds a prompt → HTTPS → Copilot proxy (auth, pre-filters) → model → post-processing → editor.
    • Only the context the extension picks is sent for a completion, not your whole repository.
    • Copilot Business and Enterprise data isn't used to train GitHub's models.
    • Per the Trust Center at the time of writing, IDE completion prompts and suggestions aren't retained after the response; chat and CLI may keep them up to 28 days.
    • Engagement data (accepts, rejects, errors) is kept to operate the service and power metrics.
    • Individual plans have a personal setting about using data for product improvements.

    Important terminology

    Prompt
    The bundle Copilot sends to the model, built from your code context, your question (in chat) and any instructions.
    GitHub Copilot proxy
    The GitHub-hosted service between your IDE and the model. It authenticates requests, runs pre-filters and post-processing.
    Engagement data
    Usage events such as accepted or dismissed suggestions, errors and latency. Kept to operate the service and to build usage metrics.
    Retention
    How long GitHub keeps prompts and suggestions after a request. It differs by feature and plan, so check the Trust Center for current numbers.
    Model training
    Using data to improve an AI model. Copilot Business and Enterprise data isn't used to train GitHub's models.
    Encryption in transit
    Data is protected with TLS (HTTPS) while it travels between your machine and GitHub.

    Common mistakes

    • Thinking Copilot uploads the whole repository for every suggestion.
    • Saying every Copilot feature has the same retention. Completions and chat differ.
    • Confusing engagement data (usage events) with prompt content (your code).

    Exam tips

    • "Is our code used to train the model on Copilot Business?" = No.
    • "What is kept for metrics?" = engagement data (accepted, dismissed, errors).
    • "Which component authenticates and filters requests before the model?" = the Copilot proxy.

    Five quick revision questions

    1. 1.How is data protected on its way to GitHub?Show

      Encrypted in transit over HTTPS (TLS).

    2. 2.What sits between the IDE and the model?Show

      The GitHub Copilot proxy.

    3. 3.Does Copilot Business use your code to train models?Show

      No.

    4. 4.What kind of data powers Copilot usage metrics?Show

      Engagement data, such as accepted and dismissed suggestions.

    5. 5.Where do you check current retention numbers?Show

      The GitHub Copilot Trust Center.

    Official references

    Finished this lesson? Tick it off. Your progress is saved in this browser.

    Next up: How Copilot Builds a Prompt from Context

    Studying with a friend? Send them this lesson

    It's free and needs no sign-up. Their progress saves in their own browser.

    Lesson done? Make it stick with a quick gameSort It, Match the Pairs, Lightning Round and Who Am I? Earn XP and badges. Play ❯

    Install MSDEVBUILD Azure

    Free · no account · works offline

    Save the whole course for offline ›

    Hi, I’m your Nimbus

    Your study buddy. Pick what we do next.

    MSDEVBUILD · Multi-Stack Dev Build

    Sign in to MSDEVBUILD

    One account for Azure certifications and the blog: sign in here and you are signed in on both. Your XP, streak, practice deck and certificate stay in sync on every device. Optional: everything works without an account.