Share via


Extend Microsoft 365 Copilot with agents

Microsoft 365 Copilot provides default experiences for engaging with content and resources from across an organization. While the default functionality provides many useful capabilities, sometimes customers need to interact with a more focused conversational assistant, accessible directly within Microsoft 365 Copilot. An example of where a more focused assistant is useful is when you need support for a specific subject area with specialized vocabulary, grounded on a subject-specific knowledge base.

You can help Microsoft 365 Copilot handle these situations by extending it with a specialized agent built in Copilot Studio.

You can add agents to Microsoft 365 Copilot in two different ways:

  • Custom agents
  • Agents for Microsoft 365 Copilot

Note

Agents for Microsoft 365 Copilot are called declarative agents in Microsoft 365 Copilot. Learn more about Microsoft 365 Copilot extensibility.

This article covers:

  • Authoring a custom agent
  • Authoring an agent for Microsoft 365 Copilot
  • Adding tools and knowledge to an agent
  • Publishing a custom agent to Microsoft 365 Copilot and Microsoft Teams

What are Copilot agents, tools, knowledge, and suggested prompts?

The following table provides detailed information about the distinctions between Copilot agents, tools, knowledge, and suggested prompts.

Name Definition
Custom agent A custom agent is an agent you build from scratch. A custom agent can include a wide range of capabilities, including knowledge, tools, and suggested prompts. You author custom agents in a conversational interface that generates prompts for the Copilot Studio model. You can publish custom agents to Microsoft 365 Copilot and Teams channel, but you can also use them with other channels.
agent for Microsoft 365 Copilot You create an agent to use in Microsoft 365 Copilot by authoring a prompt for Microsoft 365 Copilot. This prompt defines a set of runtime behaviors, personalities, and rules that govern the agent's interactions. A Copilot agent is equivalent to a declarative agent created in Agent Buider inside Microsoft 365 Copilot. An agent for Microsoft 365 Copilot extends Microsoft 365 Copilot, and you can equip it with tools and knowledge. These agents can also be used directly as an agent in Microsoft Teams.
Tool The mechanism that lets an agent call out to other systems and retrieve data or perform other actions. Tools are single-turn interactions. Tools can use authentication, and can include parameters and other functionalities. See Add tools to custom agents.
Knowledge Knowledge refers to information that lives within your Microsoft 365 tenant, including SharePoint, and Graph connectors.
Suggested prompt Suggested prompts are maker-authored prompts in an agent that make it easy for customers to do common or sophisticated actions with the agent.

Keeping agents secure

Microsoft 365 customers and partners can use Copilot Studio to build agents that extend Microsoft 365 Copilot with custom instructions, grounding knowledge, and tools invoked via REST API descriptions configured by the agent. Tools grab data that influences the behavior of your Microsoft 365 Copilot, including data from untrusted sources like emails and support tickets. Bad actors can create payloads in these untrusted sources to manipulate the agent's behavior, such as incorrectly answering questions or invoking custom tools.

To protect your agent from bad actors, use the controls in Copilot Studio to configure secure connectors used for knowledge and custom tools.

Prerequisites

  • Users and makers must have a license to use Microsoft 365 Copilot.
  • Makers must have permissions to create in and have access to a Copilot Studio environment.

Create and configure a custom agent

For more information about creating and configuring custom agents, see the following articles:

Create an agent for Microsoft 365 Copilot

Creating agents for Microsoft 365 Copilot in Copilot Studio is similar to creating custom agents, in that both use a conversational authoring experience.

However, the starting point is different for agents built for Microsoft 365 Copilot.

Custom agents use the main agent creation flow through either Create > New agent or Agents > New agent.

You create agents for Microsoft 365 Copilot from the Copilot for Microsoft 365 agent page.

To create an agent for Microsoft 365 Copilot:

  1. Select Agents in the left side navigation panel.

  2. Select Copilot for Microsoft 365 from the list of agents.

  3. Select Add on the Agents card. You're sent to the conversational authoring experience.

  4. In full sentences, describe what the agent should be able to do and know.

  5. When the interaction is completed, select I'm done in the chat.

    Note

    Skip over the conversational interface at any time, by choosing Skip to configure.

  6. Select Create to get to the overview page for the agent.

The agent is now created. You can interact with the agent in the test canvas, or add more capabilities and knowledge to it. So far, the agent has no added knowledge sources. The only information the agent has is the data you provide in the instructions. The agent doesn't have access to enterprise knowledge or any other tools at this time, so any responses come from the generative AI's own knowledge.

You can see the newly created agent under the Agents tab on the Copilot for Microsoft 365 agent page. Because the agent isn't a custom agent, it doesn't appear in the main agents list.

Add knowledge to an agent for Microsoft 365 Copilot

When you create the agent, it starts with only the base generative AI knowledge. The agent doesn't know about any other data sources. To give it more knowledge, add knowledge on the Overview page for your agent, or on the Knowledge page.

You can add three primary types of knowledge to an agent:

Name Definition
SharePoint Paths to SharePoint resources in the organization. Microsoft 365 Copilot uses the credentials of the user to ensure they only get answers from information they have access to.
Copilot (Graph) connectors Connectors are data sources configured by the tenant admin to add knowledge to Microsoft 365 Copilot and agents. Learn more about Copilot connectors
Web search The agent can also use public web search (via Bing) to retrieve web results

Note

Web Search is configured via the capabilities card on the overview page, not on the knowledge page.

To start adding knowledge to the agent:

  1. Return to the agent overview page.

  2. From the Knowledge card, select Add Knowledge.

  3. Select a data source.

    • If you're using SharePoint, provide a path to root of the library or site. Specifying a single page or file isn't supported.
    • If you're using a Copilot connector and the admin configured a Copilot connector in Microsoft 365, you can choose a Copilot connector from the configured data sources.
    • You can prevent an agent from searching the web, or allow it, from the Overview page for the agent.

You can add multiple knowledge sources with a mix of types to an agent. In addition, for SharePoint, you can include up to four paths.

With the knowledge sources configured, the agent with knowledge is immediately available in the test chat. Close the knowledge panel, choose the refresh gesture at the top of the test chat to get a new chat, and then try asking questions that should be present in the data source.

Note

If results aren't returned, submit feedback to Microsoft for analysis and product improvement.

Add a tool to an agent for Microsoft 365 Copilot

Use a tool to let an agent retrieve information or perform a task, such as updating a record or completing a transaction. You can create tools from connectors (also known as Power Platform connectors). Tool types include prompts, prebuilt connectors, and custom connectors. For more information about connectors, see Add tools to custom agents.

Note

Currently, agents for Microsoft 365 Copilot don't support agent flows.

Adding a tool requires extra planning compared to adding knowledge. Consider the following questions:

  • Should the tool use the user's authentication or the maker's authentication?
  • Can the maker provide descriptions to inform the generative AI when and how to invoke the tool?
  • Should the parameters to the function always be automatically filled, or should the maker fill them at authoring time?

Each of these considerations comes into play when adding tools to an agent.

To add a tool:

  1. Return to the Overview page for your agent.

  2. From the Tools card, select Add tool.

  3. Search for the desired tool or select New tool.

    If you select New tool, the Add tool pane appears where you can select the type of tool to add. The available options are:

    • Prompt
    • Computer use
    • Custom connector
    • REST API
    • Model context protocol

    Agent flows aren't currently available as an option to extend Copilot agents.

  4. For each of the new tool options, once you select the type of new tool to add, you're taken through a guided experience to create the tool. The experience is similar to the one used for adding a new tool to a custom agent.

View and update tool configurations

After you create a tool, it appears in the list of tools on the Overview page. Select a tool to view and edit its configuration. The tool configuration experience has three tabs:

  • Details
  • Inputs
  • Outputs

Details section

Use the Details section to configure the tool name, display name, and description.

  • Tool name: The name for the tool to show in citations. This information also helps Microsoft 365 Copilot choose the tool to execute.
  • Display name: Friendly name for the tool to show in the Microsoft 365 Copilot experience.
  • Description for the agent to know when to use this tool: A full conversational description of when Copilot should use this tool, and the sort of questions that trigger it.

Inputs and outputs sections

Copilot Studio automatically populates a set of inputs and outputs by inspecting the connector object. You can let Copilot fill in those fields or fill them in manually during authoring.

By default, you don't need to customize this experience unless you choose to manually fill a field or override a description.

Test your tool

When you're done making adjustments, test the tool in the Copilot Studio test chat. Select Refresh at the top of the test chat, then ask a question that should invoke the tool.

The first time you trigger the tool, the agent presents a connection card in the chat. This card prompts you to sign in to the tool with your own credentials or use your single sign-on (SSO) credentials, as applicable.

Suggested prompts

When users first interact with an agent, they often don't know what they can ask or don't understand the richness of the agent. As a result, they tend to ask simple questions. Microsoft 365 Copilot addresses this issue by providing a suggested prompts experience. Suggested prompts present the user with easy prompts to get started.

Copilot Studio automatically generates suggested prompts when you use the conversational experience to create your agent. You can also edit suggested prompts or create your own at any time from the Suggested prompts section on the Overview page.

One way to use the suggested prompts is as a shortcut for simple questions you expect users to ask. However, they're also an opportunity to present more sophisticated prompts that the user might not otherwise understand are possible.

Within suggested prompts, agent authors have full access to the capabilities of the Microsoft 365 Copilot large language model, including the tools and knowledge you added. Consider creating sophisticated prompts that help users achieve common tasks easily.

Publish a custom agent to the Teams + Microsoft 365 channel

You can also extend Microsoft 365 Copilot with a custom agent by publishing the agent to the Teams + Microsoft 365 channel. For details on how to publish your custom agent to the Teams + Microsoft 365 channel, see Connect and configure an agent for Teams and Microsoft 365.

Publishing an agent for Microsoft 365 Copilot

When the agent works as you expect in the Copilot Studio test experience, you're ready to publish. Once published, an agent for Microsoft 365 Copilot is ready to upload to the organization's catalog. Unlike a standalone agent, an agent for Microsoft 365 Copilot isn't automatically deployed to Microsoft 365 Copilot and Teams when published.

Publish your agent for Microsoft 365 Copilot

  1. Go back to the agent's Overview page.

  2. Select Publish on the top right.

    The information on the next form populates the catalog entry in your organization's Office and Teams Catalogs and the Microsoft Admin Center Integrated Apps list. The Microsoft 365 Copilot language model doesn't use this information.

  3. Fill in the fields as needed and select Publish.

    When the operation completes, the Availability options page appears.

Note

When you select Publish, a bot resource is provisioned in your tenant's Microsoft Entra ID environment, corresponding to your Copilot agent. The resource allows users to interact with the agent in Microsoft Teams.

Set availability options

Use the Availability options page to distribute the agent to your account, to small groups of peers governed by distribution lists, or to be published to the organization's catalog by an admin.

Note

If an administrator blocks side-loading or publishing for the tenant, one or more of these features might be unavailable. Work with the tenant admin to determine the appropriate distribution mechanism for the tenant.

Availability Option Description
Share Link You can copy a deep link into Microsoft Teams to invoke the published agent. Opening the link in the tenant opens a chat experience with the agent.
Show to my teammates and shared users Grant access to others to participate in authoring the agent, or to security groups to use the agent in Microsoft 365 Chat or Teams.
Show to everyone in my org Submit to the tenant admin to add to the organizational catalog for all tenant users to install as desired.
Download as a .zip Download as a zip folder. This availability option lets you manually upload to Teams/Microsoft 365 Copilot to submit to the admin to review, or upload directly to the organizational catalog.

For more information about managing apps in the Teams catalog, see Manage Power Platform Apps.

Use the agent in Microsoft 365 Copilot or Microsoft Teams

You can try the agent in Microsoft 365 Copilot or Teams. Interact with the agent by either @mentioning the agent in the Microsoft 365 Copilot chat interface or by selecting the agent from the sidebar. After you select an agent, you interact only with the agent until you end that conversation and return to Copilot or Teams.

Tips for agent authors

  • Microsoft 365 Copilot caches answers from previously asked questions in a given session, even if it calls a tool to retrieve data. To break this cache, use the New Chat button.
  • To find out why the generative AI selects or doesn't select a tool, enter -developer on in the chat and ask the question.
  • The results you see at runtime in Microsoft 365 Copilot might be different from what you see in Copilot Studio's test canvas and Microsoft Teams.
  • Unlike custom agents, Copilot agents don't collect data in the Copilot Studio Analytics tab. This feature is being evaluated for future releases.
  • When using Microsoft 365 Copilot to test your agent, use the thumbs down feedback experience to provide feedback to the Microsoft Copilot team to review and address issues. Feedback doesn't directly affect the triggering quality of Microsoft 365 Copilot.