Is GitHub Copilot safe? Data, code and agent risks
Is Copilot safe? For ordinary coding, yes, if you check three things. On Free, Pro, Pro+ and Max plans GitHub may use your interactions to train models from April 24, 2026, and you can switch that off. The code Copilot writes is your responsibility. When it acts as an agent on your Mac, permission prompts are its key safety mechanism, so keep them on. Business and Enterprise customer data is not used for training.
This page covers GitHub Copilot, the coding assistant. It shows what Copilot sees and where it goes, what the agent modes can do, the known risks and five checks. Whether Copilot is safe for your team depends mostly on the plan you pay for. If you also run other agents, read Claude Code, Cursor and Codex next.
01What Copilot sees and where it goes
| Part of Copilot | What to know |
|---|---|
| Inline suggestions | Content filtering scans prompts and responses to block harmful, offensive or insecure content. Public code matching blocks or annotates suggestions that match public code. |
| Copilot CLI | By default filesystem access is scoped to the directory where it was started. |
| Cloud agent | Runs in an ephemeral, firewalled environment with automated security scanning. |
| Interactions | On Free, Pro, Pro+ and Max plans, may be used to train and improve AI models from April 24, 2026. |
Ephemeral means the environment is thrown away after the task. The cloud agent does not run on your Mac at all. The CLI does.
02Does Copilot train on your data?
It depends on the plan. GitHub does not use Copilot Business or Copilot Enterprise customer data to train AI models. If you have a Copilot Free, Pro, Pro+ or Max plan, GitHub may use your interactions, including inputs, outputs, code snippets and associated context, to train and improve AI models from April 24, 2026.
You can turn that off. Click your profile picture in the upper-right corner of any GitHub page and choose Copilot settings. Open the "Allow GitHub to use my data for AI model training" dropdown and click Disabled. If you code for an employer on a personal plan, do this before you open work code.
The same settings page has "Suggestions matching public code", which you can set to Allow or Block.
03What can Copilot do on your Mac?
In the editor it suggests code and you decide what to accept. The agent modes are different. Copilot CLI has filesystem access scoped to the directory where it was started, and whether it asks before acting depends on the active permission mode. If you turn on computer use, it can also work with desktop apps outside that directory. GitHub calls those permission prompts a key safety mechanism for local agentic execution. The cloud agent is the other kind of agent. It runs away from your Mac, in an ephemeral, firewalled environment. Its limit is that environment and its automated security scanning. On your Mac, the CLI's directory scope and the permission prompts are the limits that count.
04What are the risks of Copilot?
Two risks are documented. On top of them sits one setting you should check.
Insecure code. An NYU study called Asleep at the Keyboard tested the early 2021 version of Copilot on 89 scenarios, and about 40 percent of the programs were vulnerable. That was an early version, so read it as a reason to review, not as today's rate. Be careful using Copilot for security-sensitive code, and review and test thoroughly.
A command injection flaw. CVE-2025-53773 is a command injection in GitHub Copilot and Visual Studio that allows an attacker to execute code locally. Command injection means an attacker gets text run as a command. Keep Copilot and Visual Studio updated, as with any flaw of this kind.
Training on personal plans. This one is a setting, not a flaw: on Free, Pro, Pro+ and Max you can turn training off in Copilot settings.
05Can you trust Copilot?
Trust it the way you trust a fast junior developer. GitHub's application card for inline suggestions says users assume all risks of generated code, including vulnerabilities. For reviews, GitHub says Copilot code review supplements human reviews and does not replace them.
The vendor controls exist and are worth turning on: content filtering and public code matching. They filter output. They do not check your secrets, your dependencies or your repo settings.
06Five checks that make Copilot safer
- Turn off training on a personal plan. Profile picture, Copilot settings, "Allow GitHub to use my data for AI model training", Disabled.
- Block suggestions that match public code if you want that. The setting is Suggestions matching public code, Allow or Block. Matching suggestions are either blocked or annotated with their source.
- Keep permission prompts on in agent modes. Start Copilot CLI from the project directory, not from your home directory, so the scoped filesystem access is useful.
- Review before you accept. Treat security-sensitive code as code to test thoroughly. Use Copilot code review as an addition to people.
- Keep secrets out of the repo. Consider any leaked secret immediately compromised, and removing it from the codebase does not prevent exploitation. Push protection blocks pushes that contain secrets before they reach the repository. To scan a repo yourself on a Mac:
brew install trufflehogTruffleHog classifies over 800 secret types, and the Homebrew install is the one on its README. More on the code side is in vibe coding security and AI-generated code vulnerabilities.
07So, is Copilot safe?
Is Copilot safe for ordinary coding? Yes, once you handle the training setting on personal plans, review what it writes and keep permission prompts on in agent modes. The part that stays with you is the output and the secrets near it. For a wider setup see how to run agents safely, or go back to the home page.
Copilot's settings decide what it sends and suggests; they don't show what the code it wrote did once it ran. Artificial Immunity's free, open-source core watches VS Code tasks, package scripts and every program start on your Mac, and reports what it finds without blocking anything.
FAQ
Is Copilot safe?
Yes for ordinary use, if you check three things. On Free, Pro, Pro+ and Max plans GitHub may use your interactions to train models from April 24, 2026, and you can switch that off. The code it writes is your responsibility. When it acts as an agent on your machine, it relies on permission prompts as a key safety mechanism.
What are the risks of Copilot?
Two are documented. Generated code can be insecure, as a 2021 NYU study of Copilot found about 40 percent of its programs vulnerable. A command injection flaw in Copilot and Visual Studio allowed local code execution, CVE-2025-53773. On personal plans there is also the training setting.
Can I trust Copilot?
Trust it as an assistant, not as a reviewer. GitHub's own card says users assume all risks of generated code, including vulnerabilities, and says to use Copilot code review to supplement human reviews, not to replace them.
Does Copilot sell my data?
The documented use of your data is model training, and it depends on your plan. GitHub does not use Copilot Business or Enterprise customer data to train AI models. On Free, Pro, Pro+ and Max it may, from April 24, 2026, unless you opt out.
Is Copilot more secure than ChatGPT?
Security depends on the settings, not the brand name. For Copilot the levers are the training opt-out, the public code matching setting and permission prompts for agent actions.
Can Copilot run commands on my Mac?
Copilot CLI can run agentic actions locally. By default its filesystem access is scoped to the directory where it was started, and permission prompts depend on the active mode.