- No code completions in excluded files — Copilot will not offer completions while editing those files.
- Excluded content will not shape suggestions in other files — excluded code is not used to influence completions elsewhere.
- GitHub Copilot Chat will not use excluded content when answering questions.

- Repository administrators can create and modify exclusions for individual repositories.
- Organization owners can define organization-wide exclusions that apply to users with Copilot seats.
- Other repository roles (for example, users with the maintain role) may be able to view—but not change—content-exclusion settings.
Content exclusion is available only for GitHub Copilot Business and Enterprise subscriptions. It is not included in individual plans.
Repository-level exclusion — how to set it up
- Open the repository Settings and go to the Copilot (or Copilot settings) section.
- Locate Content Exclusion and add patterns for files and directories you want to exclude. In the UI each pattern is typically entered as a quoted string on its own line (the list may be displayed with a leading dash).
- Save the changes. Exclusions take effect immediately.
- In Organization settings, navigate to Copilot → Content Exclusion.
- Define the scope of exclusion (for example, files tracked in Git repositories or files anywhere on the file system).
- Apply patterns using fnmatch notation (supports wildcards and directory wildcards).

- Use exact filenames to exclude a single file across the repo.
- Use
*and?for simple wildcards and**for recursive directory matches. - Combine patterns to exclude specific file types only in certain folders while leaving them enabled elsewhere.
- Test patterns in a safe environment or a small repository to confirm they match the intended files before applying org-wide.
- Proprietary algorithms or company-specific intellectual property you do not want processed by external models.
- Customer data and personally identifiable information (PII) that must not be sent to AI services.
- Security credentials: API keys, private certificates, or other secrets.
- Indirect access: Exclusion is not an absolute barrier. IDEs may provide semantic information (for example symbol names, type information, or indexing data) to the Copilot assistant, which can allow indirect access to details about excluded files. Be mindful of which IDE features (like symbol/server indexing or language servers) are enabled.

- Visual indicators: Most IDEs display visual cues when content is excluded, helping you verify which files are protected.
- Exclusion applies only to Copilot processing; it does not change repository visibility, branch protections, or other access controls. Continue to use standard source-control and permission practices.
Content exclusion helps prevent Copilot from processing files, but it is not a substitute for proper access controls. Always combine exclusions with repository permissions, secrets management, and secure development practices.
- Enhanced security for sensitive code and intellectual property.
- Better compliance with data protection and privacy requirements.
- Clear control over which content can inform AI suggestions, reducing leakage risk.

- GitHub Copilot documentation: https://docs.github.com/en/copilot
- GitHub Enterprise administration: https://docs.github.com/en/enterprise-server
- fnmatch pattern syntax reference: https://docs.python.org/3/library/fnmatch.html