How GitHub Copilot Handles Your Data
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 neededExam 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.
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
- 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.
- 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.
- 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.
🖱️ Drag to rotate · scroll or pinch to zoom
What data is kept
Prompts and suggestions are encrypted in transit. For Copilot Business and Enterprise, your code is not used to train GitHub’s models, and prompts and suggestions from IDE code completion are not retained after the response. Engagement data (accepts, rejects, errors) is kept to run and improve the service and to power usage metrics.
🤔 What happens if…
Read this tour as text
- You type, then pause. Copilot doesn’t read your mind. When you pause while typing, the Copilot extension in your IDE starts a request for a completion.
- The IDE builds a prompt. The extension gathers context: code before and after the cursor, the file name and language, and related snippets from other open tabs. That bundle is the prompt. A model has a limited context window, so the extension picks what matters most.
- Content exclusions are checked. An admin can exclude paths or whole repositories. Excluded files are not used as context, and Copilot gives no inline suggestions inside them.
- The Copilot proxy. The prompt goes over HTTPS to a GitHub-hosted proxy. It authenticates the request and runs pre-filters, for example for harmful or offensive content and prompt-injection attempts, before anything reaches the model.
- The model predicts code. A large language model predicts the most likely next tokens. It matches patterns from training data and your context; it doesn’t run, test or truly understand your code. That’s why output can be wrong, outdated or insecure.
- Post-processing filters. Before you see it, the response is post-processed: checks for code quality and common insecure patterns, offensive content, and (if your policy says Block) a check for matches with public code of about 150 characters or more.
- Ghost text: accept or reject. The suggestion appears as grey ghost text. Tab accepts, Esc dismisses, Alt+] / Alt+[ cycle alternatives, Ctrl+→ accepts word by word. You decide what goes into your code.
- What data is kept. Prompts and suggestions are encrypted in transit. For Copilot Business and Enterprise, your code is not used to train GitHub’s models, and prompts and suggestions from IDE code completion are not retained after the response. Engagement data (accepts, rejects, errors) is kept to run and improve the service and to power usage metrics.
A free terminal with GitHub Copilot CLI, git and gh. No tasks: install the CLI, start a session, try slash commands and tool permissions, or call the seats API.
🎓 Education-only simulation. Your lab is saved in this browser, so you can leave and continue later.
😟 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
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 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 Build the prompt
It ranks that context and trims it to fit the model's limited context window. Excluded files are left out.
-
3 Send over HTTPS
The prompt travels encrypted to the GitHub Copilot proxy.
-
4 Proxy pre-filters
The proxy authenticates you and filters for harmful or offensive content and prompt injection.
-
5 Model generates
The large language model predicts a completion.
-
6 Post-processing
The reply is checked for quality, insecure patterns, offensive content and (if blocked by policy) public code matches.
-
7 Back to the editor
You see ghost text or a chat answer and decide what to do with it.
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
| Data | What it is | What happens to it (Business and Enterprise) |
|---|---|---|
| Prompts and suggestions (IDE code completions) | Your code context and the completion | Per 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 answer | May be retained for up to 28 days, per the Trust Center at the time of writing |
| Engagement data | Events: shown, accepted, dismissed, errors, latency, editor and language | Kept to operate the service and to build usage metrics |
| Model training | Using your data to improve models | Your 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
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.
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.
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.How is data protected on its way to GitHub?Show
Encrypted in transit over HTTPS (TLS).
-
2.What sits between the IDE and the model?Show
The GitHub Copilot proxy.
-
3.Does Copilot Business use your code to train models?Show
No.
-
4.What kind of data powers Copilot usage metrics?Show
Engagement data, such as accepted and dismissed suggestions.
-
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
Lesson done? Make it stick with a quick gameSort It, Match the Pairs, Lightning Round and Who Am I? Earn XP and badges.