{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","description":"> [!NOTE]\n> This endpoint is in public preview and is subject to change.\n\nStarts a new Copilot cloud agent task for a repository.\n\nThis endpoint is only available to users with a Copilot Business or Copilot Enterprise subscription.\n\n**Fine-grained access tokens for \"Start a task\"**\n\nThis endpoint works with the following fine-grained token types:\n\n* [GitHub App user access tokens](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app)\n* [Fine-grained personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token)\n\nThe fine-grained token must have the following permission set:\n\n* \"Agent tasks\" repository permissions (read and write)\n\nGitHub App installation access tokens are not supported for this endpoint.\n","properties":{"path":{"type":"object","properties":{"owner":{"type":"string","description":"The account owner of the repository. The name is not case sensitive."},"repo":{"type":"string","description":"The name of the repository. The name is not case sensitive."}},"required":["owner","repo"],"additionalProperties":false},"body":{"type":"object","required":["prompt"],"properties":{"prompt":{"type":"string","description":"The user's prompt for the agent"},"model":{"type":"string","description":"The model to use for this task. The allowed models may change over time and depend on the user's GitHub Copilot plan and organization policies. Currently supported values: `claude-sonnet-4.6`, `claude-opus-4.6`, `gpt-5.2-codex`, `gpt-5.3-codex`, `gpt-5.4`, `claude-sonnet-4.5`, `claude-opus-4.5`"},"custom_agent":{"type":"string","description":"Optional identifier for a custom agent to use for this task. Use the custom agent's filename without the extension - for example, for a `.github/agents/performance-optimizer.agent.md` custom agent, use `performance-optimizer`."},"create_pull_request":{"type":"boolean","description":"Whether to create a PR.","default":false},"base_ref":{"type":"string","description":"Base ref for new branch/PR"},"head_ref":{"type":"string","description":"Head ref for existing branch/PR. If provided with `base_ref`, the agent looks up open PR context for `head_ref` targeting `base_ref` and commits to `head_ref` instead of creating a new branch."}},"examples":[{"prompt":"Fix the login button on the homepage","base_ref":"main"}]}},"required":["path","body"],"additionalProperties":false},"name":"Start a task","id":"github.agent-tasks.create-task-in-repo","example":{"path":{"owner":"octocat","repo":"hello-world"},"body":{"prompt":"Fix the login button on the homepage","base_ref":"main"}},"maxRequests":1,"summary":false}}