How to test a Copilot Studio agent with a test set

Day 5, 30 minutes · beginner

Goal of this lessonImport a test set of eight questions with expected answers, run it before and after one change and compare the two runs.

Why it matters

Today Dorian announces a new rule: late returns are free for 15 minutes instead of 30. You write a test set for the new rules, run it, swap the rules file, run it again and see exactly which answers changed. At the end you have a test set you can run after every change to your agent.

So far you tested your agent one question at a time. That works on day one. It stops working the moment you change something: a new rule, a new instruction, a new tool. Did the change fix the one answer you looked at and break three others? In the test chat you cannot tell without asking everything again.

Copilot Studio has an Evaluation page for this. You write a test set: a list of questions, each with the answer you expect. Copilot Studio sends every question to the agent, scores every answer and keeps the result. Change one thing, run the same set again and compare the two runs side by side.

A few words you will meet

  • Test case: one question, optionally with the expected response.
  • Test set: a group of test cases. A single-response test set holds up to 100.
  • Test method: how an answer is scored. Copilot Studio calls these graders too.

Which test method for what

  • General quality scores relevance, groundedness, completeness and whether the agent tried to answer. It needs no expected response, and every test set starts with it.
  • Compare meaning checks whether the answer means the same as your expected response, even in other words. Its default pass score is 50.
  • Keyword match checks for words or phrases you list, such as "15 minutes".
  • Capability use checks whether the agent used all or any of the resources you expected.
  • Classification checks the answer against labels you define. Microsoft points to it for cases where the right answer is a refusal, because General quality can mark a refusal as a problem.

Every method except General quality needs expected responses or keywords.

Where test cases come from

A Quick question set lets Copilot Studio write 10 questions from your agent's description, instructions and capabilities. That is quick, but you still have to write the expected responses yourself, because every method except General quality needs them. For a rules agent you want your own: a CSV file with two columns, Question and Expected response, at most 100 questions of up to 1,000 characters each. Keep commas out of the answers, so the columns stay clean.

The steps

  1. Write the test set for the new rules: eight questions with expected answers.
  2. Import it on the Evaluation page as a single-response evaluation.
  3. Add Compare meaning next to General quality.
  4. Run it. The late-return case should fail: the agent still knows the old rule.
  5. Change one thing: upload version 2 of the rules file and remove version 1. An uploaded file is a copy, so editing the file on your computer changes nothing.
  6. Run the same set again and compare the two runs.
  7. Export the results to keep them.

Follow the guide for Microsoft Copilot Studio below for the exact clicks.

Good to know

  • Results are kept for 89 days. Export them to a CSV file to keep them longer.
  • Only one evaluation runs at a time. Wait for one to finish before you start the next.
  • Evaluations run as you, the signed-in user, with your access to knowledge and tools. Another maker of the same agent sees the run results, but only the person who started a run sees the agent's answers in it.
  • Labels differ between pages. The evaluation pages themselves are not marked preview, the test chat page still calls test sets "(preview)", and test sets built from analytics themes are preview. Expect the screens to change.
  • Trial and quotas. No page we read says whether the trial includes evaluation. The quotas page lists 10 generative AI messages per minute in trial environments. If a run stops with errors, wait a few minutes and run it again.

The course Claude API Evals covers evals from the code side.

What to avoid

  • Changing two things between runs. Then you cannot tell which one helped.
  • Reading one flipped case as proof. With ungrounded responses off, a correct answer is sometimes withheld (lesson 2), so one case can fail by chance. Open the case and read the answer before you act on it.

Later, add a question or two the file does not answer. General quality can mark a correct "I don't know" as a problem, so score those with Classification.

Example: Dorian's before and after

The first run passed seven of eight cases. The case "a customer is 25 minutes late" failed: the agent said it was free. Dorian uploaded version 2, removed version 1 and ran the set again. With Compare with he saw one arrow turn from fail to pass, and no case go the other way. He exported both runs and saved them next to the rules file.

Deeper dive

Today's actions

Ticks are not saved without an account

Do it in Microsoft Copilot Studio

Microsoft Copilot Studio

  1. Paste these lines into a plain text editor and save the file as tidewater-tests.csv.
    Question,Expected response
    What is the deposit for an e-bike?,The deposit for an e-bike is 150 euros paid by card.
    What is the deposit for a city bike?,The deposit for a city bike is 50 euros paid by card.
    A customer is 10 minutes late. Do we charge anything?,No. A return 10 minutes late is free.
    A customer is 25 minutes late. What do we charge?,10 euros because a return more than 15 minutes late costs 10 euros per started hour.
    A customer brings the bike back with a broken bell. Do they pay?,No. Small damage to a bell or light or reflector is free.
    When does a hire day end?,A hire day ends at 18:00.
    Can a customer return the bike to another branch?,Yes. It can go to one of our other branches for 5 euros.
    How much of a repair can we take from the deposit?,We take the repair cost from the deposit but never more than the deposit.
  2. Open your agent's Evaluation page, select New evaluation and choose Single responses.
  3. Choose to import a file and upload tidewater-tests.csv. Name the test set Tidewater rules v2 and check the eight cases.
  4. Under Select test methods, keep General quality, select Add test method, choose Compare meaning, keep the pass score and select OK.
  5. Start the run (the button is Run or Evaluate, depending on the screen). When it ends, open the result and note which cases failed.
  6. Save this as tidewater-hire-rules-v2, add it with Add knowledge and Add to agent, then remove the old file with the three dots next to it on the Knowledge page.
    Tidewater Bike Hire: hire rules (version 2)
    
    1. Hire day. A hire day ends at 18:00. The bike goes back to the branch where it was hired, unless rule 6 applies.
    2. Deposit. Every hire needs a deposit, paid by card: 50 euros for a city bike and 150 euros for an e-bike. We return the deposit when the bike comes back undamaged.
    3. Late returns. Up to 15 minutes late is free. After that we charge 10 euros per started hour, up to the price of one extra hire day.
    4. Damage. The customer tells the front desk about any damage. The colleague writes an incident note with the bike number, the branch and what is damaged. Small damage (bell, light or reflector) is free.
    5. Repair costs. Other damage is repaired at cost price. We take the cost from the deposit, never more than the deposit.
    6. Other branch. A customer may return the bike to another of our three branches (Quayside, Millgate or Station Square) for 5 euros.
  7. Back on the Evaluation page, run the same test set again from the list of recent results.
  8. Open the new result, pick the first run under Compare with and look at the arrows. Then use the three dots and Export test results for both runs.

Note: Evaluations only work for agents on No authentication or Authenticate with Microsoft, and they need the Microsoft Copilot Studio connector. If your admin's data policy blocks that connector, you cannot run them. Uploaded files are copies: changing the file on your computer does not change the agent.

Building the agent works on the free trial with a work or school account. No Microsoft page we read says whether the trial includes evaluation.

Checked on 4 December 2026 · Source: Microsoft Learn: Create a single response test set (opens in a new tab)

Create a free account to save your progress. Sign in or sign up