Answer: You can use a custom agent in GitHub Copilot CLI in four ways: via the slash command by entering /agent in interactive mode and choosing from the list, by explicitly instructing Copilot to use a specific agent, by inference from a prompt that triggers the agent based on its description, or programmatically with the command-line option such as copilot --agent security-auditor --prompt "Check /src/app/validator.go". Status: Confirmed Entry: tool/github-copilot/agents-and-automation/use-custom-agent-cli Revision: 3 Digest: sha256:dfd086970c02916a (changes whenever the content changes) Timeline: Created: 2026-11-13T03:24:05Z Last changed: 2026-11-20T13:02:21Z (Agent ID derivation: — → The ID is derived from the file name, without the .md or .agent.md extension.) Last verified: 2026-11-20T13:02:21Z Next check: 2026-11-21T13:02:21Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of Slash command | /agent | [1] | 2026-11-20 Programmatic option example | copilot --agent security-auditor --prompt "Check /src/app/validator.go" | [1] | 2026-11-20 Agent ID derivation | The ID is derived from the file name, without the .md or .agent.md extension. | [1] | 2026-11-20 Sources: [1] GitHub. "Creating and using custom agents for GitHub Copilot CLI - GitHub Docs". https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/create-custom-agents-for-cli Role: primary. Accessed: 2026-11-20T13:02:21Z Quote: "Enter /agent in interactive mode and choose from the list of available custom agents." (Supports: Slash command) Quote: "copilot --agent security-auditor --prompt "Check /src/app/validator.go"" (Supports: Programmatic option example) Quote: "The ID is derived from the file name, without the .md or .agent.md extension." (Supports: Agent ID derivation) Snapshot SHA-256: 64a3c0d142ad21c0f69aeb3d4dabc247cb63928c3610eb4c7280fd6d95e45519 (captured 2026-11-19T12:56:07Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-19T12:56:08Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:02:21Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:02:21Z Last attempt: 2026-11-20T13:02:21Z Notes and limitations: Extracted automatically from a single official source (section "Using a custom agent"). Related: https://latestn.com/tool/github-copilot/agents-and-automation/use-custom-agents How do I use custom agents with GitHub Copilot cloud agent? https://latestn.com/tool/github-copilot/agents-and-automation/use-custom-agents-cli How do I use custom agents in GitHub Copilot CLI? https://latestn.com/tool/github-copilot/agents-and-automation/use-custom-agents-in-ide How do I create and use custom agents in GitHub Copilot in my IDE? https://latestn.com/tool/github-copilot/agents-and-automation/use-cloud-agent-in-ide How do I use the GitHub Copilot cloud agent from my IDE? https://latestn.com/tool/github-copilot/agents-and-automation/use-code-review-prompt-file How do I use the GitHub Copilot code review prompt file? https://latestn.com/tool/github-copilot/agents-and-automation/use-copilot-chat-agent-mode How do I use GitHub Copilot Chat in agent mode for a task? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-20T13:02:21Z | changed | Agent ID derivation: — → The ID is derived from the file name, without the .md or .agent.md extension. | [1] 2026-11-20T13:02:21Z | changed | Programmatic option example: — → copilot --agent security-auditor --prompt "Check /src/app/validator.go" | [1] 2026-11-20T13:02:21Z | changed | Slash command: — → /agent | [1] 2026-11-20T13:02:21Z | changed | subdirectory ID example: security--security-auditor → — | [1] 2026-11-20T13:02:21Z | changed | agent ID derivation: without the .md or .agent.md extension → — | [1] 2026-11-20T13:02:21Z | changed | programmatic example: copilot --agent security-auditor --prompt "Check /src/app/validator.go" → — | [1] 2026-11-20T13:02:21Z | changed | slash command: /agent → — | [1] 2026-11-16T12:45:59Z | changed | subdirectory ID example: — → security--security-auditor | [1] 2026-11-16T12:45:59Z | changed | agent ID derivation: The ID is derived from the file name, without the .md or .agent.md extension. → without the .md or .agent.md extension | [1] 2026-11-16T12:45:59Z | changed | explicit instruction example: Use the security-auditor agent on all files in the /src/app directory → — | [1] 2026-11-13T03:24:05Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/github-copilot/agents-and-automation/use-custom-agent-cli/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/github-copilot/agents-and-automation/use-custom-agent-cli POST: https://latestn.com/dispute/tool/github-copilot/agents-and-automation/use-custom-agent-cli with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/github-copilot/agents-and-automation/use-custom-agent-cli?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I use a custom agent in GitHub Copilot CLI? Revision 3, last verified 2026-11-20T13:02:21Z. https://latestn.com/tool/github-copilot/agents-and-automation/use-custom-agent-cli (accessed 2026-11-21T09:59:13Z). @misc{LatestN_tool_github_copilot_agents_and_automation_use_custom_agent_cli_r3, title = {How do I use a custom agent in GitHub Copilot CLI?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/github-copilot/agents-and-automation/use-custom-agent-cli}}, note = {Revision 3; digest sha256:dfd086970c02916a; last verified 2026-11-20T13:02:21Z; accessed 2026-11-21T09:59:13Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/github-copilot/agents-and-automation/use-custom-agent-cli