Developers frequently treat AI privacy as a single switch. It is not. When you write code alongside GitHub Copilot, your data touches three distinct pipelines: model training, real-time prompt context transmission, and editor telemetry. Conflating these three is where security incidents and compliance violations happen.
At 365Finds, we look at developer tooling through a zero-trust lens. GitHub Copilot boosts velocity, but unconfigured deployments expose proprietary logic, API keys, and sensitive internal architectures to remote inference and potential logging. Stopping that leakage requires different levers depending on whether you manage an enterprise organization or write code on an individual subscription.
1. Deconstruct the Three Data Streams
Before touching any settings, you must understand what you are shutting down:
- Model Training: GitHub using your source code, prompts, and accepted suggestions to train foundational or fine-tuned AI models.
- Prompt Context (Inference): The IDE reading active files, neighboring tabs, and project structure to send code snippets over HTTPS to GitHub and Azure OpenAI inference servers to generate completions.
- Diagnostic Telemetry: Metrics about your editor, latency, feature usage, and crashes sent to Microsoft and GitHub.
Each stream has a completely separate control surface.
2. Stop Model Training on Individual Plans
If you use GitHub Copilot on an individual subscription (Copilot Free, Pro, or Pro+), your interaction data is included in AI model training by default.
If you are on GitHub Copilot Business or Enterprise, your code is contractually excluded from model training under enterprise Data Protection Agreements (DPAs). On business seats, the user training toggle is suppressed because training on your code is already disabled organization-wide.
For individual accounts, disable training immediately:
- Navigate to GitHub.com and sign in.
- Click your profile picture in the top-right corner and select Settings.
- In the left navigation bar, locate the Code, planning, and automation section and click Copilot.
- Find the option titled Allow GitHub to use my data for AI model training (or product improvements).
- Change the dropdown setting from Allowed to Disabled.
- Save your preferences.
Once disabled, GitHub does not retain prompts or completions for training underlying models. However, this setting alone does not prevent your local editor from transmitting sensitive code to cloud inference servers while you type.
3. Block Code Context via Content Exclusion (Business & Enterprise)
For teams on Copilot Business or Copilot Enterprise, GitHub provides Content Exclusion. This administrative mechanism instructs the GitHub Copilot IDE extension to refuse to read, index, or transmit designated files and repositories.
When a file is excluded:
- Inline completions are disabled when working in that file.
- The file's content is blocked from being passed as background context for completions in other open files.
- Copilot Chat cannot read, summarize, or reference the file.
- Copilot Code Review ignores the file entirely.
Option A: Organization-Level Exclusion (Recommended)
365Finds strongly advises setting exclusion policies at the organization level rather than trusting individual repository maintainers. Policies set at the organization cascade down to every repository automatically and cannot be bypassed locally.
- Go to your organization page on GitHub (
https://github.com/organizations/YOUR_ORG/settings/profile). - In the left sidebar, click Copilot, then select Content exclusion.
- In the Repositories and paths to exclude editor, define your rules using standard
fnmatchglob syntax. - Click Save changes.
Option B: Repository-Level Exclusion
If you only need to protect a single standalone repository:
- Navigate to the repository on GitHub.
- Click Settings under the repository title.
- In the left sidebar, under Code, planning, and automation, select Copilot > Content exclusion.
- In the Paths to exclude in this repository input area, add one pattern per line.
- Click Save changes.
Syntax and Glob Rules
Paths are case-insensitive and match against repository-relative paths:
# Exclude specific environment and secret files across all directories
*.env
*.env.*
*.pem
*.key
secrets.json
# Exclude an entire compliance-sensitive folder
/src/security/**
/billing/pci/**
# Exclude proprietary algorithmic core
/engine/proprietary/**
/models/weights/**
Within 30 minutes of applying these rules, connected IDE extensions fetch the updated policy. When an engineer opens an excluded file in VS Code or JetBrains, the Copilot status bar icon displays a diagonal slash or blocked badge, confirming that context collection is deactivated for that buffer.
4. Local Protections for Individual Developers
If you work on sensitive personal projects or proprietary client repositories on an individual plan, you do not have access to GitHub's server-side Content Exclusion interface. You must enforce isolation locally inside your editor.
Restrict Copilot by File Type in VS Code
You can configure VS Code's settings.json to disable GitHub Copilot for sensitive file formats:
{
"github.copilot.enable": {
"*": true,
"plaintext": false,
"markdown": false,
"scminput": false,
"yaml": false
}
}
Isolate Repositories via Workspace Settings
Never rely solely on global IDE settings. When opening a proprietary repository:
- Create or edit
.vscode/settings.jsonwithin that project root. - Completely deactivate Copilot completions for that specific workspace:
{
"github.copilot.enable": {
"*": false
}
}
Commit this .vscode/settings.json file to version control (or keep it in .git/info/exclude if you prefer not to touch tracked files) so that any collaborator opening the workspace starts with Copilot deactivated.
Disable Editor Diagnostic Telemetry
GitHub Copilot hooks into VS Code's diagnostic logging. To stop sending general usage patterns, extension state, and crash diagnostics to Microsoft:
- Open VS Code Settings (
Ctrl + ,on Linux/Windows,Cmd + ,on macOS). - Search for
telemetry.telemetryLevel. - Set the value to
off.
In settings.json, this maps to:
{
"telemetry.telemetryLevel": "off"
}
5. The Structural Blind Spots: What Exclusion Does Not Prevent
365Finds views Content Exclusion as a necessary governance guardrail, but treating it as an absolute security perimeter is a dangerous mistake. You must recognize its technical boundaries:
- Indirect Semantic Leakage: If
safe_module.pyimports an interface from excluded/secrets/config.py, the language server (LSP) running inside your editor generates type signatures, hover documentation, and auto-complete symbols for the imported types. Ifsafe_module.pyis open, Copilot can absorb those generated symbol definitions into its prompt payload. The raw file is shielded; its semantic footprint is not. - Symlink Traversal: Content exclusions follow literal repository paths. Symbolic links pointing into excluded directories are not guaranteed to trigger exclusion rules in local language server clients.
- Third-Party Model Context Protocol (MCP) Servers: Content exclusions govern GitHub's proprietary Copilot agents and endpoints. If you attach custom external MCP servers or third-party context providers to your IDE, those tools operate under their own permissions and will bypass GitHub's exclusion table unless explicitly configured.
True isolation requires defense-in-depth: keep credentials out of source repositories entirely using local secret injectors or secret managers, enforce organization-wide Content Exclusion on Business tiers, and turn off model training across all personal accounts.