Select and configure agent tools
Unlock the complete study guide.
Bundled into the existing Developing in Agentic AI Systems premium course — no separate purchase.
14-day money-back guarantee — no questions asked.
Included in this chapter:
- Where tools come from, and the layers that govern them
- Building a least-privilege custom agent profile for its target environment
- Controlling how a custom agent is chosen, separately from what it can do
- Copilot CLI session controls: visibility and permission flags, directory trust, enterprise policy and grant lifetimes
- Tool selection surfaces and limits in VS Code
- Choosing MCP tools by their discovered contract
- Credentials for tools: secrets, tokens and the programs that read them
- Calling the GitHub API directly with gh api
- Applied reasoning: matching a tool requirement to its layer
Which layer or decision, and which control, answer which question
| Layer or decision | Question | Control | Where it applies | What it does not decide |
|---|---|---|---|---|
| Provider | Does the capability exist in this environment at all? | A built-in tool, an extension-contributed tool, or a configured MCP server | VS Code (built-in and extension tools); MCP servers for any agent | Whether the model is offered the tool, or, where that product has a separate execution control, may run it |
| Visibility | Which tools is this custom agent offered? | `tools` in the agent profile | Custom agent profiles | Whether the agent is selected automatically |
| Visibility | Which tools can the CLI model see? | `--available-tools` / `--excluded-tools` | Copilot CLI | Whether a visible tool may execute without approval |
| Visibility | Too many enabled tools for one request? | Deselect tools or servers, or set `github.copilot.chat.virtualTools.threshold` | VS Code | Which providers are installed or configured |
| Permission | May a visible tool run, or must it be refused? | `--allow-tool` / `--deny-tool` (deny wins) | Copilot CLI | Whether the model is offered the tool |
| Permission | May the agent reach this URL or domain? | `--allow-url` / `--deny-url` (deny wins) | Copilot CLI | Approval for shell or MCP tools |
| Permission | May Copilot cloud agent run an MCP tool at all? | The `tools` array in each MCP server's configuration, chosen before the run | Copilot cloud agent, which asks for no approval as it works | Which of the exposed tools a given custom agent is offered |
| Invocation | Should the agent run only when someone selects it? | `disable-model-invocation: true` | Copilot cloud agent selection | Which tools the agent has |
| Invocation | Should people be unable to pick the agent by hand? | `user-invocable: false` | Custom agent profiles | Programmatic access to the agent |
| Credential | Which secret can MCP configuration substitute? | Agents secret or variable named `COPILOT_MCP_*` | Cloud agent MCP configuration | Access to ordinary Actions secrets |
Decision tree
Cheat sheet
Unlock with Premium — includes all practice exams and the complete study guide.