Diagram: the business's questions become checks. Build, validate, simulate, deploy, ask 64 test cases including 14 guardrails, then a morning-of preflight. GO, or switch the scene that will fail.

An inside sales rep asks an agent which seal to quote on a slurry job. If the answer is confidently wrong once, the rep goes back to calling the product specialist, and the agent doesn’t get a second chance. The sales team already knows that problem: they know which answers matter and what a wrong one costs them. What they can’t know from the outside is whether an agent will give the right answer every time, and refuse the questions it shouldn’t touch.

The first time we asked our live Copilot agents the questions we’d written for them, six of twenty-three came back wrong.

The deployment check had passed: every agent, knowledge file and topic in place. The agents just didn’t say what we needed. One left the seal line out of a slurry recommendation. One put a dollar figure in an answer that should have had none. One picked the wrong card for a question with a branch name in it.

None of that would have shown up in a click-through. It showed up because we’d decided, before writing a single agent instruction, to treat these agents the way we’d treat any software going to production. That decision is what lets the business rely on an agent, and what lets IT stand behind it. The standard behind it is auditability: prove what an agent says before anyone relies on it, and keep proving it after go-live. It’s the fifth post in the series that opened with one story, one department at a time.

Why test Copilot agents at all

Each department in this series shaped an agent around a problem it already knew: product questions for inside sales, order and service questions for customer service, account analysis for branch managers, and campaign material for marketing.

IT can’t personally vouch for every answer those agents give. What IT can own is the proof: a written definition of a correct answer, checked automatically, with a record of every result. That’s the auditing guardrail, and it keeps each agent inside the standards the business set.

Language-model agents make this harder, because the same question can get a slightly different answer each time. You have to ask many times, grade the answers against rules, and tune until the rules hold. If you can’t say in writing what a correct answer must contain and must not contain, you don’t know whether your agent works. You just know it worked the last time you looked.

The business writes the questions

The questions are where the business leads. The inside sales lead is the one who knows a slurry recommendation without a seal line is wrong. The customer service supervisor knows a stock answer never carries a price. The people who know what a right answer looks like write the questions, and IT turns them into automated checks. Simple knowledge of the business becomes a test that runs on every change.

We ended with 64 test cases across the four Copilot Studio agents from post 4. Sixteen are the core questions the agents most need to get right. Fourteen are guardrails, the questions they must refuse. The rest check that the right Adaptive Card opens with the right values, that multi-turn conversations hold together, and that file uploads to the Sales Analyst are read correctly.

Forty-four of those run automatically. The grading is deliberately plain: case-insensitive pattern checks. A case passes only if every required pattern matches and no forbidden pattern matches, on every turn, including text inside Adaptive Cards. There’s no judgement call in the grader, so two people reading the same run reach the same verdict. That matters for an audit.

IT turns the standards into checks

The forbidden patterns are where the business’s standards become specific. A shared pattern fails any answer containing a dollar sign followed by a digit, on every case where the agent has no pricing data. That’s a data boundary, written as a test. Another fails any answer that quotes the agent’s own instructions, a security check.

The guardrail cases cover the rest: a list-price request, a warranty question the agent has no authority to answer, the “ignore your previous instructions” attack, a question about the best barbecue in town, and a comparison against a competitor the agent has no data on. The right answer to all of them is the specific “that isn’t something I can help with here” line each agent was given.

Stats: 64 cases, 44 automated, 14 guardrails, 4 multi-turn; 23 questions in the first run, 17 passed

The process around it

This is part of the cost and process most departments don’t see. Agent Builder, inside Microsoft 365 Copilot, suits a person or team making their own agent. Copilot Studio suits agents a department will depend on, because its agents live inside a Power Platform solution that can be validated, packaged and checked, and every change leaves a trail:

  1. Validate. Every topic file is checked before it ships, catching errors the portal would have accepted silently and shown as a blank card.
  2. Simulate. Each card’s logic runs against sample cases, an order that exists and one that doesn’t, so you see the exact card that will render.
  3. Deploy and check. The solution is imported and published, and a read-only script confirms agents, knowledge, topics and data afterwards.
  4. Ask. A test client calls the live agents, runs the suite, and saves every reply, so a failure can be read rather than reconstructed.

That last step is the audit record: every answer on file, next to the rule it passed or failed.

The script that mattered most on the day was a morning-of preflight. It runs the walkthrough cases against the live agents and prints GO or NO-GO, naming the scene at risk and its fallback. It exits with an error code, so it can’t be ignored by accident.

Build, validate YAML, simulate Power Fx, pack, deploy, check, ask the live agents, preflight GO or NO-GO

What testing changed

Almost every case added to the suite came from a failure. The first-run failures turned into instruction changes: always state the solids limit, never leave out the seal line, narrow the account snapshot so it isn’t used for service history. The rules that a customer name containing a branch name is an account, and a bare five-digit number is an order, both exist because a test failed. Every one of those is something a branch manager could tell you in a sentence. Writing it down as a test is what keeps it true after the next change.

Two lessons from the tuning stand out. First, give each agent its own specific fallback line, and test for that exact line. A generic refusal passes a loose test and sounds broken to a user. Second, narrow the card triggers rather than widening them. When the wrong card opened, our instinct was to make descriptions more inclusive. The fix was to tell the model what each topic is not for.

In the end every automated case passed against the live agents, guardrails and multi-turn conversations included, and stayed that way through the final preflight.

Keep the suite after go-live. Run it on every instruction edit, new knowledge file or product line, and on a schedule, because the platform underneath changes too. When a case fails, the owning department decides the right answer and IT makes the change. That’s how the team keeps using it: reps keep asking the agent instead of drifting back to the specialist’s phone.

The thing that broke anyway

Image generation. The Brand Creative agent in Copilot Studio was supposed to return an on-brand image inside its reply. In testing it was inconsistent, and on the morning of the walkthrough the preflight confirmed it wasn’t going to do what the scene needed.

Because the preflight named the scene and the fallback, we already had an answer. We’d built an Agent Builder copy of the agent, where image generation renders inline reliably, so that scene pointed at the copy, with a static image as a second fallback. The audience saw an on-brand image, not us discovering a problem. It was a fair lesson in layers, too: the lighter tool did that one job better.

You don’t test agents to make them perfect. You test them to know, before anyone relies on them, exactly which parts might fail and what you’ll do when they do. Our suite never made the image generator reliable. It told us that morning that it wasn’t, and that was enough.

The standard this proves

Auditability is the CB5 standard behind this post. The business writes down what a right answer is. IT turns that into checks that run on every change, keeps every result, and won’t promote an agent that fails. When a manager asks whether the order desk agent can handle a new product line, the answer is a test run, not an opinion.

It’s also how business-led AI stays inside the business’s standards as it spreads. The next department’s experts write their questions, the agent inherits the shared guardrail patterns, and it goes live when the run is clean.

Checklist: agents present, knowledge attached, topics enabled, nine walkthrough cases pass, alerts posted, fallback named for each scene

Tomorrow: the training that follows a deployment like this, five capabilities taught in a specific order, with the tools last.

CB5 Solutions helps organizations understand the layers of AI, get the most from what they buy, and build an AI program that pays back inside their IT standards. We start every engagement with one business problem and a governance baseline. Let’s pick yours.