Skip to content

GH-300 · Domain 6: Configure privacy, content exclusions, and safeguards · 13% of the exam

Task 6.2: Apply safeguards and troubleshoot

The filter for suggestions matching public code, code references, and fixing problems with suggestions and content exclusions.

Study it

  • Blocking suggestions that match public code, and code references

    Lesson coming

  • Troubleshooting suggestions and content exclusions

    Lesson coming

Sample questions

Try each one before opening the answer. Every option is explained, with the GitHub documentation page that proves it.

Question 1 · choose 1

A developer whose Copilot seat is assigned by an organization on GitHub Enterprise Cloud wants to allow suggestions matching public code, so that she can see code references. The option is not available in her personal settings. Why?

  1. ACode references are only produced on the Copilot Pro+ plan
  2. BShe must first enable the setting in VS Code's settings.json
  3. CHer setting is inherited from her organization or enterprise, so she can't set it
  4. DThe setting only appears after she opts out of model training
Show the answer and why
  • ACode references are only produced on the Copilot Pro+ plan

    Incorrect

    Code references are not tied to Pro+; the setting itself is inherited here.

  • BShe must first enable the setting in VS Code's settings.json

    Incorrect

    The setting lives in her GitHub settings, not in the editor.

  • CHer setting is inherited from her organization or enterprise, so she can't set it

    Correct

    Members assigned a seat through an organization on GitHub Enterprise Cloud inherit the setting for suggestions matching public code.

  • DThe setting only appears after she opts out of model training

    Incorrect

    The two settings are independent.

Personal Copilot settings include an option to allow or block suggestions that match public code. If you are a member of an organization on GitHub Enterprise Cloud and your seat is assigned through that organization, you can't configure this in your personal settings; it is inherited from your organization or enterprise.

Question 2 · choose 2

An administrator added new content exclusion paths ten minutes ago, but developers still get suggestions in those files. Which actions apply the new rules right away? (Choose TWO.)

  1. AIn VS Code, run Developer: Reload Window from the Command Palette
  2. BSign out of GitHub on GitHub.com and sign back in
  3. CDelete the .github directory from the repository and clone the repository again
  4. DIn a JetBrains IDE, close and reopen the application
  5. ERun copilot --cloud in a terminal in the repository
Show the answer and why
  • AIn VS Code, run Developer: Reload Window from the Command Palette

    Correct

    Reloading the window reloads the content exclusion settings in VS Code.

  • BSign out of GitHub on GitHub.com and sign back in

    Incorrect

    Signing in again on the website is not a documented way to refresh exclusion settings in an IDE.

  • CDelete the .github directory from the repository and clone the repository again

    Incorrect

    Exclusions come from settings on GitHub, not from repository files.

  • DIn a JetBrains IDE, close and reopen the application

    Correct

    For JetBrains IDEs and Visual Studio, closing and reopening the application reloads the settings.

  • ERun copilot --cloud in a terminal in the repository

    Incorrect

    That starts a cloud-sandboxed CLI session; it doesn't refresh IDE settings.

After you add or change content exclusions, it can take up to 30 minutes for them to take effect in IDEs that have already loaded the settings. To apply them now, reload the settings: in VS Code run Developer: Reload Window, and in JetBrains IDEs and Visual Studio close and reopen the application. Vim/Neovim fetches exclusions each time a file is opened.

Question 3 · choose 1

With matching public code allowed, a VS Code user accepts an inline suggestion and wants to check whether it matched public code and under which license. Where does VS Code record this?

  1. AIn a notification that appears before the suggestion is accepted
  2. BIn the Problems panel, as a warning on the line that was inserted
  3. CIn the repository's Security tab on GitHub
  4. DIn the Output window, under GitHub Copilot Log (Code References)
Show the answer and why
  • AIn a notification that appears before the suggestion is accepted

    Incorrect

    Matches for inline suggestions are logged after acceptance, not shown as a pre-accept notification.

  • BIn the Problems panel, as a warning on the line that was inserted

    Incorrect

    The Problems panel is not where code references are logged.

  • CIn the repository's Security tab on GitHub

    Incorrect

    Code references are recorded locally in the editor's log.

  • DIn the Output window, under GitHub Copilot Log (Code References)

    Correct

    In VS Code, select GitHub Copilot Log (Code References) in the Output window; accepted suggestions that match public code add an entry with license and URL.

In VS Code, open View > Output and choose GitHub Copilot Log (Code References). When you accept an inline suggestion that matches code in a public GitHub repository, an entry is added with the file, location, code extract, license (or unknown) and the URL of the matching file.

Question 4 · choose 1

A developer with a personal Copilot Pro plan wants Copilot to stop showing suggestions that match public code. Where does she change this?

  1. AIn the repository's Settings > Copilot > Content exclusion page
  2. BIn VS Code's settings.json under github.copilot.enable
  3. CIn her GitHub Copilot settings: Suggestions matching public code > Block
  4. DIn the Copilot CLI with /settings publicCode off
Show the answer and why
  • AIn the repository's Settings > Copilot > Content exclusion page

    Incorrect

    Content exclusion controls which files Copilot reads, not public code matches.

  • BIn VS Code's settings.json under github.copilot.enable

    Incorrect

    That setting enables Copilot per language.

  • CIn her GitHub Copilot settings: Suggestions matching public code > Block

    Correct

    In Copilot settings, select Block in the dropdown for Suggestions matching public code.

  • DIn the Copilot CLI with /settings publicCode off

    Incorrect

    Public code matching is a GitHub account setting, not a CLI setting.

Personal Copilot settings on GitHub include an option to allow or block suggestions matching public code: click your profile picture, then Copilot settings, and choose Allow or Block next to Suggestions matching public code. With Block, suggestions plus about 150 characters of surrounding code are checked against public code, and matches or near matches are not shown.

Question 5 · choose 1

In IntelliJ IDEA, with public code matches allowed, a developer wants to check the license of code that matched an accepted suggestion. Where does she look?

  1. AIn the Problems tool window, under Copilot warnings
  2. BIn the IDE log file, searching for [Public Code References]
  3. CIn the repository's Insights tab on GitHub
  4. DIn the Copilot Chat panel, which lists every accepted suggestion
Show the answer and why
  • AIn the Problems tool window, under Copilot warnings

    Incorrect

    Code references are not shown in the Problems window.

  • BIn the IDE log file, searching for [Public Code References]

    Correct

    Open Help > Show Log in Finder/Explorer, open the log (idea.log for IntelliJ IDEA) and search for [Public Code References].

  • CIn the repository's Insights tab on GitHub

    Incorrect

    Code references for inline suggestions are logged locally.

  • DIn the Copilot Chat panel, which lists every accepted suggestion

    Incorrect

    Chat lists matches for its own responses, not every inline suggestion.

In JetBrains IDEs, code references for inline suggestions are written to the IDE log. Select Help > Show Log in Finder/Explorer, open the log file (idea.log for IntelliJ IDEA) and search for [Public Code References]. Entries show the time, the file and position, and each match with its license (or NOASSERTION) and URL.

Question 6 · choose 1

A developer on Copilot Business gets no inline suggestions in one file, and the Copilot icon in the status bar has a diagonal line through it. What does this indicate?

  1. AA content exclusion setting covers the file
  2. BHer monthly AI credits are exhausted
  3. CThe file's language is not supported by Copilot
  4. DCopilot is downloading a model update
Show the answer and why
  • AA content exclusion setting covers the file

    Correct

    When a file is affected by content exclusion, the status bar icon has a diagonal line; hovering shows which settings applied it.

  • BHer monthly AI credits are exhausted

    Incorrect

    Completions aren't billed in AI credits, and the icon means something else.

  • CThe file's language is not supported by Copilot

    Incorrect

    The diagonal-line icon indicates an exclusion setting.

  • DCopilot is downloading a model update

    Incorrect

    The icon doesn't indicate downloads.

With a Copilot Business or Enterprise license, you may not see inline suggestions in some files because they are excluded from Copilot by a repository administrator or organization owner. If content exclusion applies to a file, the Copilot icon in the status bar has a diagonal line through it; hover over it to see which settings applied the restriction.

Question 7 · choose 1

A developer with a working Copilot setup notices that some common code patterns get no suggestion at all, while unusual code gets suggestions normally. Which setting does the documentation point to?

  1. ANext edit suggestions being turned off
  2. BThe Bing web search setting being disabled
  3. CTelemetry being disabled in the IDE
  4. DDuplication detection blocking public-code matches
Show the answer and why
  • ANext edit suggestions being turned off

    Incorrect

    Next edit suggestions don't stop ordinary inline suggestions.

  • BThe Bing web search setting being disabled

    Incorrect

    Web search only affects Copilot Chat answers.

  • CTelemetry being disabled in the IDE

    Incorrect

    Telemetry affects activity reporting, not suggestions.

  • DDuplication detection blocking public-code matches

    Correct

    If you receive limited or no suggestions, you may have duplication detection enabled, which blocks matches with public code.

The code suggestions guide notes that if you receive limited or no suggestions from Copilot, you may have duplication detection enabled. When suggestions matching public code are blocked, matches or near matches are not shown, which is more likely for common code patterns.

Practise domain 6 →Practise all domains →