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.
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
