Bendrinti naudojant


Extend Copilot for Microsoft 365 with copilot agents

Copilot for Microsoft 365 provides default experiences for engaging with content and resources from across an organization. While the default functionality provides many useful capabilities, sometimes end users need to interact with a more focused conversational assistant, accessible directly within Copilot for Microsoft 365.

In Microsoft Copilot Studio, these more focused assistants are called copilot agents. These copilots are authored by giving natural language instructions that generate prompts to the large language model (LLM) within Copilot for Microsoft 365. Agents can include references to enterprise data, actions, and suggested prompts.

Note

What are called copilot agents in Copilot Studio are known as agents in Copilot for Microsoft 365. For more information about Copilot for Microsoft 365 extensibility, see Microsoft 365 Copilot extensibility.

This article covers:

  • Authoring an agent
  • Adding actions and knowledge to the agent
  • Publishing the agent to Copilot for Microsoft 365 and Microsoft Teams

What are copilot agents, actions, copilot knowledge, and starter prompts?

The following table gives more detailed information about the distinctions between agents, actions, copilot knowledge, and starter prompts.

Name Definition
Copilot agent A copilot agent is created by authoring a prompt to the Copilot for Microsoft 365 LLM. This prompt is used to define a set of runtime behaviors, personalities, and rules that govern the copilot's interactions. An agent is most often used in the context of extending Copilot for Microsoft 365. An agent can also be used directly as a copilot in Microsoft Teams.
Action Formerly known as plugins. The mechanism that lets a copilot call out to other systems and retrieve data or perform other actions. Actions are single-turn interactions. Actions can be authenticated, and can include parameters, cards, and other functionalities. See Use actions with custom copilots.
Knowledge Knowledge refers to information that lives within your Microsoft 365 tenant, including SharePoint, and Graph connectors.
Starter prompt Starter prompts are maker-authored prompts in an agent that make it easy for end users to do common or sophisticated actions with the agent.

Keeping agents secure

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

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

Prerequisites

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

Create an agent

Unlike traditional authoring where a maker creates each topic with natural language triggers for even simple tasks, a large language model (LLM) backed agent has a baseline set of default behaviors. As a maker, you can then add knowledge and actions to make the agent more capable for your specific requirements.

To create an agent for Copilot for Microsoft 365:

  1. Sign-in to a Copilot Studio account at https://copilotstudio.microsoft.com

  2. Navigate to Copilots in the left side navigation panel.

  3. Select Microsoft 365 Copilot in the list of copilots.

  4. From here, select + Add on the Agents card. You're sent to the conversational authoring experience.

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

  6. 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.

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

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

Add knowledge to an agent

When you first create an agent, it starts out with only the base LLM knowledge. The agent is unaware of any other data sources. To give it more knowledge, select + Add knowledge overview page of the agent or the Knowledge view selected from the top of the page.

There are three primary types of knowledge that can be added to an agent:

Name Definition
SharePoint Paths to SharePoint resources in the organization. Copilot for Microsoft 365 uses the credentials of the user to ensure they only are given answers from information they have access to.
Copilot (Graph) connectors Connectors are data sources configured by the tenant admin to add knowledge to Microsoft Copilot and agents. Learn more about Graph 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. Choose a data source.
    • If you're using SharePoint, provide a path to root of the library or site. A single page or file being specified isn't supported at this time.
    • If you're using a copilot connector and the admin configured a Graph connector in Microsoft 365, you can choose a Graph connector from the configured data sources.
    • Web search can be enabled/disabled from the copilot overview page in the Additional Settings card.

Multiple knowledge sources can be added with a mix of types to an agent. In addition, for SharePoint, up to four paths can be included.

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 are not returned, please submit feedback to Microsoft for analysis and product improvement.

Add an action to an agent

An action is used to enable an agent to retrieve information or to perform a task such as updating a record or completing a transaction. Actions can be created from copilot connectors (also known as Power Platform connectors). Action types include AI Builder prompts, connectors, flows, and custom connectors. Learn more about copilot connectors.

Adding an action requires extra planning on the part of the maker vs adding knowledge. Several considerations come into play:

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

Each of these considerations comes in to play when adding actions to an agent.

Screenshot of actions panel

To add an action:

  1. Return to the agent's overview page.
  2. From the Actions card, choose Add Action.
  3. Search for the desired copilot connector or choose Create a new flow or Add an API for a custom connector.
  4. Assuming a copilot connector is chosen, a UX is presented with Connector and Configure sections.

Connector section

  1. End User Authentication: Choose the type of authentication preferred for this action. You have a choice between user authentication and copilot author authentication. Other authentication configuration details are automatically handled by the copilot connector implementation.
  2. Usage Description: Instructions that tell the Copilot for Microsoft 365 LLM how to use the action in the agent.

Configure section

  1. Plugin Action Name: The name for the action as seen in Copilot for Microsoft 365 in citations. This information also can be influential in helping Copilot for Microsoft 365 choose the action to execute.
  2. Display Name: Friendly name for the action as seen in the Copilot for Microsoft 365 user experience.
  3. Description for the copilot to know when to use this action: A full conversational description of when the LLM in Copilot for Microsoft 365 should use this action, and the sort of questions that trigger it.

Inputs and outputs

Copilot Studio automatically populates a set of inputs and outputs by inspecting the copilot connector object. The maker can let the Copilot for Microsoft 365 LLM fill in those fields or fill them in manually during authoring.

By default, no customization is needed on this experience unless the maker chooses to manually fill a field, or chooses to override a description.

Screenshot of actions inputs edit panel

Finishing and testing

The last tab allows you to review your choices, make any adjustments and then save your changes.

Once saved, the actions are ready to test in the Copilot Studio test chat. Select Refresh at the top of the test chat, and then ask a question that should invoke the action.

In the chat, the first time the user triggers the action, the agent presents a connection card. This card is used to enable the end user to sign in to the action with their own credentials.

Screenshot of configure connections card

Selecting Connect takes the user to an experience where they can choose the connection for the action they're using and sign in or otherwise connect to it. Once the connection is established, it's durable for the session. After that, the user can close the browser and retry the action.

Important

The full screen browser for connection management is a temporary solution and will be addressed before release.

Starter prompts

Often when users first interact with any sort of copilot, they don't know what they can ask, or don't understand the richness of the copilot. As a result they tend to ask simple questions. Copilot for Microsoft 365 addresses this issue by providing a starter prompts experience. Starter prompts present the user with easy prompts to get started.

Screenshot of starter prompts in Copilot for Microsoft 365 chat

Copilot Studio automatically creates starter prompts when you use the conversational experience to create your agent. You can also edit or create your own at any time with the Starter prompts experience on the Overview page.

Understanding starter prompts

One way to use the starter 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 starter prompts, copilot authors have full access to the capabilities of the Microsoft 365 Copilot large language model, including the actions and knowledge you added. Consider creating sophisticated prompts that help users achieve common tasks easily.

Screenshot of starter prompt suggestions

Author starter prompts

  1. Navigate back to the agent's Overview page.
  2. Scroll down to Starter Prompts and select Edit.
  3. Add up to six starter prompts and hit save.

Publishing an agent

Once the agent is working how you want in the Copilot Studio test experience, you're ready to publish. Publishing converts the agent from a draft state to a published state, ready to upload to the organization's catalog. Unlike a standalone copilot, an agent isn't automatically deployed to Copilot for Microsoft 365 and Teams when published.

Publish your agent

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

  2. Choose Publish on the top right.

    The information on the subsequent form is used to populate the catalog entry in the organization's Office and Teams Catalogs and the Microsoft Admin Center Integrated Apps list. It isn't used by the Copilot for Microsoft 365 LLM.

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

    When the operation is complete, you're taken to the Availability options page.

Note

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

Availability Options

The Availability options page is used to distribute the agent to the agent's author's account to use or 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 has disabled side-loading or publishing for the tenant, one or more of these features may be blocked. 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 Lets you grant access to others to participate in authoring the agent, or to security groups to grant them access 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/Copilot for Microsoft 365 to submit to the admin to review, or upload directly to the organizational catalog.

More information about managing apps in the Teams catalog can be found here: Manage Power Platform Apps

Using the agent in Microsoft 365 Copilot or Microsoft Teams

The agent should now be available to try out in Copilot for Microsoft 365 or Teams. The user can interact with the agent by either @mentioning the agent in the Copilot for Microsoft 365 chat interface or by selecting the agent from the sidebar. Once selected, the user interacts only with the agent until they end that conversation and return to Microsoft Copilot.

In the screenshot, the user requests information that's in the knowledge included in the agent. The LLM, evaluating the agent's instructions, knowledge, and actions, determines that the best way to resolve the request is by using its knowledge to generate an answer. The LLM also includes references for the sources it uses to generate the answer.

Screenshot using the agent in Copilot for Microsoft 365

Tips for agent authors

  • Copilot for Microsoft 365 caches answers from previously asked questions in a given session, even if it called an action to retrieve data. To break this cache, use the New Chat button.
  • To see more information about why the LLM does or doesn't select an action, enter -developer on into the Copilot for Microsoft 365 input box and ask the question.
  • The results you see at runtime in Copilot for Microsoft 365 might be different from what you see in Copilot Studio's test canvas and Microsoft Teams.
  • Unlike a custom 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 Copilot for Microsoft 365.