8 free GitHub GH-600 Agentic AI Developer practice questions from the CertStash pack of 58, each with the correct answer and a full explanation. The rule is the same for every exam: ten free on the product page, 8 free here, all 58 in the pack, and each step includes the one before it.
Get all 58 questions (US$39) · Download the first 10 as a PDF
Question 1
You have a repository that uses the GitHub Copilot coding agent and supports hooks stored under .github/hooks.
You need a Shell command to run automatically whenever an agent execution fails.
Which type of hook should you use?
Show answer and explanation
Correct answer: C. errorOccurred
Hooks let a repository run shell commands at defined points in an agent session, configured in files under .github/hooks. The errorOccurred event fires when an error occurs during execution, so a hook bound to it runs automatically whenever an agent execution fails. This makes it the right place for failure notifications, diagnostics collection or cleanup commands, without affecting successful runs.
Why the other options are wrong
- A. postToolUse fires after a tool completes successfully, so it does not respond to execution failures.
- B. sessionEnd fires whenever a session terminates, whether or not anything failed.
- D. agentStop fires when the main agent finishes a turn, which is not specific to errors.
Question 2
You have a repository on github.com that uses the GitHub Copilot coding agent.
You also use the GitHub Copilot CLI locally to reproduce failures and continue the same work from your terminal.
You need to verify the current token usage.
Which Copilot CLI slash command should you run?
Show answer and explanation
Correct answer: D. /context
The /context slash command in GitHub Copilot CLI shows the current context window token usage together with a visual overview of how that context is being used. Running it in the terminal session where you continue the coding agent's work tells you how much of the context window is consumed right now, which is the current token usage you need to verify.
Why the other options are wrong
- A. /compact summarizes the conversation history to reduce context usage rather than reporting the current token usage.
- B. /diff reviews the changes made in the current directory and does not report token usage.
- C. /usage displays session usage metrics and statistics rather than the context window token usage and visualization that /context shows.
Question 3
You are about to start a complex refactoring task in the GitHub Copilot CLI.
Before Copilot makes any changes, you need to review and agree on the approach.
What should you do first?
Show answer and explanation
Correct answer: C. From the Copilot CLI, switch to plan mode.
Plan mode in the Copilot CLI lets you work with Copilot on an implementation plan before any code is written. You switch into it from the prompt (Shift+Tab cycles in and out of plan mode), describe the refactoring, and review and refine the proposed approach. Only after you agree on the plan do you leave plan mode and let Copilot make changes, which suits a complex refactoring where the approach must be settled first.
Why the other options are wrong
- A. The --agent option starts the CLI with a named custom agent and does not create a reviewable plan before changes.
- B. The --allow-all option lets Copilot modify and execute files without asking for approval, which is the opposite of reviewing first.
- D. The /compact command compresses conversation history to free context space and does not produce a plan.
Question 4
You have a GitHub Enterprise repository.
An agent opens pull requests to the main branch.
You need to ensure that changes to .github/workflows/* and /infra/* require approval from designated reviewers before merge.
What should you configure?
Show answer and explanation
Correct answer: C. a branch protection rule and a CODEOWNERS file
A CODEOWNERS file maps file patterns such as .github/workflows/* and /infra/* to the designated users or teams, and those code owners are automatically requested for review when a pull request modifies files they own. Enabling Require review from Code Owners in a branch protection rule on main then blocks the merge until a code owner approves, so every agent pull request that touches workflow or infrastructure files needs approval from the designated reviewers before it can be merged.
Why the other options are wrong
- A. An agents.md file gives instructions to agents and cannot assign required reviewers to specific paths.
- B. A .copilotignore file is not a mechanism for assigning required reviewers to paths, so it cannot enforce approval from designated reviewers.
- D. copilot-instructions.md only guides Copilot's behavior and cannot require approval from designated reviewers before a merge.
Question 5
You have a GitHub repository.
You use the GitHub Copilot CLI to run an agentic workflow from the terminal.
During execution, the conversation history approaches the context limit. The agent cannot continue the current session unless the amount of retained context is reduced.
You need to continue the current session without losing all the prior progress.
Which Copilot CLI slash command should you run?
Show answer and explanation
Correct answer: D. /compact
The /compact slash command in GitHub Copilot CLI summarizes the conversation history to reduce context window usage. The session keeps a condensed record of what has been done so far, which frees context space while preserving the progress the agent needs to carry on with the current task in the same session.
Why the other options are wrong
- A. /context shows the current context window token usage and a visualization of it, but it does not reduce the retained context.
- B. /yolo enables all permissions for tools, paths and URLs and has no effect on the size of the conversation history.
- C. /clear starts a new conversation, which discards the prior progress instead of keeping it.
Question 6
A team assigns an issue to the GitHub Copilot coding agent by using the following one-line description:
Fix the login bug.
Copilot creates a pull request, but the pull request is missing changes and has an incorrect scope.
How should you resolve the issue?
Show answer and explanation
Correct answer: C. Add a clear description of the problem to the issue.
Copilot coding agent treats the assigned issue as its prompt, so the quality of the pull request depends on how well the issue is written. GitHub recommends clear, well-scoped tasks that include a clear description of the problem, complete acceptance criteria, and directions about which files need to change. A one-line issue such as Fix the login bug gives the agent no way to know the symptoms, the expected behavior or the boundaries of the change, which leads to missing changes and the wrong scope. Rewriting the issue with a clear problem description fixes the cause.
Why the other options are wrong
- A. Copilot memory stores facts learned about a repository and cannot supply the details missing from this specific issue.
- B. MCP server rate limits do not affect how the agent interprets the scope of a vague issue.
- D. copilot-setup-steps.yml prepares the agent's development environment and has no effect on task scope.
Question 7
You have a GitHub repository.
Developers use the GitHub Copilot CLI and repository-scoped hooks under .github/hooks/*.json.
You need to allow the Copilot CLI to automatically run low-risk Bash commands. The solution must prevent the autonomous execution of high-risk commands, such as sudo, rm -rf /, and curl ... | bash. What should you do?
Show answer and explanation
Correct answer: D. Configure a preToolUse hook that returns permissionDecision: "deny".
A preToolUse hook runs before the Copilot CLI executes a tool, receives the tool name and arguments, and can return a permissionDecision of allow, deny or ask. When any preToolUse hook returns deny, the tool call is blocked and the permissionDecisionReason is shown to the agent. A repository-scoped hook in .github/hooks can therefore inspect each Bash command, allow low-risk commands to run automatically, and deny dangerous patterns such as sudo, rm -rf / and piping curl output into bash, which enforces the policy at execution time rather than relying on the model to behave.
Why the other options are wrong
- A. A userPromptSubmitted hook runs when a prompt is submitted and cannot inspect or block individual Bash commands the agent later runs.
- B. Ignoring a hooks log directory in Git has no effect on which commands the CLI is allowed to execute.
- C. A sessionStart hook can only add context at the start of a session, so a banner does not stop any command from running.
Question 8
You have a GitHub Enterprise Cloud repository that uses the GitHub Copilot coding agent.
Engineers assign issues to Copilot, and Copilot creates draft pull requests. The engineers start tasks either by assigning issues on github.com or by using GitHub Copilot Chat in an IDE. Reviewers request updates by leaving pull request comments.
You discover that sometimes, Copilot uses outdated requirements after a reviewer posts an updated instruction in a pull request comment, and, in several cases, Copilot fails to resume work from the comment.
You need to ensure that iteration requests are applied to the correct pull request session and are processed consistently.
What should you do?
Show answer and explanation
Correct answer: A. Ensure that the reviewer has write access to the repository. Instruct the reviewer to mention @copilot in the pull request comments.
Iteration on a Copilot coding agent pull request is driven by comments on that pull request that mention @copilot. When such a comment is posted, Copilot picks up the reviewer's instruction and updates the same pull request. Copilot only acts on comments from people who have write access to the repository and ignores comments from anyone else. Confirming the reviewer's write access and having the reviewer mention @copilot directly in the pull request therefore routes every update to the correct session, so that requests are processed consistently.
Why the other options are wrong
- B. Copilot does not respond to @github mentions, and the access that matters is the commenter's write access, not the agent's.
- C. Unassigning and reassigning the issue starts fresh work instead of applying the reviewer's update to the existing pull request session.
- D. A new task from the IDE creates a separate session, and @github mentions do not trigger the coding agent on the pull request.
That was 8 of 58.
The full GitHub GH-600 Agentic AI Developer pack has all 58 questions, each with the answer, the explanation and why the other options are wrong, plus a questions-only copy for timed runs. US$39, paid once, with free monthly updates and a pass-or-your-money-back guarantee.
Not ready yet? Get the first 29 free as one PDF by email. Get the Half Pack →
