A GitHub Copilot Custom Agent Can Still Edit Until the Tools List Says No
A GitHub Copilot custom agent is a committed role whose tools list is the real limit, so the reviewer gets read and search only, you paste the diff, and git proves classify.js did not change.

Commit a read-only reviewer, paste the crushed-mug diff yourself, and prove classify.js did not change.
A review that says it will not edit can still rewrite classify.js if the agent file never turned edit off. The sentence in the prompt is not the lock, and the tools list is.
In this article: You add one GitHub Copilot custom agent,
.github/agents/reviewer.agent.md, whose tools arereadandsearchonly. You paste the crushed-mug commit yourself, because this role has no read-only git tool, and you refuse any edit. By the end, the reply you see names the testcrushed mug in pieces is other,git diff -- src/classify.jsprints nothing, four tests still pass, and you have committed the agent file.
Preview: written November 16, 2026, before Microsoft Ignite. Some paid steps are not yet tested live; this guide will be updated November 21, 2026.
A careful reply is not a lock. You can ask a GitHub Copilot custom agent to review the crushed-mug diff, hear a polite report, and still find a patch in src/classify.js. The sentences that said "do not edit" never removed edit.
The permission is a file you can commit. A custom agent is a selected role with its own instructions, stored as .github/agents/NAME.agent.md. This article uses .agent.md because the custom agents configuration reference does. The CLI how-to for creating custom agents puts a repository agent in .github/agents/ and takes the id from the file name with .agent.md removed, so the name you pass is reviewer. Your file is .github/agents/reviewer.agent.md. Leave tools unset and that page says the agent defaults to all tools.

The timeline is one reviewer and one commit of the agent file. You keep git show. The session does not run git. Nothing in the order rewrites src/classify.js.
By the end of this pass you have committed one reviewer file, seen a review that mentions crushed mug in pieces is other, and checked that git diff -- src/classify.js prints nothing, with four tests still passing. This review turn was not run on November 16, 2026. There is no sample review. Re-run it on your account before you trust the wording.
Starting fresh or fell behind? Run git switch -C main copilot/day-07. This replaces your main with the end of Day 7; to keep your own work, run git branch my-backup first.
Confirm the folder and the commit
These steps use Copilot CLI 1.0.112, as of November 16, 2026. Another 1.0.x line is acceptable when you write it down. If the line is not 1.0, stop. Do not reinstall. The git checks do not depend on a reply.
copilot --version
Write the line down if you did not keep it.
You work in ~/code/ticket-triage. Four tests already pass. src/classify.js is unchanged. The commit subject to find is Pin the crushed-mug ticket as other. You find that commit yourself. The agent does not run git.
On Windows: use the Ticket Triage folder. If you created it at C:\code\ticket-triage, that is the path. Run the blocks in Git Bash, or in the bash-compatible terminal you have used for npm test.
Record the tree, then find the commit, before you add a file.
cd ~/code/ticket-triage
git diff -- src/classify.js
git status --short
git log --oneline
npm test
git diff -- src/classify.js prints nothing. git status --short prints nothing. git log --oneline prints one line per commit. Copy the hash on the line whose subject is Pin the crushed-mug ticket as other. If you typed a different subject for the commit that added the test, copy that hash. Do not rewrite history. npm test reports four names: refund, shipping, other, and crushed mug in pieces is other, plus # tests 4, # pass 4, and # fail 0. Timings do not count.
If status prints paths, if the classifier diff prints a patch, or if the pass count is not four with zero failures, stop. Do not ask a session to clean the tree or edit the classifier.
Read the commit before any agent does.
git show HASH
Replace HASH with the hash you copied. The diff should add crushed mug in pieces is other under test/classify.test.js and should not change src/classify.js. If that commit changes src/classify.js, stop. Keep the git show output. You will paste it into the question. git log and git show stay your commands.
Two names go in the tools list
The custom-agents page does not name a read-only git tool. If tools is unset, that page says the agent defaults to all tools. Unrecognized names are ignored, so an invented git name does not become a read-only git tool. The page says all aliases are case insensitive, so bash is the same alias as Bash. You do not put execute, shell, Bash, bash, powershell, or edit in this file. Leave out agent, web, and todo. Set tools only to the read-only names, read and search. The line in the file stays tools: ["read", "search"].

Tool, What the page says, and In reviewer.agent.md are the three columns. Tool is the name from the custom-agents page. What the page says is the quoted behavior. In reviewer.agent.md is whether today's file includes that name.
readopens a file, includingtest/classify.test.jsandsrc/classify.js. The page calls that "Read file contents." It belongs in the file.searchlooks for the test name in the tree. The page calls that "Search for files or text in files." It belongs in the file.editwould let the model change files. The page says "Allow LLM to edit. Exact arguments can vary." You do not enable it.executewould run a shell. The page says "Execute a command in the appropriate shell for the operating system," and the aliases includeshell,Bash, andpowershell. You do not enable it, and you do not rename it toshellorbash.
Two names go in. Two stay out, including every shell alias.

The poster is that allow list. Read opens files. Search finds text. Edit, a shell, agent, web, todo, and a made-up git name stay out. An unset tools list turns every tool on, and a sentence in the body does not turn one off.
Save the reviewer file
Save this exact file. The required field is description. It states the role. You do not set model. You do not add infer. The frontmatter carries the role and the allow list. description states the read-only reviewer. tools allows only read and search.
---
description: Read-only Ticket Triage reviewer. Reports whether the test crushed mug in pieces is other is present and whether src/classify.js changed. Does not edit files. # ①
tools: ["read", "search"] # ②
---
Review the diff that added the test `crushed mug in pieces is other`.
Do not edit files. Do not change `src/classify.js`. Do not create or delete files. Do not commit. Do not run git. Do not run a shell.
Report whether that test is present and whether `classify.js` changed.
The tools for this role are read and search only. Read file contents. Search files for text. The person asking you will paste the diff. You do not have a read-only git tool. You do not request an edit, a shell, or a commit.
① description is the role text. It names a read-only Ticket Triage reviewer and the two facts to report: the crushed-mug test is present, and whether src/classify.js changed.
② tools is the allow list the page applies. The value stays exactly ["read", "search"], so edit, a shell, and their aliases stay off.
Note: The full extracted listing at code/github_copilot/part-8-reviewer-agent/listings/01-reviewer-agent.md is the same agent file with the marker comments removed.
The instructions carry the read-only limit because the page has no read-only git tool to name. A sentence alone does not remove a tool. The tools list is what the page applies.

description, read, and search go in, with the ban on edits and the line that you paste the diff. model, infer, edit, execute, agent, and the shell aliases stay out. git show, git diff, npm test, and git commit stay yours.
Confirm the bytes before you start a session.
cd ~/code/ticket-triage
test -f .github/agents/reviewer.agent.md && echo present
git diff -- src/classify.js
git status --short
present prints. The classifier diff prints nothing. git status --short shows the new agent file and does not show src/classify.js. If status shows any other path you do not recognize, stop. The frontmatter has description and tools, and it has neither model nor infer. tools lists read and search only.
The same how-to says a user-level agent wins when the ids match. A personal ~/.copilot/agents/reviewer.agent.md wins over the repository file.
test ! -f ~/.copilot/agents/reviewer.agent.md && echo none
none prints. If the command prints nothing, stop. Do not delete the personal file. --agent reviewer would select that file instead of the one you saved.
Ask for the review
Start a new session as this agent. The invoke custom agents page shows copilot --agent with the agent's id. Select the reviewer if the CLI lists it, or pass --agent reviewer. Do not invent a different flag. --max-ai-credits caps the credits this session may use. A credit is the usage unit. The cap is this session, not the account. Replace 20 with a small number you choose. The 20 in the block is a placeholder, not a recommendation. You pass no model name.
cd ~/code/ticket-triage
copilot --agent reviewer --max-ai-credits 20
You do not pass --continue, --yolo, --allow-all, or --allow-all-tools. You do not enable auto-merge, which would merge a pull request without a separate yes from you. You do not open a pull request today. If a picker appears, do not type a model name. If the only way forward is a model name, stop. If history still shows the placeholder 20, the check fails until it shows the number you chose.
When the session is ready, paste your git show output under this question. Do not ask the agent to run git.
Review this diff for the commit "Pin the crushed-mug ticket as other".
Report whether the test "crushed mug in pieces is other" is present.
Report whether src/classify.js changed in this diff.
Do not edit files. Do not change src/classify.js. Do not commit.

The sequence is one pasted diff. The reviewer does not call git. You read the reply for the test name, then you run the checks, and you commit the agent file.
Look for the test name crushed mug in pieces is other in the reply you see. If the reply misses that name, stop. Do not edit a file to dress up a later reply. If the session asks to edit, write, or commit, refuse. If you cannot tell which answer refuses, stop the turn. This article does not invent a review transcript. Re-run this on your account before you trust the wording.

A wrong CLI line, a dirty tree, a missing test name, or a patch on src/classify.js ends the pass. The forward ending is an empty classifier diff and your commit of the agent file.
Prove the tree, then commit the file yourself
Read the reply, then run the checks from a second terminal.
cd ~/code/ticket-triage
git diff -- src/classify.js
git status --short
npm test
git diff -- src/classify.js prints nothing. git status --short may list .github/agents/reviewer.agent.md and must not list src/classify.js or test/classify.test.js. npm test still shows the four names, # tests 4, # pass 4, and # fail 0. If the classifier diff prints a patch, run git restore src/classify.js, run the diff again, and do not commit that file.
You commit the agent file. The agent does not run git.
git add .github/agents/reviewer.agent.md
git commit -m "Add a read-only Copilot reviewer agent"
git status --short
git diff -- src/classify.js
npm test
git add names the agent file only. After the commit, git status --short prints nothing, the classifier diff still prints nothing, and npm test still shows four passes and zero failures.
The win is a review that mentions the new test, an empty diff on src/classify.js, no edit to classify.js from this turn, four passing tests, and the agent file committed by you.

The picture is that proof. The diff on src/classify.js printed nothing, the four tests still pass, and the commit is the agent file alone, with the message Add a read-only Copilot reviewer agent.
You can stop after that commit. The rest explains why the file works and where the role breaks. It does not start a second session, and it does not add a second agent file.
Leave the other fields unset
The reference splits required and optional frontmatter. You already set the required description. You also set tools, because the page says an unset tools property defaults to all tools. The other optional fields stay out of today's file. You leave model unset. The page says an unset model "inherits the default model." You do not type a model name to replace that default.

Field, On the page, and In today's file are the three columns. Field is the optional frontmatter name. On the page is what the reference says, including the default when you leave it unset. In today's file is whether .github/agents/reviewer.agent.md sets it.
nameis an optional display name. Deduplication uses the file name with.mdor.agent.mdremoved, so you passreviewerwithout a display name. A display name would not change the--agent reviewerflag.toolsis optional only in the schema. Unset means all tools, which would enable edit and a shell. Today's file setsreadandsearchonly.modelis optional, and unset inherits the default model. The file leaves it unset so the role does not pin a model in the repository. You still must not start the session by typing a model name.targetis optional, withvscodeorgithub-copilot, and unset defaults to both. You do not create a second file to split those targets.disable-model-invocationis an optional boolean, and unset defaults tofalse. The defaultfalsemeans Copilot in the cloud may select this agent from task context. You are not assigning a cloud task today, and you do not set the field to experiment.user-invocableis an optional boolean, and unset defaults totrue, so a person can select the agent. The page says that when the value isfalse, the agent cannot be manually selected. You selected this agent, so you do not setfalse.
You do not fill the unset rows to look complete. The page also lists mcp-servers and metadata, and it says both are not used in VS Code and other IDE custom agents. Do not copy them in, and do not add a server command, a secret, or an annotation. The prompt under the frontmatter can be at most 30,000 characters. Your instructions are far under that. Do not paste the repository into the file.
The infer field is retired
The reference marks infer as retired. Use disable-model-invocation and user-invocable instead. Setting disable-model-invocation: true is equivalent to infer: false. If both were set, disable-model-invocation would take precedence. Your file contains neither infer nor disable-model-invocation.
A sentence about the model choosing an agent is a different claim. It is not a reason to put infer in the file. A cheat sheet that still shows infer: false is an old knob. Do not add it beside the new fields. Do not add it alone. Open .github/agents/reviewer.agent.md and confirm that the string infer is absent. The same read confirms that model is absent.

Do not add infer alone or next to the newer fields. disable-model-invocation and user-invocable stay unset. Leave model unset, and do not type a name when the session starts. The check is the file: infer is absent, and model is absent.
Gotcha: omitting tools because the instructions already say "do not edit." The page's default is all tools, and all tools include edit and a shell. The sentences in the body do not remove those tools. The miss looks like a polite review that also rewrites src/classify.js. git diff -- src/classify.js is the check. The frontmatter is the limit.

Leave tools unset and edit or a shell can run. Set read and search only, refuse an edit or a commit if the session asks, and commit the agent file yourself once you have seen the test name and the classifier diff is still empty.
A subagent is not a second approval
A subagent is a specialist that a parent invokes. The reference describes the agent tool with the words "Allows a different custom agent to be invoked to accomplish a task." Compatible aliases on that row are custom-agent and Task. You did not put agent in tools. This reviewer should not call another agent.
A subagent has a separate context. Separate context means its own text for that piece of work. It is not a separate user approval. It is not an independent security boundary. A tool you did not mean to allow is still a tool you allowed. Restricting tools on the file is the limit you actually set. A second context does not add a second lock.
/fleet splits independent work among parallel subagents. Parallel work can spend more credits, because more than one agent is running. You do not run /fleet today. You do not add a fleet flag to the reviewer command. Keep one reviewer, one diff, and one commit of the agent file.
The page's out-of-the-box github tools are for Copilot in the cloud. The page says those read-only tools come with a token scoped to the source repository. They are not a local git show. This file does not list github/*. You still paste the diff yourself.

A subagent's own text is not your approval and not a security boundary. The agent tool stays off, including custom-agent and Task. /fleet stays unused. Cloud github tools are not a local git show.
If you have used Claude Code: a subagent, in the casual sense, is another session that reports back. The comparison stops there. The reviewer file is the role you selected. The git diff is still the proof that it did not edit.
Where else an agent file can live
The CLI also reads personal agents in ~/.copilot/agents/. A file there is yours on this machine. It is not in the Ticket Triage commit. Today's file is the repository copy, .github/agents/reviewer.agent.md, so you can commit it and the role stays with the project. The local test ! -f check above is how you notice a personal file of the same id. Leave that personal file in place if it exists, and do not start --agent reviewer until the check prints none.
The reference describes levels above the repository too. A repository-level agent takes precedence over an organization-level agent, and an organization-level agent overrides an enterprise-level agent. Organization agents exist. An organization agent is still an agent profile at that level. It is not an organization skills folder. This article does not name a path for an organization-wide skills directory. You do not create one. You do not copy reviewer.agent.md into a guessed organization path.
The same note says the lowest-level configuration takes precedence when names collide. Your repository file named reviewer wins over a higher-level agent of the same name. You do not rename the file today. The ladder is organization and enterprise. It does not cancel the CLI rule that a personal file with the same id wins over the repository file.
Custom agents are in public preview for JetBrains IDEs, Eclipse, and Xcode. The page says that preview is subject to change. Your checks today are the CLI file, the reply, and git. You do not treat a JetBrains menu as the proof.
Do this today
Everyone
.github/agents/reviewer.agent.mdis committed, andgit log -1 --onelineshowsAdd a read-only Copilot reviewer agent. The check is that subject. The habit to keep: you rungit addandgit commit. The agent does not. On Windows, use the same commands in the Ticket Triage folder you have been using.- The frontmatter has
descriptionandtools: ["read", "search"]. It has nomodel, noinfer, noedit, and noexecute. The check iscat .github/agents/reviewer.agent.md. - The review you saw mentions
crushed mug in pieces is other. The check is that test name in the reply on your screen. There is no sample review in this article. Re-run this on your account before you trust the wording. This turn was not run on November 16, 2026. git diff -- src/classify.jsprints nothing.git status --shortprints nothing after the commit. During the turn, status did not show an edit tosrc/classify.js.npm teststill shows the four names:refund,shipping,other, andcrushed mug in pieces is other, plus# tests 4,# pass 4, and# fail 0. You did not pass--yolo, and you did not turn on auto-merge.test ! -f ~/.copilot/agents/reviewer.agent.mdprintsnone. If it prints nothing, stop. Do not delete the personal file.
If you read the limits
- Write down that
inferis retired and that the file sets no model. The check is those two facts in your note, matched to the file: the stringinferis absent, andmodelis absent. A note fails the check if it only says that you picked a model. - Write one line that a subagent's separate context is not a separate approval and not an independent security boundary, and that you did not run
/fleet. The check is that sentence. You did not add an organization skills path.
The tools list is the lock
A GitHub Copilot custom agent does what its file allows. An unset tools list allows edit and a shell, including a rewrite of src/classify.js. The sentences under the frontmatter say what you want. They do not delete a tool.
What lasts is the file that names read and search, the diff you pasted, the test name on your screen, an empty git diff -- src/classify.js, four passing tests, and the commit you made of .github/agents/reviewer.agent.md. The reply can sound careful. The diff is the proof, and the tools list is the lock.
This is Part 8 of "GitHub Copilot, Day-to-Day," a 16-part guide to using GitHub Copilot as a daily coding agent.