GitHub Agentic AI Developer · 23% of the exam

Implement tool use and environment interaction: free practice questions

5 sample questions from our 14-question bank for this domain — answers and explanations included. These are the same scenario-based style as the real GitHub exam.

1. A developer is configuring a GitHub Copilot agent to use an MCP server that provides access to an internal ticketing system. After adding the server definition, the agent does not appear to recognize any of the tools exposed by the MCP server. Which configuration step is MOST likely missing?

  • A. The MCP server URL must be added to the repository's CODEOWNERS file so the agent can discover it.
  • B. The MCP server must be listed in the agent's allowed tool set (MCP allow list) so the agent is permitted to invoke its tools.✓ Correct
  • C. The developer must create a GitHub Actions workflow that manually imports the MCP tool definitions on each run.
  • D. The MCP server's tools must be individually declared as repository secrets before the agent can access them.
Explanation

When an MCP server is added as a tool source, its tools are not automatically available to the agent—they must also be explicitly permitted via the MCP allow list. This allow list governs which MCP-exposed tools the agent may call at runtime. Option A is incorrect because CODEOWNERS controls code review assignments, not tool discovery. Option C is incorrect because MCP tool definitions are not imported via workflow steps; the allow list is the correct mechanism. Option D is incorrect because MCP tools are not configured through repository secrets; secrets store credentials, not tool permissions.

2. A Copilot agent is scoped to a single repository and configured to run in a GitHub Actions CI workflow triggered on pull request events. A team member notices that the agent is being invoked even for pull requests targeting feature branches, not just the protected `main` branch. The team wants the agent to run ONLY when a pull request targets `main`. Which configuration change achieves this?

  • A. Add a branch filter to the workflow trigger so the `pull_request` event only fires when the target branch (`base`) is `main`.✓ Correct
  • B. Add a branch protection rule on every feature branch that blocks the agent workflow from running.
  • C. Change the workflow trigger from `pull_request` to `push` and filter on commits to `main`.
  • D. Use a repository ruleset to prevent the agent from being invoked on pull requests that do not involve `main`.
Explanation

GitHub Actions supports branch filtering on `pull_request` events using the `branches` key, which filters on the base (target) branch of the PR. Setting `branches: [main]` ensures the workflow—and therefore the agent—only runs when the PR is targeting `main`. Option B is incorrect because branch protection rules govern merge requirements, not which workflows are triggered; you cannot use them to selectively suppress a workflow invocation. Option C is incorrect because changing to a `push` trigger on `main` would invoke the agent after a merge, not during the PR review phase, which changes the intended behavior. Option D is incorrect because repository rulesets enforce policies (e.g., required checks, who can push) but do not selectively suppress specific workflow triggers based on PR target branch.

3. An agent fails to complete a task after exhausting all configured retries. The team requires that failed agent actions do not silently drop work—there must be a documented escalation path. Which approach BEST implements this requirement?

  • A. Configure the agent to write the failure details to a log file in the repository's `.github/logs` directory and exit with a zero status code so the workflow appears successful.
  • B. After retry exhaustion, configure the agent to open a GitHub issue in the repository with the failure details, task context, and the last error received, and assign it to the on-call team member.✓ Correct
  • C. Configure the agent to retry indefinitely with a 1-second interval until the task succeeds, eliminating the possibility of a failed terminal state.
  • D. Set the `continue-on-error: true` flag on the agent workflow step so subsequent steps always run, and notify the team via a weekly digest.
Explanation

Opening a GitHub issue with full failure context and assigning it to the on-call team creates a durable, trackable escalation artifact that ensures no work is silently lost. This is the standard escalation path pattern for agentic systems. Option A is incorrect because exiting with a zero status code falsely signals success, hiding the failure from monitoring systems; this is the opposite of a documented escalation path. Option C is incorrect because indefinite retries can cause runaway resource consumption and hung workflows; there must be a terminal failure state with an escalation action. Option D is incorrect because `continue-on-error: true` suppresses failure signals in the workflow, and a weekly digest is not a timely escalation mechanism.

4. A developer wants to configure a Copilot agent so that it can create a new branch from `main` and open a pull request with proposed code changes, all autonomously. The agent will run inside a GitHub Actions workflow. Which TWO GitHub Actions permissions must be granted to the workflow's `GITHUB_TOKEN` for these autonomous actions to succeed? (Select TWO.)

  • A. `contents: write` — required to create and push the new branch.✓ Correct
  • B. `pull-requests: write` — required to open and describe the pull request.✓ Correct
  • C. `actions: write` — required to trigger subsequent workflow runs from the new branch.
  • D. `issues: write` — required to link the pull request to a related issue automatically.
  • E. `packages: write` — required to publish any build artifacts associated with the pull request.
  • F. `checks: write` — required to post status checks on the new pull request.
Explanation

Creating and pushing a branch requires `contents: write` (to write to the repository's git content), and opening a pull request requires `pull-requests: write`. These two permissions are the minimum necessary for the described autonomous actions. Option C is incorrect because `actions: write` controls workflow management (enabling/disabling, creating workflow dispatch events), not branch or PR creation. Option D is incorrect because `issues: write` is needed to comment on or create issues, not to open a pull request; PR-issue linking is a UI feature, not a permission requirement. Option E is incorrect because `packages: write` is for GitHub Packages and is unrelated to branch or PR operations. Option F is incorrect because `checks: write` enables posting check runs, which is a separate concern from creating a branch or PR.

5. You are setting up a GitHub remote MCP server for use by a Copilot agent in your enterprise organization. Which statement BEST describes the purpose of configuring a GitHub remote MCP server rather than a local MCP server?

  • A. A GitHub remote MCP server runs inside the repository's devcontainer and is only accessible during Codespaces sessions.
  • B. A GitHub remote MCP server is hosted and managed by GitHub, allowing agents to call GitHub-native capabilities (such as repository, issue, and pull request operations) without the developer running any server infrastructure locally.✓ Correct
  • C. A GitHub remote MCP server replaces the need for a GitHub App and eliminates all OAuth token requirements for agent authentication.
  • D. A GitHub remote MCP server stores tool output in GitHub Packages so that results persist across agent runs.
Explanation

The GitHub remote MCP server is a GitHub-hosted endpoint that exposes GitHub platform capabilities (repositories, issues, PRs, etc.) as MCP tools, so developers do not need to run or maintain their own server infrastructure. Option A is incorrect because the remote MCP server is not tied to devcontainers or Codespaces; it is a cloud-hosted service. Option C is incorrect because authentication (OAuth tokens or GitHub App credentials) is still required; the remote MCP server does not eliminate authentication. Option D is incorrect because MCP tool outputs are returned to the agent at runtime and are not stored in GitHub Packages.

9 more questions in this domain

Practice the full bank with instant grading, flashcards, and a timed mock exam.

Start practicing free
Implement tool use and environment interaction — Free GitHub Agentic AI Developer Practice Questions | DataCertPrep — Certification Prep