agenticlately · GH-600 Study Prep
Home Phase B Lesson 2.5
PHASE B · LESSON 2.5

Execution context + repo/branch scope

Same agent, different "where." It can run as a cloud agent (inside GitHub's machinery), from the CLI, or in the IDE — and wherever it runs, it's badged to one repo and usually one branch. Reading that badge — where am I, what am I scoped to — is the skill here.

~10 minread 4quiz questions Tier 1source cited
Story

Same worker, different jobs. Monday they're badged for Tower A, third floor only — the badge won't open any other door. Tuesday they're at a different site, working out of a trailer instead of inside the building. The worker is the same; the where changes everything about what they can reach.

An agent has the same "where." It can run as a cloud agent (inside GitHub's own machinery), from the CLI (a terminal), or in the IDE (VS Code). And wherever it runs, it's badged to one repo and usually one branch — it can't wander off-site. "Evaluating the execution context" is reading that badge.

The idea, in plain English

Three official sub-skills, all about where and how an agent runs:

Definition

Execution context = the environment an agent runs in. It decides which tools even exist (recall 2.1: no ask_user or powershell in the cloud), how it's triggered, and what it can touch.

The three execution surfaces

SurfaceWhere it runsHow you reach it
Cloud agentinside GitHub Actions, in an isolated runassign via an issue or prompt; works on a branch → opens a PR
CLIyour terminal (the copilot command)interactive or scripted
IDEVS Code agent modethe editor's Copilot chat
Load-bearing fact

The cloud agent does NOT run on your local machine — it runs inside GitHub Actions, and every run gets its own isolated environment. The four non-negotiables: every agent's activity is scoped to a repo · permission-controlled · run through workflows · visible/reviewable. The target property pins a custom agent to vscode, github-copilot, or (omitted) both.

Repository + branch scope

Repository scope — an agent is scoped to a specific repo; it can't reach others by default. The cloud agent works in the source repo, and its token (and the out-of-box github MCP server) is scoped to that source repo. In Actions, the running repo is github.repository; actions/checkout's repository input controls which repo lands on the runner.

Branch scope (the subtle, exam-worthy one):

Worked example — read the execution context

"A cloud agent is assigned an issue in acme/web." Runs it: GitHub Actions (not your laptop), isolated. Scoped to: the acme/web repo; token limited to that source repo. Changes land: on a new working branch, surfaced as a PR — never a silent push to main. One-look: cloud = runs in Actions, issue-triggered, branch→PR · CLI = terminal · IDE = VS Code.

Authentication (how the context is established)

The cert-language version

An agent's execution context is the surface it runs on — cloud (inside GitHub Actions, isolated, not local), CLI (terminal), or IDE (VS Code). It is scoped to a repository (token + github MCP limited to the source repo) and works on a branch (changes surface as a PR; agent version = the profile's commit SHA on that branch). All activity is repo-scoped, permission-controlled, workflow-run, and reviewable.

Our summary · grounded in MS Learn — Agent tooling, MCP, and execution environments + GitHub Docs (custom-agents config, Copilot CLI, Actions contexts) · fetched 2026-05-30

Common confusions (read these or lose points)

Ticks this lesson done on the home roadmap. Saved in this browser.

Quiz · Lock it in

0 / 0 answered
Q1 · multiple choice

Where does the Copilot cloud agent actually execute its work?

Answer · B. The cloud agent runs inside GitHub Actions, not locally, and each run gets its own isolated environment — which is what makes execution consistent, permission-controlled, and auditable.
Q2 · multiple choice

A cloud agent finishes a code change. Where does that change appear?

Answer · C. The agent is repo- and branch-scoped: it works on a working branch and opens a PR. The base branch stays protected and review happens on the PR — no silent push to main.
Q3 · multiple choice

Copilot CLI looks for an auth token. Which source wins if more than one is set?

Answer · A. Precedence is COPILOT_GITHUB_TOKENGH_TOKENGITHUB_TOKEN. And classic ghp_ PATs can't authenticate with Copilot CLI at all — use a fine-grained PAT, OAuth, or GITHUB_TOKEN.
Q4 · explain back

In your own words: name the three execution surfaces, and explain how an agent is scoped by repo and by branch (including the branch/version subtlety).

Suggested answer

Surfaces: cloud agent (runs in GitHub Actions, isolated, issue-triggered), CLI (terminal), IDE (VS Code). Repo scope: the agent is limited to its source repository — token and the github MCP server are scoped to that repo. Branch scope: it works on a working branch and opens a PR rather than pushing to the base; and because agent versions are tied to commit SHAs, the task runs the latest profile on that branch — so different branches can run different versions.


  
Source · MS Learn — Agent tooling, MCP, and execution environments + GitHub Docs (custom-agents config, Copilot CLI, Actions contexts) · fetched 2026-05-30

Unofficial study material. Not affiliated with, endorsed by, or sponsored by GitHub or Microsoft. “GH-600” and “GitHub” are trademarks of their respective owners, used for identification only.