Your profile

One profile for every MSDEVBUILD site. Only you can see it, and the site owner if you write in.

Revision pack

GH-300 cheat sheet

One sheet per exam area, made from the 30 lessons on this site. Print it, save it as a PDF, or press Listen and revise on a walk. Each line links back to its lesson if something doesn't make sense.

⏰ The last 30 minutes before the exam

Don't learn anything new now. Read this once, then put it away.

In the exam room

  • You have about 100 minutes for the questions. The pass mark is 700 on a scale of 1–1000, which isn't the same as 70% of questions right.
  • Answer every question. There's no penalty for a wrong guess, but a blank always scores zero.
  • Mark anything you're unsure of for review and move on. Come back at the end with fresh eyes.
  • If a section warns that you can't return to it, believe it. Review everything before you leave.
  • Read the last line of a long scenario first, so you know what you're looking for.
  • Watch for "least", "most cost-effective" and "minimise administrative effort". They decide which correct-looking option is the right one.

Look-alikes people mix up

Ask vs Edit vs Agent mode
“Copilot should run the tests and fix failures without being told which files to change” = Agent mode. “Explain this regex” = Ask. “Apply this rename to these three files and review each diff” = Edit.
Inline suggestions vs Chat vs Copilot CLI vs coding agent
“Work on an issue in the background and open a pull request” = Copilot coding agent. “Run a prompt in a CI script with only write access” = copilot -p --allow-tool 'write'.
Copilot Free vs Pro vs Pro+ vs Business vs Enterprise
“Exclude files from Copilot for everyone in the company” or “manage seats with the REST API” point to Business or Enterprise. Personal plans don’t have organization policies.
Custom instructions vs prompt files vs custom agents
“Make Copilot code review apply our standards on every PR” = put them in .github/copilot-instructions.md. “A reusable prompt the whole team runs with a slash command” = a prompt file.

Domain 1: Responsible AI (15–20% of the exam)

Generative AI Risks and Limitations

Generative AI tools like GitHub Copilot predict the most likely next code from patterns, so they can be confidently wrong. The main risks are hallucinations (invented APIs or packages), insecure or outdated code, bias, non-deterministic output and a limited context window. The model can't run, test or truly understand your code, which is why every suggestion is a draft you review and test.

  • Copilot predicts likely code from patterns. It doesn't run, test or understand it.
  • Hallucinations: invented functions, packages, flags or settings that look plausible.
  • The knowledge cut-off means suggestions can be outdated or miss recent security fixes.

🎯 Exam tip: "Suggests a method that does not exist" = hallucination.

⚠️ Watch out: Installing a package Copilot named without checking it exists and is the real one.

Responsible AI: Principles, Harms and Mitigations

Responsible AI means using AI in a way that's fair, safe and accountable. Microsoft's six principles are fairness, reliability and safety, privacy and security, inclusiveness, transparency and accountability. With Copilot, the harms to watch are hallucinated or insecure code, bias, licensing questions, privacy leaks and over-reliance, and you reduce them with human review, tests, code scanning, content exclusions, the public code filter, fake sample data and being open about AI use.

  • Six principles: fairness, reliability and safety, privacy and security, inclusiveness, transparency, accountability.
  • Harms with AI coding tools: hallucinated or insecure code, bias, IP and licensing questions, privacy leaks, over-reliance.
  • Each harm has a matching mitigation, and human review sits under all of them.

🎯 Exam tip: "Who is responsible for AI-generated code" = the developer and team (accountability).

⚠️ Watch out: Treating Copilot as accountable for a bug it suggested.

Validate Copilot Output and Use It Responsibly

You validate Copilot output because it predicts code and can't check it, so a suggestion can look right and still be wrong, insecure or outdated. Read it until you understand it, run tests with edge cases, lint it, let code scanning and dependency review check it, and keep human pull request review before merge. Operating Copilot responsibly also means giving it good context, keeping secrets and personal data out of prompts, and owning what you accept.

  • AI output is a draft. It can be wrong, insecure, outdated or biased while looking confident.
  • Understand the code before you accept it.
  • Test it, with edge cases, and run the linter and type checks.

🎯 Exam tip: "Best way to confirm a suggestion is correct" = run tests (with edge cases), not "ask Copilot if it is correct".

⚠️ Watch out: Letting Copilot write both the code and the only tests, then trusting both.

Domain 2: Copilot Features (25–30% of the exam)

GitHub Copilot Plans: Free, Pro, Business and Enterprise

GitHub Copilot has five plans. Copilot Free, Pro and Pro+ are for individuals, with Free capped by monthly limits. Copilot Business is bought by an organization per seat and adds central seat management, policies, content exclusions and the audit log, and Copilot Enterprise adds more on top for companies on GitHub Enterprise Cloud. Premium models use a monthly premium request allowance, and extra usage is either paid for or blocked by a budget.

  • Individual plans: Copilot Free (monthly limits), Pro and Pro+.
  • Organization plans: Copilot Business (per seat) and Copilot Enterprise (GitHub Enterprise Cloud).
  • Business and Enterprise add seat management, policies, content exclusions and audit log events.

🎯 Exam tip: "Organization needs to manage who gets Copilot and set policies" = Copilot Business (or Enterprise).

⚠️ Watch out: Thinking content exclusions are available on Free or Pro. They're Business and Enterprise features.

Set Up GitHub Copilot in Your IDE

To enable Copilot in VS Code, install the GitHub Copilot Chat extension, sign in with GitHub using an account that has Copilot access (Copilot Free, a paid plan or a seat from your organization), and check the Copilot icon in the status bar. The github.copilot.enable setting turns completions on or off per language. Visual Studio, JetBrains IDEs, Xcode, Eclipse and Vim/Neovim have their own Copilot extension with the same GitHub sign-in.

  • VS Code: install the GitHub Copilot Chat extension, which brings chat, inline suggestions and agents.
  • Sign in with a GitHub account that has Copilot Free, a paid plan or an organization seat.
  • The status bar icon shows Copilot's state and opens quick settings.

🎯 Exam tip: "Turn off Copilot for Markdown files only" = github.copilot.enable with that language set to false.

⚠️ Watch out: Signing in with a personal account when the seat belongs to the work account.

Inline Suggestions, Chat, Edit and Agent Mode

You trigger GitHub Copilot in four main ways. Inline suggestions appear as grey ghost text while you type (Tab accepts, Esc dismisses, Alt+] shows the next one). Inline chat (Ctrl+I) changes the code in front of you. The Chat view (Ctrl+Alt+I) has three modes: Ask answers without editing, Edit changes the files you pick for you to Keep or Undo, and Agent plans, edits, runs commands after your approval and iterates until the task is done. In the terminal, Copilot CLI does the same agent work.

  • Inline suggestions: Tab accept, Esc dismiss, Alt+] / Alt+[ next and previous (Option on macOS), Ctrl+Right Arrow next word, Ctrl+Enter completions panel.
  • Next edit suggestions (NES) predict your next edit, not only the next characters.
  • Inline chat is Ctrl+I and changes code in place; the Chat view is Ctrl+Alt+I.

🎯 Exam tip: "Answer only, no file changes" = Ask mode.

⚠️ Watch out: Using Agent mode just to ask a question, when Ask would answer without touching files.

Copilot Chat: Slash Commands, Participants and Limits

In Copilot Chat, slash commands run common jobs (/explain, /fix, /tests, /doc, /new, /clear, /help), participants starting with @ bring in a domain expert (@workspace, @vscode, @terminal, @github), and # adds context (#file, #selection, #codebase, #terminalLastCommand, #changes). The model picker (including Auto) chooses the model your plan and organization allow, 👍 / 👎 sends feedback, and prompt files (.github/prompts/*.prompt.md, run as /name) reuse a good prompt. Chat only sees the context you give it in a finite context window, and its answers can be wrong.

  • Slash commands: /explain, /fix, /tests, /doc, /new, /clear, /help.
  • Participants (@): @workspace, @vscode, @terminal, @github.
  • Context (#): #file, #selection, #codebase, #terminalSelection, #terminalLastCommand, #changes. You can also drag in files and images.

🎯 Exam tip: "Generate unit tests for the selected function" = /tests.

⚠️ Watch out: Keeping one endless chat for unrelated topics.

GitHub Copilot CLI: Install and Key Commands

GitHub Copilot CLI is an AI agent in your terminal, run with the copilot command. It reads the repo you're in, answers questions, edits files and runs commands after asking you. Install it with npm install -g @github/copilot (Node.js 22+), brew install --cask copilot-cli, winget install GitHub.Copilot or the install script. On first run it asks you to trust the folder, then you sign in with /login (or a fine-grained token in COPILOT_GITHUB_TOKEN, GH_TOKEN or GITHUB_TOKEN). Inside a session, slash commands like /model, /mcp, /usage and /help control it, @path adds a file and !cmd runs a shell command.

  • Copilot CLI is the copilot command: an agent in the terminal that asks before it edits or runs anything new.
  • Install: npm install -g @github/copilot (Node.js 22+), brew install --cask copilot-cli, winget install GitHub.Copilot, or curl -fsSL https://gh.io/copilot-install | bash.
  • copilot update and copilot version keep it current.

🎯 Exam tip: "Install Copilot CLI with npm" = npm install -g @github/copilot.

⚠️ Watch out: Installing on Node.js 20 and wondering why npm fails. It needs 22 or later.

Copilot CLI Sessions, Scripts and Files

GitHub Copilot CLI runs two ways. An interactive session (copilot, or copilot -i "…" to start with a prompt) asks before each new tool, and a yes can last for the session; /exit saves it and copilot --continue or --resume brings it back. A non-interactive run (copilot -p "…") does one prompt and exits, so it can't ask: it only uses tools you pre-approve with --allow-tool (such as 'write' or 'shell(git)'), and --deny-tool always wins. Use it to generate scripts and tidy files, then read the result before you run it.

  • copilot starts an interactive session; copilot -i "prompt" starts one with a first prompt.
  • copilot -p "prompt" runs once and exits; it can only use pre-approved tools.
  • --allow-tool and --deny-tool take patterns: 'write', 'shell', 'shell(git)', '<mcp-server>(tool)'. Deny wins.

🎯 Exam tip: "Run Copilot CLI in a script with no prompts" = copilot -p plus --allow-tool.

⚠️ Watch out: Expecting copilot -p to pause and ask for permission.

Agent Mode, MCP Servers and Sub-Agents

Agent mode lets Copilot take a whole task: it plans, finds and edits files, runs terminal commands after you approve them, reads the output and iterates until the task is done. Copilot Edits (Edit mode) only changes the files you choose. MCP (Model Context Protocol) servers give the agent extra tools, such as the GitHub MCP server at https://api.githubcopilot.com/mcp/, configured in .vscode/mcp.json and allowed or blocked by an organization's MCP policy. Agent sessions keep separate pieces of work apart, and a sub-agent does a side task in its own context and returns only a summary, so the main conversation's context window stays focused.

  • Agent mode plans, edits files, runs terminal commands after approval and iterates until done.
  • Copilot Edits (Edit mode) changes only the files you add and shows diffs to Keep or Undo.
  • MCP servers add tools. VS Code reads .vscode/mcp.json with a "servers" object; the CLI uses /mcp and ~/.copilot/mcp-config.json.

🎯 Exam tip: "Connect Copilot to an external tool or data source" = MCP server.

⚠️ Watch out: Thinking Edit mode runs tests. Only Agent mode runs commands.

Custom Instructions and Prompt Files

Custom instructions are standing rules that Copilot adds to requests for you. Repository-wide rules go in .github/copilot-instructions.md, which Copilot Chat, the coding agent and code review all read; path-specific rules go in .github/instructions/*.instructions.md with an applyTo glob; agents also read AGENTS.md. A prompt file (.github/prompts/*.prompt.md) is a reusable prompt you run with /name in chat, with front matter for mode, description, tools and model and ${input:name} variables, so everyone on the team sends the same request.

  • .github/copilot-instructions.md holds repository-wide rules. Copilot Chat, the coding agent and code review read it.
  • Path-specific rules go in .github/instructions/*.instructions.md with an applyTo glob in front matter.
  • Agents also read AGENTS.md. Personal and organization instructions can exist too.

🎯 Exam tip: "Rules for the whole repository, used by chat, coding agent and code review" = .github/copilot-instructions.md.

⚠️ Watch out: Putting every rule in copilot-instructions.md so test-only rules apply to all code.

Copilot Code Review on Pull Requests

Copilot code review reads a pull request and leaves review comments, often with a suggested change you can commit in one click. You add Copilot under Reviewers (or ask for a review in your IDE), or a ruleset requests it automatically on new pull requests. Its review is always a Comment: it never approves or requests changes and doesn't count toward required approvals, so a person still approves and merges. It follows your team's standards from .github/copilot-instructions.md and path-specific .instructions.md files, and it's part of the paid Copilot plans.

  • Request Copilot under Reviewers on a pull request, or ask for a review from the IDE.
  • A ruleset can request a Copilot review on every new pull request automatically.
  • Copilot leaves Comment reviews with suggested changes you can commit.

🎯 Exam tip: "Review every new PR automatically" = a ruleset that requests a Copilot review.

⚠️ Watch out: Expecting Copilot's review to satisfy a "1 required approval" branch rule.

Copilot Spaces, Spark and Pull Request Summaries

Three Copilot features on github.com solve three different problems. A pull request summary comes from the Copilot button in the PR description box: it describes what changed and which files, and you edit in the *why*. Copilot Spaces collect curated context (files, issues, notes and instructions) for a topic, so every question asked in that space is grounded in the same sources and the team can share it. GitHub Spark turns a plain-language description into a working micro app you can refine and publish; it's available on Copilot Pro+ and Copilot Enterprise.

  • The Copilot button in the pull request description box writes a summary of the changes.
  • Edit the summary. Add the why, the risk and how to test, which a diff can't tell Copilot.
  • Copilot Spaces gather files, issues, notes and instructions so answers are grounded in the same sources.

🎯 Exam tip: "Describe the changes in a pull request quickly" = Copilot PR summary in the description box.

⚠️ Watch out: Opening a pull request with an unedited Copilot summary that says what changed but not why.

Copilot Policies for Organizations and Enterprises

Copilot policies decide what members with a Copilot seat can use. In Organization settings › Copilot, Access sets who gets a seat (all members, selected members and teams, or nobody), Policies switch features on or off (Copilot Chat in the IDE and on github.com, Copilot CLI, Copilot code review, Copilot coding agent, MCP servers in Copilot and suggestions matching public code), and Models chooses which models appear in the picker. An enterprise can enforce a policy for all its organizations, which they can't override, or leave it at No policy so each organization decides.

  • Organization settings › Copilot › Access: seats for all members, selected members and teams, or nobody.
  • Policies switch features: Copilot in the IDE, Copilot Chat on github.com, Copilot CLI, code review, coding agent, MCP servers, suggestions matching public code.
  • Models controls which models members can pick. A disabled model disappears from the picker.

🎯 Exam tip: "Organizations can't change this setting" = the enterprise enforces the policy.

⚠️ Watch out: Trying to change an enforced enterprise policy at the organization level.

Audit Log Events and Managing Seats with the REST API

Every Copilot admin change leaves a trail in the organization's audit log: events start with copilot. (seats added or cancelled, policy changes, content exclusion changes) and you find them by searching action:copilot. To manage the subscription in code, use the Copilot user management REST API: GET /orgs/{org}/copilot/billing for the settings, GET /orgs/{org}/copilot/billing/seats for every seat with last_activity_at and last_activity_editor, and POST or DELETE /orgs/{org}/copilot/billing/selected_users (or /selected_teams) to add or cancel seats. The token needs the manage_billing:copilot scope, and a cancelled seat stays active until the end of the billing cycle.

  • Copilot audit log events start with copilot. Search action:copilot.
  • Logged events include seats added or cancelled, policy changes and content exclusion changes.
  • GET /orgs/{org}/copilot/billing shows the subscription settings and seat counts.

🎯 Exam tip: "Who changed a Copilot policy?" = audit log, search action:copilot.

⚠️ Watch out: Expecting a cancelled seat to stop working immediately.

Domain 3: Data & Architecture (10–15% of the exam)

How GitHub Copilot Handles Your Data

When you use GitHub Copilot, the IDE extension collects context (code around your cursor, the file name and language, related open tabs), builds a prompt and sends it encrypted over HTTPS to the GitHub Copilot proxy. The proxy authenticates you and runs pre-filters, the large language model generates a reply, and post-processing checks it before it reaches your editor. With Copilot Business and Enterprise, your code isn't used to train the models. Per the GitHub Copilot Trust Center at the time of writing, prompts and suggestions from IDE code completions aren't retained once the response is returned, while other features such as chat and the CLI may keep them for up to 28 days. Engagement data (accepts, rejects, errors) is kept to run the service and power usage metrics.

  • Flow: IDE extension gathers context → builds a prompt → HTTPS → Copilot proxy (auth, pre-filters) → model → post-processing → editor.
  • Only the context the extension picks is sent for a completion, not your whole repository.
  • Copilot Business and Enterprise data isn't used to train GitHub's models.

🎯 Exam tip: "Is our code used to train the model on Copilot Business?" = No.

⚠️ Watch out: Thinking Copilot uploads the whole repository for every suggestion.

How GitHub Copilot Builds a Prompt from Context

Copilot never sees "your project" as a whole. For an inline suggestion, the IDE extension gathers the code before and after your cursor, the file name and language, and related snippets from open tabs, then ranks and trims them into a prompt that fits the model's limited context window. In chat, the prompt also includes your question, the active file or selection, anything you attach (#file, #selection, #codebase, #terminalLastCommand, images), custom instructions and earlier turns of the conversation. Content exclusions remove files from that context, and Used n references shows what was really sent.

  • Inline suggestion context: code before and after the cursor, file name and language, related snippets from open tabs.
  • The context window is limited, so context is ranked and trimmed before it's sent.
  • Chat adds: your question, active file or selection, # variables, @ participants, custom instructions and chat history.

🎯 Exam tip: "Improve inline suggestions with related code" = open the related file in a tab.

⚠️ Watch out: Assuming Copilot reads the whole repository for every inline suggestion.

GitHub Copilot Proxy Filtering and Post-Processing

Every Copilot request passes through a GitHub-hosted proxy. On the way in, the proxy authenticates you (signed in, with Copilot access) and runs pre-filters that catch harmful or offensive content and prompt injection attempts before the model sees the prompt. On the way out, post-processing checks the model's reply for code quality and common insecure patterns, offensive content, and, when the Suggestions matching public code policy is set to Block, matches of about 150 characters with public code. A blocked suggestion simply isn't shown; with Allow, matches come with a code reference. Filters reduce risk, but you still review, test and scan everything you accept.

  • Every Copilot request goes through a GitHub-hosted proxy over HTTPS.
  • Inbound: authentication, then pre-filters for harmful or offensive content and prompt injection.
  • Outbound: post-processing for quality, common insecure patterns, offensive content and public code matches.

🎯 Exam tip: "Which component checks prompts for offensive content before the model?" = the proxy pre-filters.

⚠️ Watch out: Thinking post-processing guarantees secure code.

The Copilot Code Suggestion Lifecycle and LLM Limits

A Copilot inline suggestion has a lifecycle: you pause typing, the IDE extension gathers context and checks content exclusions, builds a prompt that fits the context window, and sends it over HTTPS to the Copilot proxy (auth and pre-filters). The LLM predicts tokens, post-processing filters the reply, and it appears as grey ghost text. You Tab to accept, Esc to dismiss, Alt+] / Alt+[ to cycle alternatives, Ctrl+→ to accept word by word, and engagement data records what you chose. LLM limits still apply: a knowledge cut-off, hallucinated APIs or packages, insecure or outdated code, bias, non-deterministic output, a limited context window, weaker results for rare languages, and no real understanding or execution of your code.

  • Lifecycle: pause → gather context → exclusions → prompt → HTTPS → proxy (auth, pre-filters) → LLM → post-processing → ghost text → accept or reject → engagement data.
  • Keys: Tab accept, Esc dismiss, Alt+] / Alt+[ cycle (Option on macOS), Ctrl+→ next word, Ctrl+Enter completions panel.
  • Next edit suggestions predict your next edit based on recent changes.

🎯 Exam tip: "See an alternative suggestion" = Alt+] (next) or Alt+[ (previous).

⚠️ Watch out: Treating ghost text as verified because it looks confident.

Domain 4: Prompt Engineering (10–15% of the exam)

Prompt Structure and Context for GitHub Copilot

A good Copilot prompt has three parts: a goal (what you want and why), context (which code, framework or data it applies to) and constraints (style, edge cases, what not to change). Copilot only knows what reaches the prompt. In the editor, context comes from the current file, code around the cursor and open tabs. In chat, it comes from the active file or selection, what you attach with #file, #selection, #codebase or images, @ participants such as @workspace, custom instructions in .github/copilot-instructions.md, and earlier chat history. Be specific, point at the right code, and check Used n references to see what was used.

  • Prompt structure: goal + context + constraints. Add examples when the format matters.
  • Copilot only knows what reaches the prompt.
  • Editor context: current file, code around the cursor, open tabs. Comments steer inline suggestions.

🎯 Exam tip: "Improve a vague prompt" = add the goal, the context (file, function) and constraints.

⚠️ Watch out: Vague prompts like "fix this" with no file, no expected behaviour and no constraints.

Zero-Shot and Few-Shot Prompting with GitHub Copilot

A zero-shot prompt gives Copilot only the instruction ("write a log line for a failed payment"), so it falls back to the most common pattern it knows. A few-shot prompt adds one or more examples of the input and output you want, then asks, so Copilot copies your format, naming and style. Use zero-shot for common, well-known tasks and few-shot when your format is unusual or house-specific. In the editor, a couple of example lines above the cursor work as few-shot for inline suggestions too. Best practice: be specific, give examples, keep each prompt to one task, and iterate on the answer.

  • Zero-shot is the instruction only; Copilot uses the most common pattern it has seen.
  • Few-shot adds examples of the output you want before the request; Copilot follows them.
  • Few-shot wins for unusual or house-specific formats, naming and styles.

🎯 Exam tip: "Copilot ignores our custom format" = add examples (few-shot).

⚠️ Watch out: Expecting Copilot to guess a house format from a zero-shot prompt.

Prompt Engineering Principles and Chat History in Copilot

Prompt engineering means shaping what you send Copilot so it can act on it: one clear task, specific details, short and relevant context, examples when the format matters, then refine. Microsoft Learn sums it up as the 4 S's: single, specific, short and surround (keep related files open, use clear names). When you send a chat message, the IDE adds your selection, the active file, any # references, custom instructions and the earlier messages in the same chat, sends that prompt over HTTPS through the Copilot proxy to the model, and filters the reply before you see it. Chat history makes follow-ups like "now add tests" work, but old or unrelated turns can confuse answers and use up the context window, so start a new chat or type /clear when the topic changes.

  • Principles: one task, specific details, short and relevant context, examples, iterate.
  • Microsoft Learn's 4 S's: single, specific, short, surround.
  • Prompt flow: your words + selection/active file + # references + instructions + chat history → proxy (auth, filters) → model → post-processing → chat.

🎯 Exam tip: "Answers reference something from earlier in the conversation" = chat history is part of the prompt.

⚠️ Watch out: Keeping one endless chat for every topic of the day.

Domain 5: Productivity (10–15% of the exam)

Generate, Refactor and Document Code with GitHub Copilot

Copilot speeds up three everyday jobs. Generate: describe what you want in a comment or a chat prompt and accept the inline suggestion or code block. Refactor: select code and ask, usually in Edit mode, for a change that keeps the behaviour the same; review the diff, run the tests, then Keep or Undo. Document: /doc writes doc comments, and chat can draft README sections or explain a file. It also cuts context switching: /explain, @workspace and #codebase answer questions about unfamiliar code inside the IDE instead of a browser search. Every result is a draft you review and test.

  • Generate: comments, signatures or chat prompts; accept with Tab or insert from chat.
  • Refactor: select the code, use Edit mode, say the behaviour must not change, review the diff, run tests, Keep or Undo.
  • Document: /doc for doc comments; chat can draft README sections and explain code.

🎯 Exam tip: "Restructure code without changing behaviour" = refactor, review the diff and run tests.

⚠️ Watch out: Refactoring without tests, so a behaviour change goes unnoticed.

Generate Sample Data and Modernize Legacy Code with Copilot

For sample data, ask Copilot for the exact shape you need (JSON, CSV, SQL inserts) with clearly fake values such as example.com emails and "Test Customer" names, and never paste real customer data into a prompt. For legacy code, start with /explain so you understand what it does, add tests that pin the current behaviour, then ask Copilot to modernize it in small steps that keep the same output. Agent mode can update callers and run the tests for you after you approve. Copilot can also translate between languages, but it's weaker on rare or old languages, so review and test every change.

  • Ask for sample data in an exact shape, pointing Copilot at the schema or type.
  • Use clearly fake values (example.com, test names); never put real personal data in a prompt.
  • Legacy first step: /explain, then characterization tests that pin current behaviour.

🎯 Exam tip: "Create test data without exposing personal information" = ask for fake/synthetic data.

⚠️ Watch out: Pasting production records into chat to get realistic test data.

Unit Tests, Integration Tests and Edge Cases with Copilot

Select the code and run /tests in Copilot Chat (or ask agent mode) to generate unit tests, which check one function in isolation. Name the edge cases you care about (unknown input, missing values, zero, empty lists, very large numbers, boundaries) and ask Copilot to suggest ones you missed. Check every test has a clear assertion of one behaviour with an exact expected value. Integration tests check pieces working together, such as an API route calling the discount module; ask Copilot for the setup and teardown too. Run the tests: when a generated test fails, decide whether the code has a bug or the test is wrong, then fix the right one.

  • /tests on a selection generates tests in the project's framework; agent mode can also write and run them.
  • Unit tests check one function in isolation; integration tests check parts working together.
  • Name edge cases in the prompt and ask Copilot for the ones you missed.

🎯 Exam tip: "Generate tests for selected code" = /tests.

⚠️ Watch out: Accepting tests with weak assertions that can never fail.

Security Improvements and Performance Fixes with GitHub Copilot

GitHub Copilot can review code for security and performance when you ask. Select the code and ask in Chat ("Is this safe?", "Find vulnerabilities", "This runs in a loop, can it be faster?") or use /fix. It spots common problems such as SQL injection, hard-coded secrets, missing input validation, N+1 queries and repeated work in loops, then proposes a fix. Copilot's filters also block some insecure patterns in suggestions, but not all. Treat its advice as a starting point: confirm with tests, code scanning (CodeQL), dependency checks and a human review.

  • Ask Copilot directly to review for security or performance, and name the risk you care about.
  • Common security finds include SQL injection, hard-coded secrets, missing input validation and unsafe deserialisation.
  • Common performance finds include N+1 queries, repeated work inside loops, selecting more data than needed and missing caching.

🎯 Exam tip: "Use Copilot to find vulnerabilities in selected code" = select it and ask Chat (or /fix for a known problem).

⚠️ Watch out: Accepting a security fix because it looks right, without a test that shows the old bug and the fix.

Domain 6: Privacy & Safeguards (10–15% of the exam)

GitHub Copilot Content Exclusions and Editor Settings

Content exclusions stop GitHub Copilot from using chosen files. A repository admin lists paths under Settings › Copilot › Content exclusion; an organization admin writes YAML that maps repositories (or "*" for all) to paths; enterprises can set them too. In supported IDEs an excluded file gets no inline suggestions and isn't used as context for other files. Exclusions need Copilot Business or Enterprise, can take up to 30 minutes to reach an open IDE, show up in the audit log, and don't apply to every Copilot feature. Separately, the github.copilot.enable editor setting turns completions on or off per language for you only.

  • Content exclusions are a Copilot Business and Enterprise feature.
  • Repository level is a list of paths; organization level is YAML mapping a repository (or "*") to paths; enterprises can also set them.
  • Excluded files get no inline suggestions and aren't used as context in supported IDEs.

🎯 Exam tip: "Stop Copilot using one folder in one repository" = repository settings › Copilot › Content exclusion.

⚠️ Watch out: Treating the per-language editor setting as a way to protect sensitive files.

Who Owns GitHub Copilot Output, and Its Limits

GitHub doesn't claim ownership of Copilot's suggestions. Once you accept a suggestion it's part of your code, and you're responsible for it: whether it's correct, secure, and allowed under the licences involved. Copilot's output has limits: it can be wrong, insecure, outdated (the model has a training cut-off), it can invent APIs or packages, it may match public code under a licence, and it can't run or truly understand your code. Business and Enterprise terms include IP indemnity, so know what your plan's terms say. In practice: review, test, scan and check licences before anything ships.

  • GitHub doesn't claim ownership of Copilot suggestions.
  • The developer who accepts a suggestion is responsible for its correctness, security and licensing.
  • Output can be wrong, insecure, outdated or invented, and may match public code.

🎯 Exam tip: "Who is responsible for code accepted from Copilot?" = the developer (and their organization).

⚠️ Watch out: Thinking GitHub or Microsoft owns code Copilot helped write.

Public Code Matching in Copilot: Block or Show References

When a Copilot suggestion matches code in a public GitHub repository (a match of about 150 characters or more), the "Suggestions matching public code" policy decides what happens. Block hides the matching suggestion. Allow shows it and adds a code reference: the matching repositories and their licences, in VS Code's Output › GitHub Copilot Log (Code References) and in chat answers. Organization owners set it for Business and Enterprise seats (an enterprise can enforce it); individuals on Free, Pro or Pro+ set it in their own Copilot settings. Either way, you're responsible for what you accept.

  • The policy is "Suggestions matching public code" with values Block and Allow.
  • A match is about 150 characters or more of code that matches a public repository.
  • Block hides matching suggestions; Allow shows them with code references (repository and licence).

🎯 Exam tip: "Prevent suggestions that match public code" = set the policy to Block.

⚠️ Watch out: Thinking Block means Copilot can never produce code like public code. It hides matches it detects.

Troubleshoot GitHub Copilot Suggestions and Content Exclusions

When Copilot goes quiet, start with the status bar icon and work outward. Are you signed in with an account that has a seat? Is the file excluded by a content exclusion? Are completions disabled for that language in github.copilot.enable? Is the public code filter (Block) hiding a match? Is a proxy or firewall blocking Copilot's endpoints? Is the extension up to date, and does an organization policy turn the feature off? Read Output › GitHub Copilot (or run GitHub Copilot: Open Logs) for the real error. For exclusions, remember changes can take up to 30 minutes to reach an open IDE; reload the window.

  • Start with the status bar icon, then the seat and sign-in.
  • One file only? Check content exclusions and the per-language github.copilot.enable setting.
  • Missing one suggestion with Block set? The public code filter may be hiding a match.

🎯 Exam tip: "No suggestions in any file" = sign-in / seat first, then network.

⚠️ Watch out: Reinstalling everything before reading the logs.

Install MSDEVBUILD Azure

Free · no account · works offline

Save the whole course for offline ›

Hi, I’m your Nimbus

Your study buddy. Pick what we do next.

MSDEVBUILD · Multi-Stack Dev Build

Sign in to MSDEVBUILD

One account for Azure certifications and the blog: sign in here and you are signed in on both. Your XP, streak, practice deck and certificate stay in sync on every device. Optional: everything works without an account.