GitHub Copilot

Verified against GitHub Copilot agent mode · 2026-07-25

Brief VS Code's Copilot agent mode for an autonomous task without losing the leash

A task brief for Copilot's agent mode in VS Code — the mode that plans, edits across files, runs terminal commands, and iterates against its own results in a loop — scoped tightly enough with a stated done-state, terminal allowlist, and checkpoints that its autonomy stays inside a boundary you actually chose.

GitHub Copilot agent mode (VS Code)5 fillable variables

The prompt

Ready to copy — highlighted parts are example details you can swap.

Use Copilot agent mode for this task. Agent mode runs a loop inside this workspace — it plans,
edits files, runs terminal commands, reads the results, and decides on its own whether to keep
going or stop, which is exactly the behavior that needs a stated boundary before it starts, not
after it has already run for ten minutes.

WHY THIS NEEDS A STATED BOUNDARY AT ALL
Unlike a single Copilot Chat turn that proposes one edit and waits, agent mode chains many tool
calls together on its own judgment about what the next useful step is — the loop does not pause
by default between an edit, a terminal run, and the next edit unless something here tells it to. A
boundary that only exists in your head, not in this brief, is not actually a boundary agent mode
can act on.

TASK
Add pagination to the /admin/users table, which currently renders every user row at once and is slow past a few thousand rows.

WHAT COUNTS AS DONE — STATE THIS PRECISELY, AGENT MODE WILL STOP ITSELF ONCE IT BELIEVES THIS IS
TRUE
The users table renders at most 50 rows per page, has working next/previous controls, and the existing admin-users test suite passes with no test skipped or deleted.

TERMINAL COMMANDS THIS TASK IS ALLOWED TO RUN WITHOUT PAUSING FOR APPROVAL
npm run test, npm run lint, and npm run typecheck may run without pausing. Anything involving git commit, git push, or npm install must pause for approval first.
Anything outside this list should pause for manual approval, not run automatically, even if agent
mode decides mid-task that a command outside this list would help it iterate faster — a wider
terminal command touches more than this task's stated boundary was scoped to cover.

PAUSE AND SHOW ME BEFORE CONTINUING WHEN
Pause and show me the diff before touching lib/db/queries/users.ts, since that file is shared by three other pages besides this one.

FILES THIS TASK SHOULD NOT TOUCH REGARDLESS OF WHAT SEEMS HELPFUL
Do not touch lib/auth/session.ts under any circumstance — this task has nothing to do with authentication.

HOW TO WORK
Plan briefly before the first edit, then work in a tight loop: make a change, run whatever check
verifies it, read the actual result, and decide the next step from that result — not from an
assumption about what the result probably was. If a check fails, do not immediately try a second
unrelated fix; diagnose why the first attempt failed before attempting a second one, the same
discipline that applies to debugging by hand.

STOPPING CONDITIONS
Stop and report back, rather than continuing to iterate, if any of the following happens: the
done-state above is reached, a checkpoint condition above is hit, the same check fails three times
in a row without a materially different attempt in between, or a change outside the
files-off-limits boundary looks necessary to proceed at all — that last case specifically means
the task as scoped may not be achievable within its own stated boundary, and that is worth
surfacing rather than quietly working around.

WHEN IT REPORTS BACK
Read what actually changed, not just the final message summarizing it — agent mode's own account
of what it did is the least reliable source in the loop, since it is generated by the same process
that did the work and inherits its blind spots; the diff and the actual terminal output are the
record that matters.

Customize

Optional — swap in your own details for the highlighted parts above.

Why this works

Agent mode's actual mechanism is a multi-tool-call loop that chains edits, terminal runs, and further edits together on its own judgment about the next useful step, in contrast to a single Copilot Chat turn that proposes one change and waits for a response — this is precisely why a boundary has to be stated in the brief before the loop starts rather than corrected once it is already several iterations deep, since nothing internal to the loop pauses to re-check a boundary that was never written down. The terminal-command allowlist is a targeted risk control specific to a capability plain Chat does not have at all: agent mode can run shell commands on its own initiative as part of its loop, so naming exactly which commands may run without a pause, and requiring everything else to stop for approval, is the difference between an agent that can verify its own work with a test run and one that can also, in principle, run something with a far larger blast radius simply because it seemed like a reasonable next step in the moment. The 'same check fails three times' stopping condition counters a specific pattern in autonomous loops: an agent that keeps attempting superficially different variations of the same fundamentally wrong approach will keep consuming iterations without ever surfacing that the approach itself, not the attempt, is the problem — a fixed retry ceiling forces that surfacing to happen explicitly rather than silently, indefinitely. Distrusting the agent's own final summary in favor of the actual diff and terminal output follows from the same logic that applies to any self-report inside an agentic loop: the summary is generated by the same process that did the work, so it inherits whatever blind spot led to a wrong turn in the first place, and a reviewer relying on that summary alone is trusting the least independently verified account of the session that exists.

Verified against

GitHub Copilot agent mode Agent mode GA, Copilot Chat 1.270 (VS Code) · 2026-07-25

Changelog

  • 2026-07-25 Initial publish, verified against Copilot agent mode GA in VS Code (Copilot Chat 1.270).

Need this built into your business?

If a prompt isn't enough — custom software, built and maintained for you — that's Scult's day job.

EXPLORE CUSTOM SOFTWARE
Write a .github/copilot-instructions.md file Copilot actually followsA repository-wide custom-instructions file that Copilot loads automatically into every Chat request, code-review pass, coding-agent session, and commit or PR-description generation in this repo, written so each rule holds up standing alone instead of only in the context it was written in.GitHub Copilot Chat (VS Code)GitHub Copilot code review2026-07-20Scope Copilot's instructions to one directory with an applyTo instructions fileA path-scoped .github/instructions/*.instructions.md template using the applyTo frontmatter glob, so a directory-specific rule — a different test framework, a stricter API contract, a legacy pattern that must not spread — applies only where it is actually true instead of polluting the repo-wide instructions file.GitHub Copilot Chat (VS Code)GitHub Copilot coding agent2026-07-21Define a custom Copilot Chat mode instead of re-explaining your workflow every sessionA .github/chatmodes/*.chatmode.md definition — scoped tools, a fixed model, and a narrow system prompt — that turns a repeated review-and-plan style of conversation into a mode you switch into once, instead of a persona you re-describe in the first message every time.GitHub Copilot Chat (VS Code)2026-07-22Turn a prompt you keep retyping into a Copilot prompt file instead of pasting it againA .github/prompts/*.prompt.md reusable prompt file with input placeholders, invoked as a slash command from the Chat input box, so a well-tuned multi-paragraph prompt becomes one command instead of a paste you have to keep re-finding.GitHub Copilot Chat (VS Code)2026-07-22
All GitHub Copilot prompts

Check your AI visibility

One URL in, a 0–100 score and the exact fixes out.

RUN THE CHECK

Browse all the tools

15 tools across six categories
13 of them never send your data anywhere

Free · No signup · No trial clock

SEE THE DIRECTORY