Skip to content
Sierrix

How to build a Copilot agent: two real agents, step by step

We took two agents Microsoft and the Microsoft 365 community publish on GitHub, a company handbook agent and a product answers agent, and show how to rebuild each for your business in Agent Builder, with no code.

By the Sierrix team ·Published · 14 min read

Most “build an agent” tutorials use a toy example: a gardening coach, a trivia game. This guide doesn’t. We looked at the agents published on GitHub for people to copy, picked the two that fit a small business best, and show you how to rebuild each one for your own company in Agent Builder, with no code.

  • Company Handbook, based on Microsoft’s own My Company Policy agent: staff ask about time off, benefits, safety rules and procedures, and get an answer with the exact section it came from.
  • Product and Service Answers, based on a popular Product Support sample: your front desk and sales staff ask about products, prices, warranties and returns, and get a cited answer instead of interrupting you.

Where these agents come from

Three public GitHub collections are the best places to see how real Copilot agents are built:

CollectionWhat’s in it
m365-agent-templatesReady-to-use business agents with sample documents, setup guides and test questions. The source of our first agent.
copilot-pro-dev-samplesDozens of community agent samples, from product support to IT and HR help desks. The source of our second agent.
copilot-campHands-on labs, including a no-code track for Agent Builder and Copilot Studio.

Many samples in these collections connect to systems like ServiceNow or Salesforce and need a developer. The two we chose use only your own documents in SharePoint, so anyone with a Copilot seat can build them in an afternoon.

Before you build

  1. Check there isn’t a ready-made one. Researcher, Analyst and the Word, Excel and PowerPoint Agents are included with a paid seat. See the levels guide.
  2. You need Agent Builder. It’s the New agent button in the Copilot app. See Copilot basics if you haven’t found your way around yet.
  3. Know the cost. People with a paid Copilot seat use agents like these at no extra charge. Colleagues without a seat can use an agent you share, but each answer that searches your files costs about $0.12, and only after an admin sets up pay-as-you-go billing.

Agent 1 · About 15 minutes once your documents are ready

Company Handbook

What it does: answers staff questions about your policies and procedures, such as time off, holidays, benefits, safety rules, vehicle use and “how do we handle a callback?”, from your own documents, and says exactly where each answer came from.

Based on: the My Company Policy agent(MIT license), which ships with sample policies, a test plan and three ways to install it. We use its “build from scratch in Agent Builder” route and trim it for a company of 5 to 50 people.

Step 1: Gather the documents

Create a SharePoint folder called Handbook (or use an existing policies library) and put in the current versions of:

  • Your employee handbook, broken into sections with headings
  • Time off, holidays and pay schedule
  • Benefits summaries from your insurer or payroll provider
  • Safety procedures, vehicle and equipment rules
  • How-to procedures: opening and closing, job handoff, customer complaints

Give each policy a name and number, and give sections headings (“Leave Policy HR-03, Section 2: Accrual”). The agent cites what it can see, so clear names mean clear citations. Remove old versions, and check that the folder isn’t open to anyone who shouldn’t see it.

Step 1: one SharePoint folder holding only the current handbook documents, each named with its policy number.

Step 2: Create the agent

Step 2: the New agent screen. You can describe the agent in plain English, but Skip to configure lets you fill in each field yourself.
  1. In the Copilot app, select New agent, then Skip to configure.
  2. Name: Company Handbook (30 characters maximum).
  3. Description: “Answers questions about our company policies and procedures, with the policy and section for every answer.”

Step 3: Paste the instructions

This is a shortened version of the original instructions. The full version is about 4,900 characters, well under the 8,000 limit, and worth reading. Replace [Company] with your name:

Instructions

You are the Company Handbook assistant for [Company] employees. You help staff understand company policies and procedures accurately and clearly.

Knowledge: Answers must be grounded only in the documents in the Handbook folder. Do not use general knowledge or assumptions. If the answer is not in the documents, say so and suggest the employee ask [owner or office manager].

Always cite your source: document name, policy number and section, for example: “Full-time employees earn 10 paid days off in their first year. (Time Off Policy, HR-03, Section 2)”

Ask before answering when it depends on details you don’t have, such as full-time or part-time, how long they’ve worked here, or which crew or location. Ask one question at a time, starting with the most important.

Lead with the answer, then the details. Use short bullet points. Plain language, no HR jargon.

Do not give legal, medical or disciplinary advice about a specific situation. Explain what the policy says and refer them to [owner or office manager].

If a question isn’t about company policy or procedures, say this assistant only covers policies and procedures.

End every answer with: “AI-generated from our handbook. Check anything important with [owner or office manager].”

Two lines in the original do most of the work: “Answers must be grounded exclusively in these documents”stops the agent from filling gaps with generic internet policy, and “Ask one question at a time” stops it from answering “How much PTO do I get?” before it knows whether the person is full-time.

Step 4: Add knowledge and starter prompts

  • Knowledge: add the Handbook folder. Nothing else: an agent pointed at your whole SharePoint will find drafts.
  • Starter prompts, adapted from the original:
    • “What types of time off can I take as a full-time employee?”
    • “What happens in my first 90 days?”
    • “What are our paid holidays this year?”
    • “What’s the procedure if a customer calls about a problem after we’ve left the job?”
Steps 2 to 4 together: the Configure tab with the name, description, instructions, the Handbook folder as its only knowledge, and starter prompts.

Step 5: Test with questions you know the answers to

The original comes with a test plan: questions with known answers, checked for three things. Borrow the idea. Write ten questions whose answers you know, and check each response for:

  1. Right answer, matching the document.
  2. Right citation: the policy and section it names actually say that.
  3. Right behavior when the answer isn’t there: it says so instead of making one up.
Step 5: a good test answer: straight to the point, with the policy and section so you can check it.

Then select Create and share it with your team.

Agent 2 · About 15 minutes once your documents are ready

Product and Service Answers

What it does: answers your staff’s questions about what you sell, such as specs, options, prices, lead times, warranties, returns and repairs, from your own product and service documents, with a cited source every time.

Based on: the Product Support agent in the PnP community samples, written by Garry Trinder. The original is published for developers to deploy from code, but it uses nothing except a folder of documents, so it rebuilds in Agent Builder without code. Its instructions are just five sentences, which shows how little you need when the documents are good.

Step 1: Gather the documents

Create a SharePoint folder called Products and Services with:

  • This year’s price list or rate sheet
  • Product or service sheets: one per product line, with specs and options
  • Warranty terms, return and repair policy
  • Your top 20 customer questions with the answers you give (write them down once; the agent reuses them forever)
Step 1: the Products and Services folder: this year’s price list, one sheet per product line, warranty terms and your common questions.

Step 2: Create the agent

  1. New agent › Skip to configure.
  2. Name: Product Answers.
  3. Description: “Answers questions about our products, services, prices, warranties and returns from our own documents.”

Step 3: Paste the instructions

The original, with Contoso Electronics swapped for your business and two rules added for pricing:

Instructions

You are Product Answers, an assistant for [Company] staff.

When asked what you can do, reply: “I answer questions about [Company] products and services, prices, repairs, returns and warranties.”

Use documents from the Products and Services folder as your only source of information.

If you can’t find the information, say so and suggest the person check with [name or team] directly.

Keep responses concise and always include a cited source.

Only quote prices from the current price list, and say which document and date the price came from. Never estimate a price that isn’t listed.

When comparing products or options, show the comparison in a table.

Step 4: Add knowledge and starter prompts

  • Knowledge: the Products and Services folder.
  • Starter prompts, adapted from the original sample:
    • “What can you do?”
    • “What’s the warranty on [your most popular product]?”
    • “Recommend an option for a customer who needs [common need].”
    • “Compare [product A] and [product B] in a table.”
The Configure tab for Product Answers: the same fields, with the Products and Services folder as its only knowledge.

Test it the same way as the handbook agent, then create and share it.

Testing on the Try it tab: a comparison in a table, with prices from the current price list and a citation to check.

Want it on your public website for customers? That’s a different tool. Copilot Studio has aWebsite Q&A template that answers from your site’s pages. Customer-facing agents are billed per message in Copilot Credits, and the templates are meant for internal use as a starting point, so a public chatbot needs more setup and testing than the steps above.

What the good agents have in common

Read enough published agents and the same handful of rules keep showing up in the ones that work:

  • One job, narrowly defined. “Company policies and procedures,” not “anything about the company.”
  • One curated knowledge source. A single folder of current documents, not a whole SharePoint site.
  • “Only from these documents.” Every strong sample forbids general knowledge for business answers.
  • “Always cite.” Citations let staff check answers in seconds, and they expose bad documents quickly.
  • A clear exit. What to say, and who to send people to, when the answer isn’t there.
  • Ask before assuming. The community IT help desk sample puts it well: “Do not immediately suggest all resolution options. Instead, progressively narrow down to the right resolution by asking targeted clarifying questions.”

Test it like a skeptic

Before anyone else sees it, try to break it:

  • A question with a known answer. Is it right, and is the citation real?
  • A question that depends on missing details. Does it ask, or guess?
  • A question that isn’t covered. Does it admit it, or invent a policy or a price?
  • Something off-topic. Does it stay in its lane?
  • The same question twice. Are the answers consistent?

When an answer is wrong, the fix is almost always in the instructions or the documents, not in how the question was asked.

Share it and keep it current

  • Share the agent with specific people or a group, much like sharing a file. An admin can also publish it for everyone and pin it in the Copilot app (Microsoft 365 admin center › Agents).
  • People can also call it from any Copilot chat by typing @ and its name.
  • Give it an owner who replaces documents in the folder when policies or prices change, and reads a sample of answers once a month.
  • Tell the team what it’s for, what it isn’t for, and who to ask when it can’t help.

When to go further: agents that do the work

Both agents above answer questions. The bigger time savings come when an answer turns into finished work: a quote built from your past estimates and price list, filled into your template, saved to the customer’s folder, emailed for approval and followed up automatically. Agent Builder agents can’t take those actions. That’s a job for Copilot Studio andPower Automate:

  • Power Automate cloud flows on the standard connectors (Outlook, Teams, SharePoint, OneDrive, Excel, Forms, Approvals) are included with Microsoft 365 Business plans, with no per-run charge.
  • A rule-based Copilot Studio agent (set questions and buttons, published to Teams) can collect job details and hand them to a flow without per-use charges.
  • An AI Copilot Studio agent that reads job photos or free-form requests uses Copilot Credits at $0.01 each, usually cents per conversation, and needs billing set up first.

Designing that well, so AI is used only where it earns its cost, is most of what we do in an assessment.

Sources

  • My Company Policy agent: github.com/microsoft/m365-agent-templates (MIT license)
  • Product Support declarative agent: github.com/pnp/copilot-pro-dev-samples, samples/da-product-support
  • IT Helpdesk declarative agent: github.com/pnp/copilot-pro-dev-samples, samples/da-ITHelpdesk
  • Build agents with Agent Builder: learn.microsoft.com/microsoft-365/copilot/extensibility/agent-builder-build-agents
  • Website Q&A template: learn.microsoft.com/microsoft-copilot-studio/template-website-q-and-a
  • Agents in Copilot Chat and billing: learn.microsoft.com/copilot/agents