MockCertMockCert
Menu

Test yourself in exam conditions

A full GitHub Certified: Agentic AI Developer mock exam: 60 questions in 120 minutes, scored against the real exam's pass mark. Your first one is free.

Start a free mock exam
Domain 6 · 2 topics · about 15 minTopics in this domainTopics

Domain 6 · Overview

Overview

Up next: Define autonomy levels · 11 steps + check · 7 min

Domain 6 · Topic 1 of 2

Define autonomy levels

Step 1 of 11

Think first How much should an AI agent be allowed to do on its own, and what decides where humans step in?

Why it matters: Questions describe an agent task and its risks and ask which level of autonomy, permission, or review fits.

Match autonomy to risk. Give each agent only the access its task needs, and take extra care where its actions cannot be undone or carry high stakes. On GitHub, agents propose changes in pull requests that people review before merging.

Step 2 of 11

Term Meaning
Assistant An AI that gives suggestions or explanations, takes no repository actions, and leaves each step to the user.
Agent An AI that interprets a goal, picks intermediate steps, uses tools, and acts inside a workflow.
Least privilege Granting only the access a task requires, not broad access.
Privileged trigger A workflow trigger, such as pull_request_target, that may get write access and secrets.
Ephemeral runner A runner that starts clean and is discarded after use, so it cannot stay compromised.

Step 3 of 11

An assistant returns control; an agent takes action in a workflow. An assistant responds to a prompt, produces output and hands control back to the user. An agent interprets a goal, decides the intermediate steps and uses tools to act inside a workflow.

Assistant and agent behavior compared

Feature Assistant Agent
Output Suggestions or explanations Actions taken inside a workflow
Planning Responds to one prompt Interprets a goal and decides intermediate steps
Repository actions None; the user applies each step by hand Uses tools to make changes

Step 4 of 11

Irreversible or high-stakes actions need the most caution. Ask whether an action can be undone and how much harm it could cause. Apps holding sensitive data or allowing high-impact actions should not get Always allow. Enterprise administrators can turn off computer use in managed settings, and users cannot override that locally.

Exam trap Always allow is not a safe shortcut for every app. Avoid it where the app holds sensitive information or supports high-impact actions.

Step 5 of 11

Give each session only the tools and permissions its task needs. Avoid broad access when narrow scoping works. For event-triggered automations, pick the exact tools allowed, which limits damage from prompt injection in untrusted input. Copilot CLI starts with file access scoped to its launch directory, and the permission mode decides when it asks first.

Step 6 of 11

Agents propose changes on a branch and wait for review before merge. By default, workflows on Copilot cloud agent code run only after a write-access user clicks Approve and run workflows. You can also stop Actions workflows from creating or approving pull requests, since unchecked merges are a security risk.

Exam trap Copilot code review does not replace people. Use it to supplement human reviews.

Step 7 of 11

By default, automations ignore events from users without write access. A setting lets you opt in. In the cloud, Copilot is read-only for users with only read access. Use pull_request_target or workflow_run only when a workflow truly needs privileged context; workflow_run separates privileges better.

Exam trap Running pull_request_target or workflow_run with a checkout of an untrusted pull request is dangerous. Attackers can use it to take over the repository.

Step 8 of 11

Anyone with write access can read every repository secret. So keep workflow credentials at least privilege. Set the default GITHUB_TOKEN to read-only repository contents and raise it per job. OIDC lets workflows reach a cloud provider without long-lived secrets. Required reviewers keep environment secrets locked until someone approves.

Example: Sets the default token permission to read-only access for repository contents.

permissions:
  contents: read

Step 9 of 11

GitHub-hosted runners start clean; self-hosted ones can stay compromised. Self-hosted runners should almost never serve public repositories, because anyone can open a pull request and compromise them. The cloud agent also has a firewall on by default to stop code or data exfiltration.

Runner types compared for isolation

Feature GitHub-hosted Self-hosted Just-in-time (JIT)
Clean virtual machine Yes, ephemeral and isolated Not guaranteed Ephemeral self-hosted runner
Persistence Cannot be persistently compromised Untrusted workflow code can compromise it Removed after at most 1 job

Step 10 of 11

GitHub follows six responsible AI principles. They cover transparency and accountability, plus fairness, inclusiveness, reliability and safety, and privacy and security. Audit logs record each action, its time, and the account behind it. SDK hooks like onPreToolUse add safety checks and approvals, and CODEOWNERS on .github/workflows forces review of workflow changes.

Step 11 of 11

  • An assistant suggests and returns control; an agent picks steps, uses tools, and acts in a workflow.
  • Take extra care where agent actions are irreversible or highly consequential.
  • Give each session only the tools, agents, and permissions its task requires.
  • Copilot code review adds to human review; it never replaces it.
  • Agent pull requests need a write-access user's approval before their workflows run.

Sources: Application card: GitHub Copilot Agents - GitHub Docs (opens in a new tab) · Define agentic AI in the SDLC - Training | Microsoft Learn (opens in a new tab) · Secure use reference - GitHub Docs (opens in a new tab) · Risks and mitigations for GitHub Copilot cloud agent - GitHub Docs (opens in a new tab) · Secure use reference - GitHub Docs (opens in a new tab)

Check

Check: Define autonomy levels

Cards to recall, then questions on this topic. About 2 minutes. Nothing is saved without an account.

Loading the cards and questions…

Up next: Implement guardrails and human-in-the-loop workflows · 11 steps + check · 7 min

Domain 6 · Topic 2 of 2

Implement guardrails and human-in-the-loop workflows

Step 1 of 11

Think first Which automated actions deserve a human approval, and which should simply run with tight permissions?

Why it matters: Questions describe a risky automation and ask which approval, policy, or permission setting contains it without slowing work.

Guardrails split actions into those that need a person and those that can run alone. Risky paths, such as merging pull requests or reaching secrets, get reviewers and policy. Everything else runs with the smallest token permissions, scoped by risk so approvals stay few.

Step 2 of 11

Term Meaning
Workflow execution protections Policies that decide which workflow runs may execute; when enforced, disallowed runs fail.
Actor rules Rules on who can trigger workflows: users, repository roles, GitHub Apps, Copilot, and Dependabot.
Evaluate status A policy enforcement status that shows when users would hit a restriction, without blocking them.
GITHUB_TOKEN A GitHub App installation access token used by a workflow, limited to its own repository.
OIDC token A token a job fetches with id-token: write; the cloud provider checks its claims before trusting it.

Step 3 of 11

Reserve human review for merges, secret access, and workflow edits. Required reviewers can gate environment secrets, so a job waits for approval before reading them. Listing .github/workflows in CODEOWNERS means any change to workflow files needs a designated reviewer first. You can also stop GitHub Actions from creating or approving pull requests.

Exam trap Letting workflows create and approve their own pull requests is not a safe shortcut. A pull request merged without proper oversight is a security risk.

Step 4 of 11

Runs from pull requests made with GITHUB_TOKEN wait for approval. When such a workflow opens or updates a pull request, the new runs start in an approval-required state. A user with write access starts them with Approve workflows to run. Using a GitHub App installation token or a personal access token instead skips that wait.

Step 5 of 11

Enforced execution protections fail disallowed runs with an error. Central policy overrides any single misconfigured workflow file. Actor rules then decide who may trigger workflows, covering individual users, repository roles, GitHub Apps, Copilot, and Dependabot.

Exam trap Write access does not have to include running CI. It does by default, but actor rules can grant write access without the right to execute workflows.

Step 6 of 11

Match protection to risk, then test policies in Evaluate mode. Production deploy workflows may need more protection than minor automations. So scope policies to specific workflow paths or required workflows. Policy insights then show whether a policy works as intended or adds needless friction.

Active and Evaluate policies compared

Feature Active (enforced) Evaluate
Disallowed runs Fail with an error Are not blocked
Policy insights show Runs that were blocked Runs that would have been blocked

Step 7 of 11

Limit the token's permissions, because any action can reach it. The token only covers the repository that holds the workflow. Permissions start from the enterprise, organization, or repository default. The workflow level, then the job level, adjusts them. Organization owners can also restrict its write access per repository.

Exam trap Not passing the token to an action does not keep it away. Actions can read it through the github.token context, so limit its permissions.

Step 8 of 11

Naming one permission sets every unnamed permission to none. Here write also grants read. Use permissions: {} to turn off every permission. A job needs id-token: write to fetch an OIDC token. The copilot-requests permission accepts only write or none.

Example: Grants only the right to fetch an OIDC token; every other permission becomes none.

permissions:
  id-token: write
  • id-token: write: required to fetch an OpenID Connect token

Step 9 of 11

The trigger event can raise or lower default token access. Check what started a workflow before trusting its default permissions. Fork and Dependabot runs are cut back, but one trigger keeps write access.

Default GITHUB_TOKEN access by trigger

Trigger Default token access Exception or extra
pull_request_target Read/write repository permission Applies even when triggered from a public fork
Other pull request event from a fork Write permissions reduced to read-only Unless Send write tokens to workflows from pull requests is selected
Dependabot pull request Read-only Only Dependabot secrets; the permissions key can raise access

Exam trap A pull_request_target run from a public fork is not read-only. Its token still gets read/write repository permission.

Step 10 of 11

OIDC tokens are short-lived and checked against a trust definition. With OIDC, the cloud provider issues a token valid for one job, which then expires. It first matches the token's subject and claims to the cloud role's trust definition. Anyone with write access can read every repository secret, so stored credentials need minimal privileges.

Exam trap Values like github.event.issue.title are not trusted input. Attackers can place malicious content there, so handle them carefully to avoid script injection.

Step 11 of 11

  • Enforced workflow execution protections make disallowed runs fail with an error.
  • Try a new policy in Evaluate status and check policy insights before enforcing it.
  • Once the permissions key names one permission, every unnamed permission becomes none.
  • Runs triggered by pull_request_target get a read/write token, even from a public fork.
  • Required reviewers keep a job from reading environment secrets until someone approves.

Sources: Secure use reference - GitHub Docs (opens in a new tab) · Use GITHUB_TOKEN for authentication in workflows - GitHub Docs (opens in a new tab) · Governing execution of GitHub Actions workflows - GitHub Docs (opens in a new tab) · About Actions policies - GitHub Docs (opens in a new tab) · GITHUB_TOKEN - GitHub Docs (opens in a new tab) · Workflow syntax for GitHub Actions - GitHub Docs (opens in a new tab) · OpenID Connect - GitHub Docs (opens in a new tab) · Script injections - GitHub Docs (opens in a new tab)

Check

Check: Implement guardrails and human-in-the-loop workflows

Cards to recall, then questions on this topic. About 2 minutes. Nothing is saved without an account.

Loading the cards and questions…

Domain 6 · after the last topic

Domain 6 review

Each topic's Check tested it on its own; this mixes them.

Mixed quiz

Take the Domain 6 quiz

7 questions mixed from every topic in this domain, each answer explained. Mixing topics is harder than one at a time, and it is what the exam does. No account needed; with a free account your answers also build your estimated exam score.

Flashcards

Domain 6 flashcards

4 cards with this domain's key facts. Flip each one and check what you knew. No account needed.

Test yourself in exam conditions

A full GitHub Certified: Agentic AI Developer mock exam: 60 questions in 120 minutes, scored against the real exam's pass mark. Your first one is free.

Start a free mock exam
All domains studiedTry a timed mock exam

Report a problem

On “”. Tell us what looks wrong; we read every report.

What is the problem?

Optional.