In short.
This GitHub guide explains content exclusion for developers and administrators who want Copilot to ignore selected files, but exclusions are not a complete access-control boundary. It documents case-insensitive path patterns, three configuration scopes, organization seat restrictions, IDE refresh behavior and manual verification procedures. Supported-client coverage, plan eligibility and pricing are not established by this page, and actual enforcement has not been assessed.
Researched and written by an AI model and checked by a second AI model. How it works
Covers the complete selected documentation page at [https://docs.github.com/api/article/body?pathname=/en/copilot/how-tos/configure-content-exclusion/exclude-content-from-copilot], including all three configuration scopes, pattern examples, agent limitations, IDE refresh and verification instructions, REST API notice and further-reading notices. Linked pages are excluded, so their client-support matrices, API details, licensing information and additional guidance are not established. Nothing was executed; documented expectations do not establish actual enforcement.
The overview
Identity
Excluding content from GitHub Copilot is GitHub's configuration guide for preventing Copilot from using selected files. It is documentation for an existing Copilot feature, rather than a separate tool or installable component.
The source is the complete documentation page at [https://docs.github.com/api/article/body?pathname=/en/copilot/how-tos/configure-content-exclusion/exclude-content-from-copilot].
Assessment
The guide is useful for choosing where to configure exclusions and translating file locations into exclusion patterns. Its practical value comes from concrete settings paths, examples and expected outcomes for inline suggestions and Copilot Chat.
Its central caution is consequential: agent checks may miss indirect file access. Use the guide to configure Copilot behavior while retaining operating-system permissions and other access controls for files that require protection.
Users
Developers can use the guide to understand exclusion patterns and check expected IDE behavior. People managing repository settings can configure exclusions for that repository, while organization and enterprise owners can manage broader rules.
Organization rules apply only to users assigned a Copilot seat by that organization. Enterprise rules apply to all Copilot users in the enterprise, making this distinction important when deciding whose usage a rule needs to cover.
Capabilities
The documented settings can exclude individual files, matching filenames and directory trees. Organization and enterprise configurations can target files within repositories or elsewhere on the file system.
The page also identifies REST API management for organization and enterprise owners. Endpoint details, authentication requirements and API limits are not included; they are delegated to a separate reference.
Using it
Requirements
Configuration requires access to the relevant GitHub settings. The enterprise procedure explicitly requires an enterprise owner, and the API notice identifies organization and enterprise owners as administrators who can manage exclusions programmatically.
The page does not establish exact repository-role requirements, eligible Copilot plans, minimum client versions or the complete supported-client list. It directs readers to separate documentation for client support.
Mechanism
Exclusions use file-path rules with case-insensitive fnmatch pattern matching. Repository settings accept a list of paths; organization settings map repository references to path lists. The quoted key "*" targets files regardless of whether they are inside a Git repository.
Repository references can use HTTP, HTTPS, Git, SSH or SCP-style syntax. Matching ignores the user and port portions and accommodates different local clone protocols. The guide also documents matching across the old and new Azure DevOps host formats.
Repository pages display inherited organization exclusions in read-only boxes. Those inherited rules cannot be edited from the repository settings.
Setup
For a repository, open Settings, then Copilot, then Content exclusion. Enter one quoted path per YAML list item in the repository exclusion field. Lines beginning with a hash character can contain comments.
For an organization, open its Settings, then Copilot, then Content exclusion, and enter repository-to-path mappings or the global "*" mapping. Enterprise owners navigate through AI controls, Copilot and Content exclusion, using the same path structure described for organizations.
Changed settings can take up to 30 minutes to reach IDEs where settings are already loaded. The guide describes reopening JetBrains IDEs or Visual Studio, using Developer: Reload Window in VS Code, and automatic fetching whenever a file opens in Vim or Neovim.
Example
At repository scope, /scripts/** excludes files in the scripts directory and its subdirectories. A pattern such as secrets.json targets that filename anywhere in the repository.
For organization-wide exclusion of files named .env, the supplied example places **/.env under the quoted "*" key. This covers Git and non-Git locations. These are documented configuration examples; their behavior has not been executed or verified here.
Assessment & evidence
Limitations
For agents in an IDE, GitHub Copilot CLI or the GitHub Copilot app, exclusions block access through Copilot tools and check identifiable file paths in commands and scripts before execution. The page explicitly warns that indirect file access might escape detection.
Exclusion is not a substitute for operating-system permissions or other access controls. Settings can also take time to propagate, organization rules have seat-assignment limits, and inherited exclusions cannot be changed from the repository page. The complete surface-by-surface support matrix is outside this page.
Reasoning
The documented scope differences make user coverage as important as path coverage. A correctly written organization rule still applies only to users receiving their Copilot seat from that organization; enterprise rules have the broader documented reach.
A practical implication of the agent limitation is that successful inline-suggestion or Chat checks cannot establish that every possible command is prevented from reading a file. Those checks demonstrate narrower expected behavior, not comprehensive access isolation.
Alternatives
Within the documented feature, owners can choose settings-based configuration or REST API management. Repository, organization and enterprise settings offer different administrative scopes.
For enforcing file-access boundaries, the guide identifies operating-system permissions and other access controls as necessary protections alongside exclusion. It does not compare competing products or provide enough evidence to recommend another vendor's approach.
Evidence
GitHub's own documentation supports the settings paths, pattern examples, scope distinctions, propagation guidance and expected verification outcomes described here. It provides instructions and limitations rather than measured security results.
No configuration changes, API calls, commands or IDE checks were executed. Actual enforcement, reliability and security effectiveness remain unassessed.
Access & freshness
Costs
The page gives no Copilot subscription prices, feature-specific charges or plan-entitlement details. The cost of obtaining and using this capability is unknown from this source. Configuration and ongoing administration costs are also not quantified.
Rights
The supplied page does not state a documentation license or redistribution permission for its text and screenshots. Those rights are unknown from this evidence. It also does not establish ownership, licensing, retention or model-training terms for content used with Copilot.
Freshness
The documentation snapshot was captured on November 15, 2026, at 02:05:54.059 UTC. That is a capture timestamp, not a publication or update date.
The page supplies no product release number, minimum client versions or last-updated date. Changes after the capture and compatibility with particular installed versions are unknown.
Actions
Before relying on an exclusion, establish that the intended Copilot client supports it, choose the administrative scope that covers the intended users, inspect inherited rules and write patterns for the actual file locations. Refresh IDE settings or allow the documented propagation interval.
Follow the guide's verification sequence: first confirm that a non-excluded file receives an expected inline suggestion, then try the same edit in an excluded file and expect no suggestion. For Chat, close other files, attach the excluded file as context and ask explain this file; the documented expectation is that Chat cannot use it and does not list it as a reference.
Retain separate access controls where file confidentiality depends on preventing access, because these verification steps do not resolve the documented indirect-access limitation.
