How to Build a Custom Copilot Agent for Your SharePoint Intranet

How to Build a Custom Copilot Agent for Your SharePoint Intranet

A few months ago, a customer told me their employees were giving up on the intranet. Not because the content was bad — they had hundreds of well-written policy pages — but because nobody could find anything. “Where’s the travel policy?” had become a Teams DM to HR five times a day.

We didn’t fix it by reorganizing the intranet. We fixed it by putting a Copilot agent in front of it.

In this post I’ll walk through how to build a custom Copilot agent that’s grounded in your SharePoint intranet, published to Teams, and trustworthy enough to actually deploy.

When a custom agent beats baseline Copilot

Microsoft 365 Copilot already searches SharePoint. So why build a custom agent at all? Three reasons I see in the field:

  • Scope control. Baseline Copilot searches everything the user has access to. A custom agent can be pointed at exactly the sites you want it to answer from — your HR hub, your IT knowledge base, your policy library — and nothing else.
  • Voice and tone. You can give the agent instructions like “Always link to the source page” or “If you’re not sure, say so and suggest contacting HR.”
  • Discoverability. A named agent (“Ask HR”, “Ask IT”) sets the right expectation. People know what they’re talking to.

Setting it up in Copilot Studio

Open Copilot Studio and create a new agent. The fields that matter most:

  1. Name and description. Be specific. “HR Buddy” beats “Company Assistant.”
  2. Instructions. This is where you tell the agent how to behave. Include rules like “Only answer questions related to HR policies. If asked about IT, redirect the user to the IT agent.”
  3. Knowledge sources. Add the specific SharePoint sites or document libraries you want it to ground in. Don’t add the whole tenant — that’s what baseline Copilot is for.
You are HR Buddy, an assistant for [Company] employees.

You answer questions about HR policies, leave, payroll, expenses,
travel, and onboarding — using only the SharePoint sources provided.

Rules:
- Always cite the source page with a clickable link.
- If the answer is not in the provided sources, reply:
  "I couldn't find that in our HR knowledge base. Please contact
  hr@company.com or ask in the #ask-hr Teams channel."
- Do not answer IT, finance, or legal questions. Redirect to the
  appropriate team.
- Keep answers under 120 words unless the user asks for detail.
- Use the user's preferred language (detect from the question).

Grounding it correctly

When you add a SharePoint source, the agent doesn’t just read titles — it indexes content. Two things worth checking:

  • Permissions still apply. Users only get answers from content they already have access to. So the agent doesn’t bypass governance, it inherits it.
  • Metadata helps. If your pages use managed metadata (and if you’ve read my term store posts you know I’m a fan), the agent uses it. Pages tagged with Audience: All Employees will surface differently from Audience: Finance Only.

Publishing to Teams

Once the agent is tested, publish it to Microsoft Teams. Two things I always do at this stage:

  • Pin the agent to a relevant Team or channel — the HR team’s channel for HR Buddy.
  • Add it to your intranet’s Viva Connections dashboard as a card. That’s where employees actually start their day.

Governance pitfalls I’ve seen

A few traps worth flagging before you ship:

  • Don’t ground in shared OneDrive content. Personal files leak.
  • Set a refresh expectation. SharePoint changes are picked up, but not instantly. Tell users.
  • Plan for “I don’t know” answers. Default Copilot behavior is to attempt an answer. You usually want explicit fallback instructions.

A good Copilot agent isn’t a replacement for good information architecture — but it makes a decent intranet feel ten times more usable.