Create a Custom Copilot Agent for SharePoint Online

Copilot Agents Rolling Out to Targeted Release Tenants

On October 23, 2024, Microsoft published message center notification MC916296 (Microsoft 365 roadmap item 416297) to announce the rollout of Copilot agents in SharePoint Online to targeted release tenants. Worldwide deployment to targeted release tenants is due to finish in early November 2024 with general availability following to all tenants (with Microsoft 365 Copilot licenses) completing in late December 2024.

Microsoft included Copilot agents in SharePoint Online as part of their Wave 2 announcement on September 16, 2024. At the time, I thought that Copilot agents were the most interesting part of Wave 2. Copilot pages, another major part of the announcement, are a nice way to capture the output from Copilot queries, but having an agent automatically created for SharePoint sites to query just the content from that site seemed like more useful functionality. I was therefore very happy to see Copilot agents show up in my tenant.

Default Copilot Agent for Sites

When users have a Microsoft 365 Copilot license, they see a Copilot option in the navigation bar when a document library is open. Selecting Copilot opens the default agent for the site, which responds to user prompts by reasoning over Office documents and PDF files stored in the site. Limiting Copilot to a predefined set of files from a site stops Copilot using a wider search to find information in any file it can access across the tenant or through a web search if permitted by the tenant. It’s a way of getting a precise response from information held in a site.

Creating a Custom Copilot Agent

Site members with create and edit permissions (for a site owned by a Microsoft 365 group, any group member) can create a Copilot agent to create an even more precise search. For instance, I store the source Word documents for every article that I write (including this one) in a document library in a SharePoint Online site. Using the Create a Copilot agent option, I created a custom Copilot agent to reason over the articles. The entire operation took less than a minute, which is kind of startling.

The Sources tab of the wizard selects the folders or file for Copilot to process (Figure 1). You can select the entire site or any of the folders or individual files from the site, including from any document library if the site includes more than the default document library. The name of the agent can be between 4 and 42 characters.

Defining the source content for a custom Copilot agent
Figure 1: Defining the source content for a custom Copilot agent

The Behavior tab allows you to tailor the sample prompts shown to users and how Copilot will respond. In Figure 2, I’ve changed the tone for the responses from professional to formal and modified one of the starter prompts.

Modifying the behavior of a custom Copilot agent
Figure 2: Modifying the behavior of a custom Copilot agent

After saving the agent, Copilot creates a file in the document library for the agent and adds the agent to the recently used list of agents (Figure 3). If you make a mistake with an agent, simply delete the file. The file is also used to share agents. For instance, you can create a sharing link for the agent and include it in email or a Teams chat. If the people who see the link have access to the documents processed by the agent, they can use the sharing link to access the agent.

Creating a custom Copilot agent creates a file in the document library
Figure 3: Creating a custom Copilot agent creates a file in the document library

The list of recently used agents includes agents from other sites. You don’t need to navigate to a specific site to use its agents because they can be invoked from elsewhere in SharePoint.

Using the agent is like any other Copilot interaction. You compose a prompt (question) and submit it to Copilot for processing. Copilot restricts its search to the set of files defined for the agent. Figure 4 shows a sample interaction where I asked Copilot to search for anything that I have written about Copilot Pages, and it duly found the Word document source for the published article.

Interacting witn a custom Copilot agent
Figure 4: Interacting witn a custom Copilot agent

Custom agents work very well for sites storing small to medium documents. Copilot doesn’t do so well with large documents. For example, I created a custom agent based on the folder holding the Word source documents for the chapters in the Office 365 for IT Pros eBook. Many of these files are over 50 pages long, and the agent couldn’t use the chapter files in its responses.

Missing Features

Microsoft says that the current release does not include the ability to interact with a Copilot agent in a Teams chat, nor does it include the extension to Copilot Studio to customize agents. Another missing feature is the ability for site owners to approve agents or to define a default agent for a site. Microsoft says that these features will be available later in 2024. However, they haven’t said if administrators will be able to control Copilot agents across the tenant, such as having PowerShell cmdlets to enable or disable the feature for selected sites.

The Advantage of Precise Searches

Since its debut, Microsoft 365 Copilot has been plagued by oversharing issues caused when Copilot responses include unexpected information. The source for the information is available to the signed-in user, which is why Copilot can access the content, and is usually a result of flawed site permissions or overly-generous sharing. Flawed information generated in documents can creep into other documents and end up polluting the Graph.

Copilot agents offer more precise responses. I anticipate these agents being very useful in sites that hold specific information like product documentation when you really don’t want results to be polluted by some random document found in a site that no one remembers.


Learn about using SharePoint Online and the rest of Office 365 by subscribing to the Office 365 for IT Pros eBook. Use our experience to understand what’s important and how best to protect your tenant.

4 Replies to “Create a Custom Copilot Agent for SharePoint Online”

  1. Hi Tony, is there any tenant-wide or site-specific way to manage (enable / disable) these Copilot Agents?
    While they appear to potentially add a lot of value in certain use cases, I’d be cautious in providing them to all Copilot users equally, and especially based on only Microsoft’s rollout timing.

    1. As I note in the article, Microsoft says that they will provide the ability for site owners to approve agents or select the default agent for a site. I’m unaware of any plans to allow tenant administrators to control agents more broadly, such as being able to disable agents for specific sites or block agents for the entire tenant. I suspect that agents are now part of the basic Copilot offering…

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.