Sub topic 12
Review privacy settings and content exclusion
This chapter covers the controls that decide what Copilot can see and what GitHub may do with your data. It assumes you have Copilot installed and signed in, you know your plan from the earlier chapter on plans and access, and you can edit VS Code settings.
What data Copilot sends
When you use Copilot, VS Code sends a prompt to GitHub's service. For inline suggestions, the prompt includes code around your cursor and some context from other open files. For chat, it includes your message, any context you attach, and recent conversation history. The service returns a suggestion or an answer.
Two questions matter for privacy:
- Which files are allowed to be sent at all?
- Can GitHub keep your prompts and suggestions, and use them to improve products?
Content exclusion answers the first question. Account and organization policies answer the second.
Content exclusion
Content exclusion tells Copilot to ignore specific files or paths. For an excluded file, Copilot does not offer inline suggestions in it, and its contents are not used as context for suggestions or chat answers in other files.
You configure it in GitHub, not in VS Code:
- A repository administrator sets exclusions for one repository.
- An organization owner sets exclusions across the organization's repositories.
- Enterprise owners can set them at the enterprise level.
Content exclusion is available on the Business and Enterprise plans. Individual plans do not have it, so on a personal account you rely on the language setting from the previous chapter and your own judgment about what you open.
Exclusions are written as YAML that lists path patterns. A repository-level example looks like this:
- "/secrets/*.json"
- "/config/production.env"
- "**/*.pem"Each entry is a path pattern. The first two match specific locations in the repository. The last one matches any .pem file at any depth.
After an administrator changes the rules, editors can take up to about 30 minutes to pick them up. Reloading the VS Code window forces a refresh.
Data-use and retention settings
The second set of controls lives in your GitHub account settings, under the Copilot section. What you see depends on your plan:
| Setting | What it controls | Who controls it |
|---|---|---|
| Allow GitHub to use my data for product improvement | Whether your prompts and suggestions may be used to improve GitHub products | You, on individual plans |
| Suggestions matching public code | Whether Copilot may suggest code that matches public repositories | You, or your organization on Business and Enterprise |
| Prompt and suggestion retention | Whether prompts are kept after a request | GitHub policy for your plan |
On Business and Enterprise plans, the organization sets these policies and individual users cannot override them. If a setting is greyed out or missing, an administrator likely controls it.
The public code matching setting is worth a closer look. When it blocks matches, Copilot checks suggestions against a public code index and withholds those that closely match. This reduces licensing risk, but it does not remove it. You remain responsible for reviewing what you accept.
Check what applies to you
- Open github.com, go to Settings, then Copilot.
- Review the data-use and public code options. Note any that are locked by an organization.
- In VS Code, open a file you expect to be excluded. The Copilot status bar icon shows that the file is excluded, and no inline suggestions appear.
- If you expected an exclusion and it is not working, reload the window and confirm with your administrator that the path pattern matches.
Exercise
Your team handles customer data in a /data/exports/ folder. A developer on a Copilot Individual plan asks you to add a content exclusion for it. What do you tell them, and what can they do instead?
Show answer
Content exclusion is only available on Business and Enterprise plans, so it cannot be set on an Individual plan. They can turn off the product-improvement data-use setting in their GitHub account, disable Copilot for the relevant languages or file types through the github.copilot.enable setting, and avoid keeping those files open while using Copilot. A longer-term fix is to move the work onto an organization plan where an owner can exclude /data/exports/*.