LowCodeStacks™
Sign in

Your first Copilot Studio agent: instructions, knowledge, testing

Build a Copilot Studio agent that answers from your own content, then test it before anyone else sees it. Instructions, scoped knowledge and a repeatable test set.

Copilot StudioFix a problem19 min read

21 sources · Updated By · drafted with AI help, checked by a personHow we write guides

Note

As of September 2026; steps 1, 3, 5 and 6 were updated in October 2026. Copilot Studio changes often. This tutorial describes agents built with the standard harness, the long-standing building experience. Microsoft is also rolling out a new experience built on the GitHub Copilot harness, where some screens and names differ. Check Microsoft Learn for the version you see.

It takes minutes to create an agent in Copilot Studio and much longer to make one people can trust. The difference is almost never the model. It's three things you control:

  • Clear instructions: what the agent is for, and how it should behave.
  • Scoped knowledge: where its answers come from.
  • Real testing: before anyone else sees it.

This tutorial builds a simple internal agent, an IT help agent that answers questions from an IT support SharePoint site, and covers each of the three properly.

Building a first Copilot Studio agent, from creation to a pilot release, with a test loop. Four steps run left to right: create the agent, with a name and description that say exactly what it does; write instructions that set the role, tone, format and what to do when it can't answer; add knowledge and keep it narrow, with Web Search and general knowledge off; and test in the test pane, checking each answer is correct, used the right source and followed the instructions. Your test questions then become two test sets on the Evaluation page. The first holds real questions as single responses, twenty to thirty to start and up to 100, scored with General quality and with Compare meaning once expected answers are written. The second is a small set of questions the agent should decline, with General quality removed and a Custom method that checks it declines and gives the IT Service Desk contact. Running the sets gives each question Pass, Fail, Invalid or Error, and the set a pass rate. When the set passes, publish to a pilot group, not the whole organisation; a wider release needs an admin's approval. When you change the agent, the change stays in draft until you publish again: run the same sets again and use Compare with to see which questions went from pass to fail.
Build the agent, turn your test questions into test sets, and run them again after every change before you publish.

Step 1: create the agent

Sign in to Copilot Studio and choose the environment your organisation uses for agents. To build on the standard harness, select Other ways to build on the Copilot Studio home page, or open the … menu at the bottom of the side bar and select Open classic experience. Microsoft's page on creating agents still describes a New experience switch; if you see one, turn it off. Then either:

  • Describe it in your own words (up to 1,024 characters). Copilot Studio drafts a name, description and instructions, and suggests knowledge, tools, triggers and channels. You can add or dismiss each suggestion, and edit the name, description and instructions later on the Overview page.
  • Create a blank agent and write everything yourself.

Describing is quicker; blank gives you more control. Either way, the result lands on the agent's Overview page, where you'll do the rest.

Give the agent a name and description that say exactly what it does, for example: "Answers questions about laptops, accounts and Wi-Fi from the IT support site." Copilot Studio's orchestrator uses names and descriptions to decide what to use, so vague descriptions lead to vague behaviour.

What the … menu shows, as of September 2026:

  1. Open classic experience, under Explore: the route to the standard harness described above, the one this tutorial uses.
  2. Power Platform Admin Center, under Admin, and Learning resources and Session details, under Help.
  3. Dark mode switches the colour theme.
The menu that opens from the three dots at the bottom of the Copilot Studio side bar. Under Explore: See what's new, Solutions, and Open classic experience, which is highlighted and has an open-in-new-window icon. Under Admin: Power Platform Admin Center. Under Help: Learning resources and Session details. At the bottom, a Dark mode switch, turned off.
Recreated by LowCodeStacks from Microsoft Learn screenshots (CC BY 4.0): the … menu at the bottom of the Copilot Studio side bar, interface as of September 2026.

Step 2: write instructions that work

Instructions tell the agent how to behave: its role, its tone, what it should do, and what to do when it doesn't know. Microsoft's guidance for writing them comes down to a few habits:

  • Structure them with Markdown: headings, bullet lists, and numbered steps only where order matters.
  • Say what to do, with precise verbs, such as "ask", "search" or "use". Don't only list what to avoid.
  • Name the knowledge and tools the agent should use. In the instructions editor, type / to insert a reference to a specific knowledge source, tool, topic or variable.
  • Specify tone, length and format. If you don't, the model guesses, and guesses vary.
  • Define your organisation's terms and acronyms.

Here's a starting point for the IT help agent:

text
# Role
You help employees with IT questions about laptops, accounts, Wi-Fi and printing.

# How to answer
- Use only the IT Support SharePoint site to answer.
- Keep answers short: a one-line summary, then up to five numbered steps.
- Include a link to the page you used.
- Use a friendly, plain tone. No jargon without explaining it.

# When you can't answer
- If the site doesn't cover the question, say so, and give the IT Service Desk
  contact from the "Contact us" page.
- Never guess at passwords, account names or security settings.

# Terms
- "SSPR" means self-service password reset.

Tip

"When you can't answer" matters more than it looks. An agent without it tends to fill gaps with plausible-sounding text. An agent with it says "I don't know" and points to a person, which is what builds trust.

Step 3: add knowledge, and keep it narrow

On the Overview page, select Add knowledge and choose the SharePoint card under Featured. Enter the URL of the IT support site.

What the Add knowledge dialog shows, as of October 2026:

  1. Search for a knowledge source searches the list of source types below.
  2. Upload file: drag and drop files, or upload and sync them from OneDrive or SharePoint. This SharePoint button is for individual SharePoint files, folders or lists, not a whole site.
  3. Featured: a card for each main source type, such as Public websites, Dataverse and Azure AI Search.
  4. The SharePoint card under Featured is the one for this step: it adds a SharePoint site by its URL.
The Add knowledge dialog in Copilot Studio. Under the title, the line "Help your agent provide more relevant information and insights" and a box labelled "Search for a knowledge source". Next comes an Upload file area that reads "Drag and drop, or select to browse, or upload and sync from", with OneDrive and SharePoint buttons, and a note that this helps your agent access knowledge from remote file locations. Below it, the Featured tab is selected next to Advanced, with a filter button and a See suggestions button on the right. Eight Featured cards follow, in two rows: Public websites, SharePoint, Azure AI Search and Dataverse; then Dynamics 365, Salesforce, ServiceNow and Azure SQL. A Cancel button sits at the bottom right.
Recreated by LowCodeStacks from Microsoft Learn screenshots (CC BY 4.0): the Add knowledge dialog in Copilot Studio, interface as of October 2026.

Two things to know about SharePoint knowledge:

  • The agent answers with the user's permissions. When someone asks a question, it searches only content that person can open. Keep the default sign-in setting, Authenticate with Microsoft, so it knows who they are.
  • Only some content is read. The agent reads modern SharePoint pages and common documents, such as Word, PowerPoint and PDF. It doesn't use classic ASPX pages or modern pages built with SPFx components. New or changed content appears only after SharePoint's search index catches up.

Leave Web Search and Allow ungrounded responses off for now. Allow ungrounded responses is in the Knowledge section of the agent's Generative AI settings; some Microsoft pages still call it Use general knowledge. When they're on, the agent can answer from the public web or from the model's own training when your content doesn't cover a question. That makes answers richer but harder to verify. Turn them on later, deliberately, if you decide you need them.

What the Knowledge section of the Overview page shows, as of June 2026:

  1. Add knowledge opens the dialog shown above.
  2. Each source you added is listed with its status, such as Ready.
  3. Web Search: "Enable your agent to search all public websites." The switch shows Enabled when it's on; select it to turn Web Search off.
The Overview page of the agent IT help desk in Copilot Studio, with the tabs Overview, Knowledge, Tools and +6, and Publish, Settings and Test at the top right. The Knowledge card reads "Add data, files, and other resources to inform and improve AI-generated responses" and has an Add knowledge button. One source is listed: the SharePoint site https://lowcodestacks.sharepoint.com/sites/itsupport, with the status Ready. Below it, Web Search, "Enable your agent to search all public websites", with a Learn more link and its switch on, labelled Enabled.
Recreated by LowCodeStacks from Microsoft Learn screenshots (CC BY 4.0): the Knowledge section of an agent's Overview page in Copilot Studio, interface as of June 2026, with a made-up agent and site.

Step 4: test in the test pane

Select Test to open the Test your agent pane, and ask the questions real users will ask, in the way they'll ask them:

  • "My laptop won't connect to the office Wi-Fi."
  • "how do i reset my password"
  • "Can I install software myself?"
  • Something the site doesn't cover, such as "What's the cafeteria menu?"

For each answer, check three things:

  1. Is it correct? Compare it with the source page.
  2. Did it use the right source? The citation should point to the page you'd expect.
  3. Did it follow the instructions? Look at length, format, the link, and the "I don't know" behaviour.

The activity map shows the plan the agent made for each question, including which knowledge or tools it chose and how long each step took. When an answer is wrong, the map usually shows why: the wrong source, or no source at all. Use Reset to start a fresh conversation after you change instructions.

Step 5: turn your questions into a test set

Testing in the chat pane checks one conversation at a time, and it's hard to repeat exactly. Agent evaluation runs a whole set of test cases at once, and you can run the same set again after every change.

Where to start. Open the agent's Evaluation page, select New evaluation, and choose the kind of test set. You can also select the Evaluate icon in the test pane to start from your latest test chat.

  • Single responses: each test case is one question, asked on its own. A set holds up to 100. Start here for a question-and-answer agent like this one.
  • Conversation: each test case is a back-and-forth of up to 12 messages, and a set holds up to 20. It suits agents that must keep context over several turns; add one later if you need it.

What the Evaluation page shows, as of July 2026:

  1. New evaluation starts a new test set.
  2. Each row is a test set, with its number of test cases and its data type, here single response.
  3. Last run status shows the latest score for each test method, such as General quality, and Last run shows who ran it and when.
  4. Test methods lists the methods the set is scored with.
The Evaluation page of a Copilot Studio agent named IT help desk, with the Evaluation tab selected between Overview and a +7 overflow, and Publish, Settings and Test at the top right. Under the heading Evaluate, a New evaluation button sits on the right. A table with the columns Name, Last run status, Last run and Test methods lists two test sets. "Real IT questions" has 30 test cases, data type single response, General quality 87%, last run at 4:12 PM yesterday. "Quick set" has 10 test cases, data type single response, General quality 90%, last run at 9:05 AM on 10/14/26. Both were run by the LowCodeStacks admin account, shown with the initials LC, and both use the General quality test method.
Recreated by LowCodeStacks from Microsoft Learn screenshots (CC BY 4.0): the Evaluation page of a Copilot Studio agent with its list of test sets, interface as of July 2026, with made-up names and figures.

Where the questions come from. For a single-response set, you can:

  • write them yourself, or import a CSV or text file with a Question column and an optional Expected response column (up to 100 questions, each up to 1,000 characters);
  • reuse the questions from your latest test chat (the import option is labelled Preview chat);
  • have Copilot Studio generate them. A quick set gives you 10 questions based on the agent's description, instructions and capabilities. A full set draws on the agent's knowledge or topics.

What the New evaluation page shows with Import selected, as of July 2026:

  1. Generate and Import: the two ways to start a test set, with Or, write some questions yourself beside them.
  2. Select data type: Single responses or Conversations.
  3. Preview chat, under Use existing data: uses the questions from your current preview chat session.
  4. Or upload a file: start from the template, then drag your CSV file onto Drag a file or click to upload (CSV).
The New evaluation page for the agent IT help desk in Copilot Studio, reached from Evaluation, with the Evaluation tab selected among Overview, Knowledge, Tools, Agents, Topics, Activity, Evaluation, Monitor and Channels, and Published 10/20/2026, Publish, Settings and Test at the top right. The heading reads Evaluate IT help desk, with Save and Run greyed out. Step 1, Create or select a data set, has a switch set to Import rather than Generate, and a link, Or, write some questions yourself. Under Select data type, which says to create single messages your users might ask the agent or chats with several messages back and forth, Single responses is selected rather than Conversations. Under Use existing data is a Preview chat option: Use the questions from your current preview chat session. Under Or upload a file, links to a template, to download customer sessions from Analytics, and Learn more, then an area labelled Drag a file or click to upload (CSV). Step 2, Select test methods, and step 3, Additional configuration, are collapsed and greyed out.
Recreated by LowCodeStacks from Microsoft Learn screenshots (CC BY 4.0): the New evaluation page in Copilot Studio with Import selected, interface as of July 2026, with a made-up agent.

Generating from knowledge works with text, Word, Excel and PDF files and individual SharePoint files, each up to 5 MB. SharePoint folders aren't supported, and a whole site isn't on Microsoft's list. For this agent, your own real questions are the better start.

Choose how answers are scored. General quality needs nothing from you. Most other test methods need an expected answer or keywords for every question, and a question without them comes back Invalid for that method.

Test methodWhat it checksFor a first agent
General qualityRelevance, groundedness, completeness, and whether the agent attempted an answer. On by default; needs no expected answersYes
Compare meaningWhether the answer means the same as your expected answer, however it's worded. Default pass score: 50Yes, once you've written expected answers
Keyword matchWhether the answer contains any, or all, of the words or phrases you listOptional, for must-haves such as a page name
CustomYour own instructions and labels, each label set to pass or failYes, for questions the agent should decline (below)
Text similarity and Exact matchHow closely, or exactly, the wording matches your expected answerRarely: they suit fixed wording such as codes, not answers that can be phrased several ways
Tool useWhether the agent used the tools or topics you expectedNot yet: this agent has no tools
Content safetyHarmful content of a chosen type, against a severity level you setOptional

Questions the agent should decline. General quality checks whether the agent attempted an answer, so a correct "I can't help with that" can be flagged for improvement. Microsoft's documentation suggests a Custom method that defines the expected refusal. A test set's methods score every question in it, so we keep out-of-scope questions in a second, small set: remove General quality from it and add a custom method like this.

text
Name: Declines out-of-scope questions

Evaluation instructions:
The user asked about something the IT support site doesn't cover.
Check whether the agent:
- says it can't answer that from the IT support site
- gives the IT Service Desk contact
- doesn't make up an answer

Label 1: Declined correctly
Result: Pass
Description: Says it can't help and points to the IT Service Desk.

Label 2: Answered anyway
Result: Fail
Description: Gives an answer or a guess instead of declining.

Label names accept only letters, numbers, spaces and a few symbols (hyphen, underscore, slash, ampersand, plus and full stop), so leave apostrophes out of them.

Run it, then run it again. Save the set and run it. A run takes a few minutes, and only one runs at a time. Each question comes back Pass, Fail, Invalid or Error, and the set gets a pass rate. Open a failed question to see the expected and actual answers, the reason for the result, and the activity map. After you change the agent, run the same set again and use Compare with to see which questions went from pass to fail.

Before you trust the scores:

  • It runs as you. An evaluation uses the signed-in maker's account and connections. SharePoint answers depend on who's asking, so the scores reflect what you can open. To test as someone else, sign out and sign in as that person. Generated questions can include content your account can see, and any maker with access to the agent can view its test sets.
  • Results are kept for 89 days. Export a run to CSV to keep it longer.
  • The sign-in setting matters. Evaluation supports agents set to Authenticate with Microsoft or No authentication, not Authenticate manually. If evaluations that use your sign-in won't run, ask whether an admin has turned off the Microsoft Copilot Studio connector in a data policy.

Tip

Save twenty to thirty real questions as your first test set, and run it before every publish. It's the fastest way to notice that a change to the instructions fixed one answer and broke three others.

Step 6: publish to a small group first

When the test set passes, select Publish. You can't publish on a trial licence. After the first publish, every later change stays in draft until you publish again.

Then choose where people will use it on the Channels tab, for example Teams and Microsoft Copilot:

  • Start small. Share it with a pilot group, not the whole organisation.
  • Expect an approval step for a wider release. To show the agent to everyone in your organisation, you submit it for an admin's approval. It appears in the Built by your org section of the Microsoft 365 Agent Store only after an admin approves it.

A flow can also call the published agent and pass it data: see Call a Copilot Studio agent from Power Automate.

Checklist

  • The name and description say exactly what the agent does.
  • Instructions set the role, the format, and what to do when the agent can't answer.
  • Knowledge is limited to the sources the agent needs; Web Search and Allow ungrounded responses are off unless chosen deliberately.
  • Answers were checked for correctness, source and format in the test pane.
  • A single-response test set of real questions runs before every publish, scored with General quality, and with Compare meaning once expected answers are written.
  • Questions the agent should decline sit in their own test set, scored with a Custom method.
  • The first release goes to a pilot group.

The steps follow Microsoft's documented behaviour for Copilot Studio agents using the standard harness, as of September 2026. Steps 1, 3, 5 and 6 were checked again against Microsoft Learn in October 2026. The example instructions, the custom test method and the test approach are our own recommendations.

Related: What is Copilot Studio.

Sources

Add LowCodeStacks as a preferred source on Google

Did this fix it?

Get the weekly email

New guides and updates from LowCodeStacks, every Tuesday. One email a week, no more.

From LowCodeStacks, Regina, SK, contact@lowcodestacks.com. You can unsubscribe any time, from the link in every email or in your privacy settings. See the Privacy notice.

Comments

No comments yet. Share what worked for you.

Sign in to comment. Comments show under a display name you choose, never your email.