Create an agent in SharePoint

Agents in SharePoint are scoped AI assistants that help you stay on track by simplifying complex tasks and providing guidance based on what you're working on. Create your own by naming it, choosing its sources, and defining its behavior. You can build an agent that's tailored to your team's needs and content, and share it with your teammates to use in Teams or Copilot Chat.

Before you begin

To create an agent, you must:

To change an existing agent instead, see Edit an agent in SharePoint.

Where you can create an agent in SharePoint

After signing in to your SharePoint site with edit permissions, you can create your own agent from:

Note

The agent only answers questions by using information from sites, pages, and files that you already have access to and that are included as the agent's sources. To get information from all the sources you want the agent to use, you might need to update permissions for yourself or for the people you want to share the agent with.

Create an agent from the command bar of a document library or a list

  1. Open the document library or list that you want the agent to use.

  2. On the command bar, select Copilot > Create an agent.

    Copilot menu in a SharePoint document library with Create an agent highlighted.

The agent initially uses the supported content in that library or list as its scope.

Create an agent from the context menu of selected files

  1. In a document library, select the files or folders that you want the agent to use.

  2. Right-click the selection, or select the ellipsis next to one of the selected items.

  3. Select Create an agent.

    Context menu for selected SharePoint files and folders with Create an agent highlighted.

The agent builder opens with the selected content as the initial scope. On the Overview, Sources, and Behavior tabs, review or customize the agent's name, icon, purpose, knowledge sources, welcome message, starter prompts, and instructions. Preview the agent, and then select Create.

Create your new agent dialog with Overview, Sources, and Behavior tabs, an agent preview, and the Create button.

Find the agent file

Agent created from the site home page

Every time you create an agent, you store it as a .agent file.

If you create the agent from the site's home page, the site automatically stores the .agent file under Site contents > Site Assets > Copilots.

Copilots folder in Site Assets containing agent files created from the SharePoint site home page.

Agent created from a document library or list

If you create an agent from a document library or list, the site saves the agent in the current library folder or as an item in the current list.

Agent file saved in the SharePoint document library folder where the agent was created.

You can edit the agent after you create it to:

  • Customizing its branding and purpose
  • Adding or removing which sites, pages, and files your agent should include as knowledge sources beyond the current SharePoint site
  • Refine the agent's behavior by writing customized prompts tailored to the purpose and scope of the agent

FAQ and data handling

To learn more about agents, see Frequently asked questions.

For more information on how Microsoft Copilot works, see Data, Privacy, and Security for Microsoft Copilot.