Demonstrates configuring the Copilot SDK with custom agent definitions that restrict which tools an agent can use. This validates:
- Agent definition — The
customAgentssession config accepts agent definitions with name, description, tool lists, and custom prompts. - Tool scoping — Each custom agent can be restricted to a subset of available tools (e.g. read-only tools like
grep,glob,view). - Agent awareness — The model recognizes and can describe the configured custom agents.
- Creates a session with a
customAgentsarray containing a "researcher" agent - The researcher agent is scoped to read-only tools:
grep,glob,view - Sends: "What custom agents are available? Describe the researcher agent and its capabilities."
- Prints the response — which should describe the researcher agent and its tool restrictions
| Option | Value | Effect |
|---|---|---|
customAgents[0].name |
"researcher" |
Internal identifier for the agent |
customAgents[0].displayName |
"Research Agent" |
Human-readable name |
customAgents[0].description |
Custom text | Describes agent purpose |
customAgents[0].tools |
["grep", "glob", "view"] |
Restricts agent to read-only tools |
customAgents[0].prompt |
Custom text | Sets agent behavior instructions |
./verify.shRequires the copilot binary (auto-detected or set COPILOT_CLI_PATH) and GITHUB_TOKEN.