{"meta":{"title":"Creating custom agents for Copilot cloud agent","intro":"You can create specialized agents with tailored expertise for specific development tasks.","product":"GitHub Copilot","breadcrumbs":[{"href":"/en/copilot","title":"GitHub Copilot"},{"href":"/en/copilot/how-tos","title":"How-tos"},{"href":"/en/copilot/how-tos/copilot-on-github","title":"Copilot on GitHub"},{"href":"/en/copilot/how-tos/copilot-on-github/customize-copilot","title":"Customize Copilot"},{"href":"/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-cloud-agent","title":"Customize cloud agent"},{"href":"/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-cloud-agent/create-custom-agents","title":"Create custom agents"}],"documentType":"article"},"body":"# Creating custom agents for Copilot cloud agent\n\nYou can create specialized agents with tailored expertise for specific development tasks.\n\nCustom agents allow you to tailor Copilot's expertise for specific tasks. For a conceptual overview of custom agents, see [About custom agents](/en/copilot/concepts/agents/cloud-agent/about-custom-agents).\n\n> \\[!NOTE]\n> Custom agents are in public preview for JetBrains IDEs, Eclipse, and Xcode, and subject to change.\n\n## Creating a custom agent profile in a repository on GitHub\n\n1. Go to the agents tab at [https://github.com/copilot/agents](https://github.com/copilot/agents?ref_product=copilot\\&ref_type=engagement\\&ref_style=text).\n\n2. Using the dropdown menu in the prompt box, select the repository you want to create the custom agent profile in.\n\n   > \\[!NOTE]\n   > Organization and enterprise owners can create organization and enterprise-level custom agents in a `.github-private` repository that are available across all repositories within their organization or enterprise. For more information, see [Preparing to use custom agents in your enterprise](/en/copilot/how-tos/administer-copilot/manage-for-enterprise/manage-agents/prepare-for-custom-agents) and [Preparing to use custom agents in your organization](/en/copilot/how-tos/administer-copilot/manage-for-organization/prepare-for-custom-agents).\n\n3. Optionally, select the branch you want to create the agent profile in. The default is the main branch.\n\n4. Click <svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-copilot\" aria-label=\"Select a custom agent\" role=\"img\"><path d=\"M7.998 15.035c-4.562 0-7.873-2.914-7.998-3.749V9.338c.085-.628.677-1.686 1.588-2.065.013-.07.024-.143.036-.218.029-.183.06-.384.126-.612-.201-.508-.254-1.084-.254-1.656 0-.87.128-1.769.693-2.484.579-.733 1.494-1.124 2.724-1.261 1.206-.134 2.262.034 2.944.765.05.053.096.108.139.165.044-.057.094-.112.143-.165.682-.731 1.738-.899 2.944-.765 1.23.137 2.145.528 2.724 1.261.566.715.693 1.614.693 2.484 0 .572-.053 1.148-.254 1.656.066.228.098.429.126.612.012.076.024.148.037.218.924.385 1.522 1.471 1.591 2.095v1.872c0 .766-3.351 3.795-8.002 3.795Zm0-1.485c2.28 0 4.584-1.11 5.002-1.433V7.862l-.023-.116c-.49.21-1.075.291-1.727.291-1.146 0-2.059-.327-2.71-.991A3.222 3.222 0 0 1 8 6.303a3.24 3.24 0 0 1-.544.743c-.65.664-1.563.991-2.71.991-.652 0-1.236-.081-1.727-.291l-.023.116v4.255c.419.323 2.722 1.433 5.002 1.433ZM6.762 2.83c-.193-.206-.637-.413-1.682-.297-1.019.113-1.479.404-1.713.7-.247.312-.369.789-.369 1.554 0 .793.129 1.171.308 1.371.162.181.519.379 1.442.379.853 0 1.339-.235 1.638-.54.315-.322.527-.827.617-1.553.117-.935-.037-1.395-.241-1.614Zm4.155-.297c-1.044-.116-1.488.091-1.681.297-.204.219-.359.679-.242 1.614.091.726.303 1.231.618 1.553.299.305.784.54 1.638.54.922 0 1.28-.198 1.442-.379.179-.2.308-.578.308-1.371 0-.765-.123-1.242-.37-1.554-.233-.296-.693-.587-1.713-.7Z\"></path><path d=\"M6.25 9.037a.75.75 0 0 1 .75.75v1.501a.75.75 0 0 1-1.5 0V9.787a.75.75 0 0 1 .75-.75Zm4.25.75v1.501a.75.75 0 0 1-1.5 0V9.787a.75.75 0 0 1 1.5 0Z\"></path></svg>, then click **<svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-plus\" aria-label=\"Plus button\" role=\"img\"><path d=\"M7.75 2a.75.75 0 0 1 .75.75V7h4.25a.75.75 0 0 1 0 1.5H8.5v4.25a.75.75 0 0 1-1.5 0V8.5H2.75a.75.75 0 0 1 0-1.5H7V2.75A.75.75 0 0 1 7.75 2Z\"></path></svg> Create an agent**. This will open a template agent profile called `my-agent.agent.md` in the `.github/agents` directory of your target repository.\n\n5. If you are creating an organization or enterprise-level custom agent, delete the `.github/` portion of the file path to move your template to the root `agents` directory.\n\n6. Edit the filename (the text before `.agent.md`), selecting a unique, descriptive name that identifies the agent's purpose. Note that the filename may only contain the following characters: `.`, `-`, `_`, `a-z`, `A-Z`, `0-9`.\n\n7. Configure the agent profile, including the name, description, tools, and prompts. For more information on what the agent profile can include, see [Configuring an agent profile](#configuring-an-agent-profile).\n\n8. Commit the file to the repository and merge it into the default branch. Go back to the agents tab and refresh the page if needed. Your custom agent will now appear in the dropdown when you click <svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-copilot\" aria-label=\"copilot\" role=\"img\"><path d=\"M7.998 15.035c-4.562 0-7.873-2.914-7.998-3.749V9.338c.085-.628.677-1.686 1.588-2.065.013-.07.024-.143.036-.218.029-.183.06-.384.126-.612-.201-.508-.254-1.084-.254-1.656 0-.87.128-1.769.693-2.484.579-.733 1.494-1.124 2.724-1.261 1.206-.134 2.262.034 2.944.765.05.053.096.108.139.165.044-.057.094-.112.143-.165.682-.731 1.738-.899 2.944-.765 1.23.137 2.145.528 2.724 1.261.566.715.693 1.614.693 2.484 0 .572-.053 1.148-.254 1.656.066.228.098.429.126.612.012.076.024.148.037.218.924.385 1.522 1.471 1.591 2.095v1.872c0 .766-3.351 3.795-8.002 3.795Zm0-1.485c2.28 0 4.584-1.11 5.002-1.433V7.862l-.023-.116c-.49.21-1.075.291-1.727.291-1.146 0-2.059-.327-2.71-.991A3.222 3.222 0 0 1 8 6.303a3.24 3.24 0 0 1-.544.743c-.65.664-1.563.991-2.71.991-.652 0-1.236-.081-1.727-.291l-.023.116v4.255c.419.323 2.722 1.433 5.002 1.433ZM6.762 2.83c-.193-.206-.637-.413-1.682-.297-1.019.113-1.479.404-1.713.7-.247.312-.369.789-.369 1.554 0 .793.129 1.171.308 1.371.162.181.519.379 1.442.379.853 0 1.339-.235 1.638-.54.315-.322.527-.827.617-1.553.117-.935-.037-1.395-.241-1.614Zm4.155-.297c-1.044-.116-1.488.091-1.681.297-.204.219-.359.679-.242 1.614.091.726.303 1.231.618 1.553.299.305.784.54 1.638.54.922 0 1.28-.198 1.442-.379.179-.2.308-.578.308-1.371 0-.765-.123-1.242-.37-1.554-.233-.296-.693-.587-1.713-.7Z\"></path><path d=\"M6.25 9.037a.75.75 0 0 1 .75.75v1.501a.75.75 0 0 1-1.5 0V9.787a.75.75 0 0 1 .75-.75Zm4.25.75v1.501a.75.75 0 0 1-1.5 0V9.787a.75.75 0 0 1 1.5 0Z\"></path></svg> in the prompt box.\n\n## Configuring an agent profile\n\nAn agent profile is a Markdown file with YAML frontmatter that specifies the custom agent's name, description, available tools, and MCP server configurations. Configuring an agent profile involves defining the agent's identity, capabilities, tool access, and behavioral instructions.\n\nFor detailed configuration information about YAML properties, tools, MCP server setup, tool aliases, and how custom agents are processed, see [Custom agents configuration](/en/copilot/reference/custom-agents-configuration).\n\nTo configure your agent profile:\n\n1. Optionally, write a `name` for your custom agent. If unset, the name will default to the filename (without the `.md` or `.agent.md` suffix).\n2. Write a brief `description` (required) explaining what your agent does and its specific capabilities or domain expertise.\n3. In the `tools` property, define which tools the agent can use. This is a list of tool names or aliases, including tools from MCP servers configured in the repository settings or the agent profile (for example, `tools: [\"read\", \"edit\", \"search\", \"some-mcp-server/tool-1\"]`). If you omit this property, the agent will have access to all available tools. See \"Tools\" in [Custom agents configuration](/en/copilot/reference/custom-agents-configuration#tools).\n4. Optionally, in the `mcp-servers` property, you can configure MCP servers that will be available only to this agent to extend its capabilities. See \"MCP server configuration details\" in [Custom agents configuration](/en/copilot/reference/custom-agents-configuration#mcp-server-configuration-details).\n5. If you are creating and using the agent profile in VS Code, JetBrains IDEs, Eclipse, or Xcode, you can also use the `model` property to control which AI model the agent should use.\n6. Optionally, set the `target` property to either `vscode` or `github-copilot` if you want to only use the agent in a specific environment. The agent will be available in both environments if you omit the property.\n7. Write the agent's prompt. Define the agent's behavior, expertise, and instructions in the Markdown content below the YAML frontmatter. The prompt can be a maximum of 30,000 characters.\n\n## Example agent profiles\n\nThe following examples demonstrate what an agent profile could look like for the common tasks of writing tests or planning the implementation of a project. For additional inspiration, see the [Custom agents](/en/copilot/tutorials/customization-library/custom-agents) examples in the customization library. You can also find more specific examples in the [awesome-copilot](https://github.com/github/awesome-copilot/tree/main/agents) community collection.\n\n### Testing specialist\n\nThis example enables all tools by omitting the `tools` property.\n\n```text copy\n---\nname: test-specialist\ndescription: Focuses on test coverage, quality, and testing best practices without modifying production code\n---\n\nYou are a testing specialist focused on improving code quality through comprehensive testing. Your responsibilities:\n\n- Analyze existing tests and identify coverage gaps\n- Write unit tests, integration tests, and end-to-end tests following best practices\n- Review test quality and suggest improvements for maintainability\n- Ensure tests are isolated, deterministic, and well-documented\n- Focus only on test files and avoid modifying production code unless specifically requested\n\nAlways include clear test descriptions and use appropriate testing patterns for the language and framework.\n```\n\n### Implementation planner\n\nThis example only enables a subset of tools.\n\n```text copy\n---\nname: implementation-planner\ndescription: Creates detailed implementation plans and technical specifications in markdown format\ntools: [\"read\", \"search\", \"edit\"]\n---\n\nYou are a technical planning specialist focused on creating comprehensive implementation plans. Your responsibilities:\n\n- Analyze requirements and break them down into actionable tasks\n- Create detailed technical specifications and architecture documentation\n- Generate implementation plans with clear steps, dependencies, and timelines\n- Document API designs, data models, and system interactions\n- Create markdown files with structured plans that development teams can follow\n\nAlways structure your plans with clear headings, task breakdowns, and acceptance criteria. Include considerations for testing, deployment, and potential risks. Focus on creating thorough documentation rather than implementing code.\n```\n\n## Using custom agents\n\nOnce you've created a custom agent, you can use it wherever Copilot cloud agent is available.\n\n* When prompting Copilot cloud agent with a task on GitHub.com, use the dropdown menu in the agents panel or agents tab to select your custom agent instead of the default cloud agent.\n* When assigning Copilot cloud agent to an issue, you can select your custom agent from the dropdown menu to handle the issue with your specialized configuration.\n* When using the GitHub Copilot CLI, you can choose to use a particular custom agent by using the `/agent` slash command or referencing the agent in a prompt or via a command-line argument. For more information, see [Using GitHub Copilot CLI](/en/copilot/how-tos/use-copilot-agents/use-copilot-cli#use-custom-agents).\n\nWhen Copilot opens pull requests, it will note which custom agent was used to complete the work in the pull request description.\n\nFor more information on using Copilot cloud agent, see [Asking GitHub Copilot to create a pull request](/en/copilot/how-tos/use-copilot-agents/cloud-agent/create-a-pr).\n\n## Next steps\n\n* For a hands-on tutorial to create your first custom agent, see [Your first custom agent](/en/copilot/tutorials/customization-library/custom-agents/your-first-custom-agent).\n* For detailed configuration information, see [Custom agents configuration](/en/copilot/reference/custom-agents-configuration).\n* For information on using cloud agents, including your custom agents, to create pull requests, see [Asking GitHub Copilot to create a pull request](/en/copilot/how-tos/use-copilot-agents/cloud-agent/create-a-pr)."}