How to Block GitHub Copilot Suggestions Matching Public Code
🔍 WiseChecker

How to Block GitHub Copilot Suggestions Matching Public Code

GitHub Copilot has a policy named Suggestions matching public code. Set it to Block when you want supported Copilot features to suppress detected public-code matches. Configure the policy on GitHub, not through an invented “Enable Public Code Suggestions” checkbox in VS Code or JetBrains.

Important: this is a matching filter, not a guarantee that every generated line is original or free of licensing obligations. Some Copilot surfaces do not support blocking.

ADVERTISEMENT

Understand What the Public-Code Filter Does

GitHub describes comparing suggestions and nearby context, roughly 150 characters, against public code on GitHub. Where Block is supported, detected matches or near-matches are withheld. Where matching suggestions are allowed, supported interfaces can provide references for review.

The check is not a universal provenance search across every website and private repository. A missing reference should not be treated as proof of originality. Review code, dependencies and any applicable licensing requirements through your normal project process.

Set Block for an Individual Copilot Account

  1. Sign in to the GitHub account you use for Copilot.
  2. Open your profile menu and select Copilot settings.
  3. Find Suggestions matching public code.
  4. Select Block from its dropdown, then revisit the setting to confirm the saved selection.

These are the current steps in GitHub’s individual policy guide. If your Copilot seat is provided by an organization, the setting can be inherited instead of editable in your personal account.

ADVERTISEMENT

Use the Policy in VS Code and JetBrains

Confirm that your IDE is signed in to the same account whose policy you inspected. There is no separate documented public-code checkbox in these editors that overrides GitHub’s account or organization policy.

If the IDE appears to be using an unexpected account, inspect its account controls and reconnect the intended one. Keep the IDE and Copilot integration current. Do not change unrelated editor settings or clear browser data as a substitute for checking the effective policy.

Check Organization and Enterprise Control

An organization owner can open the organization’s Settings → Copilot → Policies and inspect the relevant enforcement setting. If the enterprise enforces a policy, the organization cannot override it. GitHub explains this hierarchy in its organization policy guide.

If you do not have access to those controls, ask the administrator to confirm the effective policy and the seat supplying your access. Do not assume that a personal setting can override the organization.

ADVERTISEMENT

Do Not Assume Every Copilot Surface Supports Block

GitHub’s supported-surfaces reference distinguishes policy coverage across products. Its cloud-agent and third-party-agent entries support public-code matching in annotation mode only. The Copilot app documentation also explicitly says the app may generate matching code even when the policy is Block.

Before using an agent for a repository with strict requirements, verify the policy behavior for that exact surface. Review matching-code annotations and the actual diff. Do not approve an automated change simply because Block is selected elsewhere.

Keep Matching, Context Exclusion and Training Controls Separate

The public-code policy controls detected matches in generated output. Content exclusion controls supported uses of specified source files as context. Model-training preferences concern how eligible interaction data may be used. They are different controls; content exclusion does not remove a repository from a model’s existing training data.

If matching code still appears, record which product and feature produced it, which account was active, and what the effective policy says. For a supported IDE feature, inspect any provided code references and report an unexpected result with a minimal non-sensitive example. Avoid sharing proprietary code publicly while troubleshooting.

Official documentation checked: October 14, 2026.

ADVERTISEMENT