Copilot 7 min read

How to Build a Copilot Agent Grounded in a SharePoint Library

I built a resume screening agent over a library of 80 resumes in under six minutes, with Copilot writing the instructions for me. Here are the steps, plus how I bring several agents into one chat and where Microsoft's prebuilt agents fit.

Key takeaways

  • You can create a Copilot agent straight from a SharePoint document library by selecting Copilot, then Create an agent, on the library's command bar. The library becomes the agent's knowledge.
  • Copilot can write the agent's instructions for you. Describe the inputs and the output you want, then paste its draft into the agent's instructions.
  • A SharePoint agent only answers from content the person using it can already open, so sharing the agent doesn't share the library.
  • In Copilot Chat you can @mention an agent to bring it into a conversation. In my demo, five agents took turns in one thread and each one picked up the context from earlier in the chat.
  • Prebuilt agents such as the Surveys agent in Microsoft Forms and the SharePoint page agent need a Microsoft 365 Copilot licence and no setup.

To build a Copilot agent from SharePoint, open the document library that holds the content, select Copilot and then Create an agent on the command bar, and paste in instructions describing the output you want. The library becomes the agent’s knowledge. In the video above I built a resume screening agent over a library of 80 resumes this way, with Copilot writing the instructions, and had a shortlist in under six minutes.

The agent came out of a Copilot agent in a day session, and it’s deliberately plain: one library, one job description, one set of instructions I didn’t edit. When I recorded it the menu was called AI actions. It’s now the Copilot menu on the library’s command bar, and the builder that opens is Microsoft 365 Copilot Agent Builder.

What do you need before you start?

  • A Microsoft 365 Copilot licence, or pay-as-you-go billing turned on for agents in SharePoint in your organisation.
  • Edit permission on the SharePoint site where you’re creating the agent.
  • One library that holds the content the agent should reason over. Mine was a job applications library with 80 resumes in it and nothing else.
  • A clear picture of the output. I started with the end in mind: a shortlist of five, a recommended candidate and ten interview questions for that person.

How do you build the agent?

  1. Ask Copilot to write the instructions. Describe what the agent does, what you’ll give it and what it should give back, and ask for instructions that will get the best result. I dictated mine, covering the job description and key selection criteria as inputs and the shortlist, recommendation and interview questions as outputs. Copilot came back with inputs and numbered steps.
  2. Open the library and create the agent. On the command bar, select Copilot, then Create an agent. The agent starts with the library’s content as its scope, so the sources are already set. You can also select specific files or folders, right-click and choose Create an agent to scope it to just those.
  3. Paste the instructions in. I pasted Copilot’s draft in as it was. Agent Builder allows up to 8,000 characters of instructions.
  4. Name the agent. I skipped this in the video and had to open the agent’s sources to check I was chatting with the right one. Agent Builder names can be up to 30 characters.
  5. Create it and give it the input. I attached the job description and asked it to process the candidates against the JD and key selection criteria. It returned the five, a recommended candidate with a justification, and ten interview questions (five competency-based, three behavioural, two situational).
  6. Keep the conversation going. Follow-up prompts gave me the reasoning for the candidates it didn’t pick, a rejection email for each, and a success email to the recommended candidate.

From opening Copilot to the agent existing took about four minutes.

How do you use several agents in one conversation?

In Copilot Chat you can @mention an agent to bring it into the conversation, and you can swap to a different agent a few prompts later. I built a set of agents for a construction project site, each grounded in its own libraries (site reports, compliance docs, permits and approvals, client communication), and shared them with a colleague’s account by sending the agent links. Clicking a link opens a dialog to add the agent to the agent list on the left.

Working as that colleague, I ran the whole update in one thread, and each agent worked from what earlier agents had said. The compliance agent flagged a plumbing certificate, the permit and inspection agent checked it against documents in its own libraries, the client communication agent wrote a client update “based on everything we have chatted about”, and the executive dashboard agent turned the lot into a board summary with KPIs, top risks and next steps.

Five agents, one conversation: @mentioning each agent when its job comes up

Which prebuilt agents are worth knowing?

Microsoft’s own agents need no building, only a Microsoft 365 Copilot licence, and a couple of them finish work your custom agents start.

The SharePoint page agent turns a chat into a SharePoint page. After my compliance agent produced a document status update by subcontractor with traffic lights, I @mentioned the page agent and asked for a page that kept the tables and colours. It asked me to pick a site, created nothing until I clicked its card, and left the page unpublished until I’d tidied the headings and published it myself.

Chaining the compliance agent and the SharePoint page agent to publish a page

The Surveys agent builds a Microsoft Forms survey from a description. It was a Frontier agent when I tested it and is now generally available, and it also opens from the Copilot icon inside Forms. From one starter prompt it drafted an eight-question customer feedback survey with NPS and open questions. I changed question types and added a name question just by asking, then had it email the survey to a colleague, and the email arrived with a working link.

The Surveys agent drafting, editing and sending a Microsoft Forms survey

Give every agent one job and its own library

The resume agent works because the library holds resumes and nothing else. Point an agent at a site full of drafts, old versions and unrelated folders and the answers get vaguer. The construction agents follow the same rule: one job each, grounded in the libraries for that job. When I later folded several of them into one project manager agent, each job became a skill inside it, which I wrote up in adding skills to Copilot agents in Agent Builder.

Before building any agent, though, check whether you need one. If the job happens once inside a document, Copilot in the app may already do it, which I compared in Copilot agent vs Copilot in Word.

Read the instructions Copilot writes before you paste them, even though I didn’t change mine. They decide what the agent asks for and hands back, and they’re the first place to look when the output drifts.

Sharing the agent link shares the agent and nothing else, because it only answers from content the person using it can open. Resumes are personal information, so the library should be locked to the people doing the hiring before anyone builds an agent on top of it. And keep the decision with a person. The agent gives you a shortlist and its reasons, and a person should read those reasons, check the shortlist for bias and make the call. I said as much at the end of the video: you’d still want to do your due diligence.

What to watch for

  • The Try it pane. You can’t @mention other agents while testing an agent in Agent Builder. Multi-agent chats only work once the agent is created.
  • Who you share with. If a colleague’s answers come back thin, check they can open the library the agent is grounded in.

Frequently asked questions

Do I need Copilot Studio to build an agent on a SharePoint library? No. Creating an agent from a library opens Microsoft 365 Copilot Agent Builder, which needs a Microsoft 365 Copilot licence or pay-as-you-go billing for agents in SharePoint, plus edit permission on the site.

Where do I find agents someone has shared with me? Open the link they sent and add the agent from the dialog. Agents also appear under Get Copilot agents in the Microsoft 365 Copilot app and in Teams, and if your admin hasn’t approved one you’ll see Request approval instead of Add.

Can I @mention agents outside Copilot Chat? Yes. Microsoft supports @mentioning an agent from the Copilot pane in Word and PowerPoint as well as in Copilot Chat.

Get these in your inbox. One email a week.

Practical thinking on organising your information and getting real work out of AI. Subscribers get the free SharePoint Skill course to start.