GH-300 - Configure privacy, content exclusions, and safeguards - Section 6.1

Configure content exclusions and editor settings to control what Copilot can access.

Configure content exclusions at the repository and organisation level to stop GitHub Copilot using specified files as context or for suggestions, and adjust editor settings that govern Copilot behaviour. Understand the scope and propagation limits of content exclusions.

Content exclusionsEditor settingsRepository exclusionsExclusion scope

Practice question for this objective

Free sampleConfigure privacy, content exclusions, and safeguardsmedium

A platform team on Copilot Business keeps deployment secrets in a file named infra/secrets.env inside a repository, and wants to stop Copilot from using that file as context for code completions and IDE chat across the whole repository. Which control should the team configure to achieve this?

  • AAdd the file path to the repository's Copilot content exclusion settings, so Copilot stops using the matched file as context for completions and chat in that repository. Correct
  • BAdd the file path to the repository's .gitignore so Git stops tracking it, because untracked files are automatically withheld from every Copilot request as context.
  • CSwitch on duplication detection for the repository, because blocking suggestions that match public code also prevents named local files from being read as context.
  • DRegister the repository with a Model Context Protocol server, because an MCP connection lets Copilot decide which sensitive files to withhold from its context.
Recognise repository content exclusions as the control that stops named files being used as Copilot context for completions and chat. GitHub Copilot content exclusions are configured by path at the repository level on Copilot Business and Enterprise, and they prevent the matched files from being sent as context for code completions and IDE chat, which is distinct from Git tracking, duplication detection, or MCP.

Why A is correct: Repository content exclusions match files by path and stop Copilot using them as context for completions and IDE chat, which is exactly the repository-wide control the team needs.

Why B is wrong: .gitignore only controls what Git tracks and has no effect on what Copilot reads as context, so a tempting overlap with version control does not exclude the file.

Why C is wrong: Duplication detection screens suggestions against public source; it does not govern which local files are used as context, so it cannot exclude the secrets file.

Why D is wrong: Model Context Protocol connects Copilot to external tools and data and does not provide a file-exclusion list, so it is the wrong mechanism for withholding context.

See more GH-300 practice questions, answers explained.

More in this domain

Back to all Configure privacy, content exclusions, and safeguards objectives, or the GH-300 cert hub.

Examworthy is not affiliated with or endorsed by GitHub. Original, blueprint-aligned practice material only.