Evaluating Agents to Reduce Hallucination
Artificial intelligence agents powered by large language models (Probabilistic neural networks trained on vast text corpora that generate responses by predicting likely token sequences rather than consulting a verified fact database.) do not possess true understanding or common sense. They generate responses by predicting the most statistically likely next word based on their training data, their instructions and the knowledge sources you provide. While this capability is incredibly powerful, it introduces a significant risk known as hallucination. A hallucination occurs when an agent presents incorrect, fabricated or entirely nonsensical information as absolute fact. In regulated financial services, a hallucinated (Fluent, authoritative-sounding claims or metrics generated by an AI system that are ungrounded in the source evidence or factually false.) response could mislead a colleague, misinform a customer about a financial product or cause a breach of regulatory standards.
Refresher Core Mental Model: Evaluating Agents to Reduce Hallucination 1 min
In Copilot Studio and AI Agents for Non-Developers: Building Safe Agents in Regulated Financial Services, Evaluating Agents to Reduce Hallucination focuses on turning The Critical Importance of Testing Before Release into a repeatable, governed practice. Rather than treating tools as black-box oracles, anchor every step to three questions: What approved data goes in? What structured draft comes out? And who verifies the result against primary evidence before action is taken?
This lesson focuses on how to systematically evaluate your agents using the built-in tools in Microsoft Copilot Studio. You will learn how to identify hallucinations, adjust your agent to correct them and ensure your testing processes respect data privacy, security and regulatory accountability.
The Critical Importance of Testing Before Release
You must always prioritise testing before release. Deploying an untested agent into a financial environment carries unacceptable risks. Under the Financial Conduct Authority Consumer Duty (The UK Financial Conduct Authority (FCA) regulatory standard requiring firms to act to deliver demonstrably good outcomes for retail customers across products and support.), financial firms are required to deliver good outcomes for retail customers and avoid causing foreseeable harm. If an internal agent hallucinates a detail about a mortgage lending criteria policy and a staff member relies on that output to advise a customer, the firm risks causing direct financial harm.

Furthermore, the Senior Managers and Certification Regime (The UK financial regulatory framework establishing personal, non-delegable accountability for senior managers over the operational processes and automations in their area.) sets a clear expectation of responsibility. There must always be named human ownership and accountability for an artificial intelligence system. A designated individual must oversee the evaluation process, verify that the agent performs safely and explicitly approve the agent for release. If hallucinations or silent failures occur, this named owner is accountable for ensuring that the agent is taken offline or that fixes are applied promptly.
Setting Up Safe Evaluation Environments
Before you even open the test tools, you must ensure your evaluation environment is safe and secure. Evaluating an agent requires you to ask it questions and prompt it with scenarios to see how it responds. You must protect confidential and personal data during this process to comply with the UK General Data Protection Regulation (Data protection legislation requiring lawful processing, data minimization, purpose limitation, and strict security controls over personal data.) and internal firm policies.
You must exclusively use synthetic test prompts and synthetic data. Synthetic data is entirely fictional information designed to mimic the structure and complexity of real data without containing any actual customer details. You should never upload real customer files, real financial statements or live confidential policy documents into an experimental agent environment.
Additionally, you must maintain least-privilege permissions during evaluation. Least-privilege permissions mean that a user, or an agent, is only given the absolute minimum level of access required to perform a specific task. When building and testing in Copilot Studio, ensure your test agent only has access to a restricted, designated test repository. It must not have active connections to live production databases or overly broad permissions that could lead to accidental data leakage.
Using the Copilot Studio Test Pane
Microsoft Copilot Studio includes a dedicated Test pane that allows you to interact with your agent exactly as a user would, while providing you with behind-the-scenes diagnostic information. This is your primary tool for identifying hallucinations.
When you open the Test pane, you can type a message to your agent. As the agent processes your request, the test pane can show which topic, tool or knowledge source the agent used. If your agent uses specific knowledge sources, such as a synthetic policy document uploaded to a SharePoint site, the Test pane will generate citations. You can select these citations to open the source the agent used, so you can check the answer against it.
To systematically evaluate your agent, you should deliberately ask complex, ambiguous or slightly misleading questions. Observe whether the agent correctly interprets the synthetic data, whether it admits when it does not know the answer, or whether it hallucinates a plausible-sounding but incorrect response. It is crucial to verify that the agent relies strictly on the approved knowledge sources and does not invent external facts. For larger checks, Copilot Studio can also run evaluations from test sets: you add test questions, optionally with expected answers, and choose test methods such as general quality (which scores relevance, groundedness and completeness), compare meaning or keyword match. The general quality method can mark down an agent that correctly refuses an out-of-scope question, so use a custom test method to define what a correct refusal looks like.
| Test Scenario | Factual Output (Desirable) | Hallucinated Output (Risk) |
|---|---|---|
| Synthetic Data: Maximum loan-to-value ratio for a fictional first-time buyer product is 90 percent. Test prompt asks if a 95 percent ratio is allowed. | The maximum loan-to-value ratio for this product is 90 percent. A 95 percent ratio is not permitted based on the current lending criteria. | Yes, a 95 percent ratio is allowed for first-time buyers if they have a guarantor. (The agent invented the guarantor rule). |
| Synthetic Data: A fictional complaints handling manual states all complaints must be acknowledged within three working days. | Complaints must be acknowledged within three working days according to the complaints handling manual. | Complaints must be acknowledged within 24 hours to comply with Financial Conduct Authority regulations. (The agent substituted external knowledge for internal policy). |
| Synthetic Data: The uploaded test document contains no information about interest rates for limited company buy-to-let mortgages. | I am sorry, but I do not have access to information regarding interest rates for limited company buy-to-let mortgages in my provided documents. | The current interest rate for limited company buy-to-let mortgages starts at 5.25 percent. (The agent entirely fabricated a statistic). |
Plain-text version
Test Scenario | Factual Output (Desirable) | Hallucinated Output (Risk) Synthetic Data: Maximum loan-to-value ratio for a fictional first-time buyer product is 90 percent. Test prompt asks if a 95 percent ratio is allowed. | The maximum loan-to-value ratio for this product is 90 percent. A 95 percent ratio is not permitted based on the current lending criteria. | Yes, a 95 percent ratio is allowed for first-time buyers if they have a guarantor. (The agent invented the guarantor rule). Synthetic Data: A fictional complaints handling manual states all complaints must be acknowledged within three working days. | Complaints must be acknowledged within three working days according to the complaints handling manual. | Complaints must be acknowledged within 24 hours to comply with Financial Conduct Authority regulations. (The agent substituted external knowledge for internal policy). Synthetic Data: The uploaded test document contains no information about interest rates for limited company buy-to-let mortgages. | I am sorry, but I do not have access to information regarding interest rates for limited company buy-to-let mortgages in my provided documents. | The current interest rate for limited company buy-to-let mortgages starts at 5.25 percent. (The agent entirely fabricated a statistic).
Logging, Auditing and Applying Fixes
Identifying a hallucination in the Test pane is only the first step. You must also verify that logging and audit mechanisms capture all unexpected outputs. Copilot Studio automatically saves conversation transcripts and provides analytics on its Monitor page. You must regularly review these logs to understand how the agent behaves over time. Proper record-keeping is a fundamental aspect of operational resilience in financial services, ensuring you have an audit trail of how the agent makes decisions.
When you identify a hallucination during testing or via the audit logs, the named human owner must take accountability for applying fixes. Fixes typically involve refining the instructions provided to the agent. For example, you might add a strict instruction stating, “You must only answer using the provided knowledge sources. If the answer is not contained in the sources, you must state that you do not know.” Alternatively, a hallucination might indicate that the synthetic knowledge document itself is poorly formatted or contradictory, requiring you to clean the data before testing again.
Hackathon Exercise: Systematically Testing a Policy Agent
In this exercise, you will adopt the role of a compliance officer testing a new internal agent designed to answer questions about staff trading rules. You will work in a safe, isolated Copilot Studio environment.
- Verify Safe Access: Confirm you are logged into a designated test environment. Verify that the agent has least-privilege permissions and is only connected to a secure folder containing synthetic test documents.
- Prepare Synthetic Data: Upload a provided synthetic document detailing fictional rules for staff personal account dealing. Ensure this document contains absolutely no real employee data.
- Open the Test Pane: Launch the Copilot Studio Test pane and use the options it offers to follow which topic, tool or knowledge source the agent used, so you can view the agent logic.
- Conduct Stress Testing: Type three distinct prompts designed to test the boundaries of the synthetic policy. Ask one straightforward question, one question about a topic not covered in the document, and one highly ambiguous question.
- Analyse for Hallucination: Review the agent responses carefully. Did the agent invent a rule when asked about the missing topic? Click on the citations for the factual answers to confirm they map accurately to the synthetic document.
- Review the Audit Logs: Test chat conversations are saved as transcripts in Dataverse but do not appear on the Monitor page. Ask your administrator, or a colleague with the Bot Transcript Viewer role, to confirm that your test conversation was saved and can be exported for audit purposes.
- Apply a Fix: If the agent hallucinated, navigate to the agent instructions. Add a strict, plain-language rule instructing the agent to refuse to answer if the information is not explicitly detailed in the synthetic staff trading document. Retest the prompt to confirm the fix works.
By thoroughly evaluating your agent in a controlled environment, restricting its access, relying solely on synthetic data and maintaining clear human accountability for all fixes, you significantly reduce the risk of harmful AI hallucinations entering your financial services firm.

Go deeper Architectural & Governance Trade-Offs in Evaluating Agents to Reduce Hallucination 1 min · optional
When scaling Setting Up Safe Evaluation Environments across a team or regulated workflow, the primary bottleneck is rarely generation speed—it is verification overhead and drift. High-performing teams track two operational metrics alongside throughput: Edit-to-Approval Time (how many minutes a human reviewer spends correcting outputs) and Source-Traceability Rate (whether 100% of material numbers and claims link back to an audited record). If edit time exceeds manual drafting baseline across two cycles, tighten your input schema and negative constraints before expanding scope.
Level 33: Executive AI Fluency Certification
Master AI strategy, LLM deployment economics, and vendor evaluation without needing a coding background.
