{"meta":{"title":"Integrating Copilot cloud agent with Teams","intro":"You can use the GitHub integration in Teams to provide context and open pull requests all from within your Teams channels.","product":"GitHub Copilot","breadcrumbs":[{"href":"/en/enterprise-cloud@latest/copilot","title":"GitHub Copilot"},{"href":"/en/enterprise-cloud@latest/copilot/how-tos","title":"How-tos"},{"href":"/en/enterprise-cloud@latest/copilot/how-tos/copilot-integrations","title":"Copilot integrations"},{"href":"/en/enterprise-cloud@latest/copilot/how-tos/copilot-integrations/integrate-cloud-agent-with-teams","title":"Integrate cloud agent with Teams"}],"documentType":"article"},"body":"# Integrating Copilot cloud agent with Teams\n\nYou can use the GitHub integration in Teams to provide context and open pull requests all from within your Teams channels.\n\n> \\[!NOTE]\n>\n> * This feature is currently in public preview and subject to change.\n> * GitHub Copilot uses AI. Check for mistakes. See [Application card: GitHub Copilot Agents](/en/enterprise-cloud@latest/copilot/responsible-use/agents).\n\nThe GitHub integration in Microsoft Teams allows you to interact with Copilot cloud agent all from within your Teams conversations. Within Teams you can initiate cloud agent sessions to investigate, plan, write code, and create issues and pull requests, using the context of your conversation. Your team's collaborative decisions stay connected to your code, bridging the gap between where discussions happen and where implementation lives.\n\nFor information about additional Copilot integrations, see [About Copilot integrations](/en/enterprise-cloud@latest/copilot/concepts/tools/about-copilot-integrations).\n\n## Security considerations\n\nBefore you @mention GitHub in Teams, consider that Copilot cloud agent will capture the entire thread as context for your request, understanding and implementing solutions based on the discussion. This context is stored in the artifacts the agent generates. If you want to limit the context, you can send a direct message to the GitHub app for Teams instead.\n\n## Understanding collaborative sessions, permissions, and sandboxes\n\nThe identity Copilot uses depends on whether you interact with it in a direct message or a shared context.\n\n* When you use Copilot in a direct message, it can take actions for you, such as creating pull requests or issues, as well as answer questions. It uses the permissions of your linked GitHub personal account to take these actions.\n\n* When you use Copilot in a shared context, such as a group thread or channel, Copilot creates artifacts, such as pull requests, under its app identity rather than your personal account.\n\n  > \\[!NOTE]\n  > Pull requests created in a shared context by Copilot use the app's identity. If you use repository rulesets, because these pull requests aren't attributed to a person, one more approval is required before merging, as long as the repository already requires at least one approval. This is enabled by default. See [Available rules for rulesets](/en/enterprise-cloud@latest/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/available-rules-for-rulesets#additional-approval-for-unattributed-copilot-pull-requests).\n\nOnly users with **write** access to a repository can trigger Copilot to make changes, but any conversation participant can provide input. Guest members of a workspace, and outside collaborators to repositories are not able to start or steer a session with Copilot in Teams.\n\nCopilot uses all messages in the conversation to inform the work. The entire thread becomes the decision-making context for the artifact.\n\nWhen you ask Copilot to perform a task, it will display details about the session, such as the working repository, issue or pull request link, model used, and a task status or summary.\n\n### Secure cloud sandboxes\n\nWhen Copilot cloud agent starts work on a task from Teams, Copilot continues working asynchronously in a **secure cloud sandbox**, and posts the result when it's ready.\n\nYou can keep steering from Teams, or continue the work on the agent-generated artifacts in GitHub, the terminal, or your preferred code editor.\n\n## Prerequisites\n\n* You must have a GitHub account with access to Copilot through a paid Copilot plan.\n* You must have a Teams account.\n* To use Copilot cloud agent, you must have cloud sandboxes enabled for your Copilot plan. See [Cloud sandboxing for GitHub Copilot](/en/enterprise-cloud@latest/copilot/concepts/about-cloud-and-local-sandboxes#cloud-sandboxing).\n\n  > \\[!NOTE]\n  > Cloud sandbox policies share the same configuration as Copilot cloud agent policies. Members of an organization or enterprise, including an enterprise with managed users may need their owner to enable cloud sandboxes and Copilot cloud agent before they can use Copilot in Teams. See [Enabling or disabling cloud sandboxes for your organization or enterprise](/en/enterprise-cloud@latest/copilot/how-tos/cloud-and-local-sandboxes/enabling-or-disabling-cloud-sandboxes-for-your-organization).\n\n## Installing the GitHub app in Teams\n\nThe GitHub app only needs to be installed once in a team. After the app is installed, any member of the team can connect their GitHub account to the app and start using it.\n\n1. Open the [GitHub integration installation link](https://teams.microsoft.com/l/app/836ecc9e-6dca-4696-a2e9-15e252cd3f31) in your web browser to launch Teams and the installation dialog.\n2. Click **Add** to add the app to your team.\n3. Follow the prompts on screen to authenticate and authorize the app.\n\n## Connecting the GitHub app to your GitHub account\n\nThe first time you use the GitHub app in Teams, you need to connect it to your GitHub account. Then if prompted, set a default repository.\n\nThe default repository provides the context that Copilot uses when responding to prompts, and it's also where issues and pull requests created by Copilot cloud agent sessions will be opened unless you specify a repository in your prompt.\n\nTo get started:\n\n1. In Teams, @mention the app in a message by typing `@GitHub`.\n2. Follow the prompts to connect your GitHub account, and if prompted, optionally set a default repository.\n3. To see what else you can do, in the thread, @mention the app by typing `@GitHub help`.\n\n## Starting a GitHub Copilot session from your team conversation\n\n@Mention the app in any Teams chat by typing `@GitHub` followed by your task. You can summon the agent for any repository where you have `write` access. The agent responds with a summary of planned changes and a link to the artifacts it creates.\n\nFor example, to ask the agent to create a pull request on a particular branch in a repository, you can type:\n\n```text\n@GitHub Create a pull request to...YOUR_PROMPT repo=OWNER/REPO_NAME branch=BRANCH_NAME\n```\n\nThe `repo` parameter tells Copilot which repository to use, and the `branch` parameter specifies an existing branch to use as the base branch for a pull request.\n\n## Iterating on work in the thread\n\nTo refine the pull request, @mention `@GitHub` in the same thread with your requested changes. Copilot incorporates all messages since the previous @mention to iterate on the work, keeping the discussion and implementation connected.\n\n## Creating issues with Copilot\n\nYou can ask Copilot to create GitHub issues directly from Teams, turning conversations into actionable tasks. Just describe what you need in natural language, and Copilot creates the issue for you.\n\nYou can create a single issue or multiple issues at once with child-parent relationships.\n\nWhen you @mention the app, it uses the full thread history as context for the issues it creates. To keep the context focused, consider starting a new thread or sending a direct message.\n\n## Customizing Copilot cloud agent in Teams\n\nYou can customize how Copilot cloud agent works in your channels and threads using the `settings` parameter. For example, you can set a default repository for a channel.\n\n1. To see and change your channel settings, mention the app in a message by typing:\n\n   ```text\n   @GitHub settings\n   ```\n\n2. Then follow the prompts to make your changes.\n\n### Setting a default repository for a channel\n\nYou can set a default repository for each private or public channel. You cannot set a default repository for direct messages with Copilot.\n\nIf a channel does not have a default repository, Copilot sets the repository you use in your first session in that channel as the channel's default repository.\n\nWhen you do not specify a repository or branch, Copilot uses the channel's default repository and that repository's default branch.\n\n1. In the channel, type `@GitHub settings` and send the message.\n2. Follow the prompts to select a default repository for the channel.\n\n## Feedback and support\n\nYou can view and share feedback in our [discussion forum](https://github.com/orgs/community/discussions/205453).\n\n## Further reading\n\n* [About GitHub Copilot cloud agent](/en/enterprise-cloud@latest/copilot/concepts/agents/cloud-agent/about-cloud-agent)\n* [Managing access to GitHub Copilot cloud agent](/en/enterprise-cloud@latest/copilot/concepts/agents/cloud-agent/access-management)"}