Microsoft 365 Copilot is a powerful, general-purpose assistant that greatly improves personal productivity, helping users manage tasks like emails, calendars, document searches, and more.
However, the true potential of M365 Copilot lies in its extensibility. By building specialized "vertical" agents on top of M365 Copilot, you can unlock team productivity as well as automate business processes. These custom agents not only help in individual productivity, but also help in building workflows across groups of people.
Agents for Microsoft 365 Copilot leverage the same robust foundation—its orchestrator, foundation models, and trusted AI services—that powers M365 Copilot itself. This ensures consistency, reliability, and security at scale.
So in this post, let's take a look at how to build Agents on top of Microsoft 365 Copilot.
We will be building a Declarative Agent with the help of the Teams toolkit. Before we start, we need the following prerequisites:
A Microsoft 365 Copilot license
Teams Toolkit Visual Studio Code extension
Enable side loading of Teams apps
Once everything is in place, we will go to Visual Studio Code
In the Teams Toolkit extension, To create an agent, we will click on "Create new app"
Then, click on "Agent"
When the agent is created, we see a bunch of files getting created as part of the scaffolding. So let's take a look the difference moving pieces of the agent:
manifest.json
If you have been doing M365 Apps (and Teams apps) for a while, you are familiar with this file. This is the file which represents our Agent in the M365 App catalog. It contains the various details like name, description and capabilities of the app.
However, you will notice the new property in this file which is "copilotAgents" This property will be pointing to a file containing the description of our new declarative agent. So let's look at how that file looks next:
declarativeAgent.json
Lots of interesting things are happening here.
instruction.txt
And finally we have the instructions file where we can specify the system prompt for the agent. Here, we can guide the agent and assign it personality. We can make it aware of the tools and capabilities it has available and when the use them. We can provide one shot or few shot examples to "train" the agent on responding to users.
Once all files are in place, you can click "Provision" from the Teams toolkit extension: