Hackathon Exercise: Building a Policy Q&A Agent

Welcome to the practical hackathon exercise. In this session, you will build a functional artificial intelligence agent using Microsoft Copilot Studio (Microsoft’s low-code platform for designing, grounding, testing, and governing custom AI agents with restricted knowledge sources and action boundaries.). Your objective is to create a Human Resources Policy Q&A Agent that answers routine staff questions based entirely on a mock staff handbook. You will not use any real customer, employee or confidential information. All data in this exercise is completely synthetic.

Refresher Core Mental Model: Hackathon Exercise: Building a Policy Q&A Agent 1 min

In Copilot Studio and AI Agents for Non-Developers: Building Safe Agents in Regulated Financial Services, Hackathon Exercise: Building a Policy Q&A Agent focuses on turning Regulatory Context and Accountability 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?

Building an agent is only partly about the technology. As a professional in UK financial services, your primary focus must be on governance, safety and accountability. Throughout this exercise, you will demonstrate named human ownership, ensure the agent protects sensitive data, restrict access using least-privilege (The security principle of granting users, apps, and AI agents access only to the minimum data records and actions required to perform their defined task.) permissions, configure a clear logging and audit trail, and subject the agent to rigorous testing before release.

Regulatory Context and Accountability

Before opening Microsoft Copilot Studio, you must establish clear governance for your agent. Under 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.), UK financial services firms must maintain clear lines of accountability. An artificial intelligence agent cannot take responsibility for its actions. A named human owner must be accountable for the design, testing, deployment and ongoing monitoring of the agent.

Hackathon Exercise: Building a Policy Q&A Agent

Furthermore, you must design the agent to comply with operational resilience rules and UK General Data Protection Regulation requirements. This means ensuring the agent cannot leak personal data and that it maintains comprehensive records of its interactions to satisfy Financial Conduct Authority record-keeping expectations. The FCA 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.) requires firms to deliver good outcomes for retail customers. While this specific exercise builds an internal staff agent, internal operational failures or incorrect policy guidance can ultimately lead to poor customer outcomes. Therefore, embedding safety at the design stage is the most reliable way to meet these regulatory expectations.

Phase 1: Preparation, Environments and Data Grounding

Before building, confirm that you are working within a designated development or sandbox environment within the Microsoft Power Platform. Environments act as secure containers that separate your experimental hackathon work from live production systems. This separation is a core control for operational resilience (The regulatory obligation for firms to identify important business services and remain within impact tolerances during severe but plausible operational disruptions.).

Your first technical task is to provide the agent with knowledge. In Microsoft Copilot Studio, this is known as grounding. Grounding directs the agent to answer from the specific documents you provide, which significantly reduces (but does not remove) the risk of hallucination where the AI invents an incorrect or plausible but false answer.

Follow these steps to ground your agent:

  • Create a new agent: Open Microsoft Copilot Studio and select the option to create a new agent. Give it a clear, descriptive name such as Mock HR Policy Q&A Agent.
  • Upload synthetic data: Navigate to the Knowledge section. Upload the provided synthetic staff handbook document. Remember that you must never upload real confidential data, real customer details or actual internal policies during a hackathon or initial testing phase.
  • Review knowledge sources: Ensure no other external websites or unauthorised SharePoint sites are connected. Over-permissioned connectors are a major source of data leakage risk. You must verify that the agent only has access to the single synthetic document you provided. In the agent’s generative AI settings, also switch off web search and Allow ungrounded responses, so the agent does not answer from the open web or from the model’s general knowledge.

Phase 2: Defining Instructions and Least-Privilege Access

Next, you must define the instructions for your agent. Instructions tell the agent how to behave, what tone to use, and what it must not do. A well-written instruction is one layer of defence against prompt injection, which is a security risk where a user attempts to trick the agent into ignoring its original instructions to reveal underlying data or system prompts. Instructions alone cannot reliably stop prompt injection, so limiting what the agent can access matters just as much.

In the instructions panel, write a clear directive. For example, state that the agent must only answer questions using the uploaded mock handbook, must use a professional tone, and must state clearly if it cannot find the answer in the provided text. This explicit limitation prevents silent failure, where the agent provides an incomplete answer or simply stops processing without warning the user.

Once the instructions are set, you must configure access controls. Security in financial services relies on the principle of least-privilege permissions. Users should only have the minimum access necessary to perform their duties. You must never share an agent with the entire organisation by default.

Comparison of Agent Sharing Scopes and Risk Levels
Sharing ScopeExample Use CaseRisk Level and Governance Control
Private (Only the Creator)Initial hackathon development and early testing of the mock handbook agent.Lowest Risk. No data exposure to other staff. Mandatory for early drafting phases.
Specific Security GroupSharing the agent with a designated HR testing team for User Acceptance Testing.Moderate Risk. Access is tightly controlled using Entra ID security groups. Represents best practice for least-privilege access.
Entire OrganisationLaunching a fully approved, non-confidential holiday request policy agent.Highest Risk. Requires extensive admin approval, data policy reviews, and strict named human accountability before deployment.
Plain-text version
Sharing Scope | Example Use Case | Risk Level and Governance Control
Private (Only the Creator) | Initial hackathon development and early testing of the mock handbook agent. | Lowest Risk. No data exposure to other staff. Mandatory for early drafting phases.
Specific Security Group | Sharing the agent with a designated HR testing team for User Acceptance Testing. | Moderate Risk. Access is tightly controlled using Entra ID security groups. Represents best practice for least-privilege access.
Entire Organisation | Launching a fully approved, non-confidential holiday request policy agent. | Highest Risk. Requires extensive admin approval, data policy reviews, and strict named human accountability before deployment.

Phase 3: Configuring Logging and Audit Trails

Financial regulators expect firms to maintain robust records of business operations. If a staff member makes a decision based on information provided by your agent, you must be able to trace exactly what the agent told them. Microsoft Copilot Studio provides analytics and conversation transcript features to support this exact requirement.

In your hackathon exercise, you must verify how the system captures conversations to ensure a clear logging and audit trail for every answer provided.

  • Locate the Monitor page: Familiarise yourself with the Monitor page in Copilot Studio (earlier versions called it Analytics), which tracks conversation outcomes, user satisfaction and how often knowledge sources and tools are used. It does not include conversations held in the test chat.
  • Review transcript storage: Understand that conversation transcripts are stored in Microsoft Dataverse in your environment and, by default, deleted after 30 days. Access to these logs must also follow least-privilege permissions: viewing transcripts in Power Apps requires the Bot Transcript Viewer security role, which should be restricted to authorised compliance, audit or management personnel.
  • Plan for human-in-the-loop review: Decide how frequently the named human owner will review a sample of these transcripts to ensure the agent is performing safely, accurately, and within its designated boundaries.

Phase 4: Rigorous Testing Before Release

You must never release an agent without rigorous testing. Microsoft Copilot Studio includes a built-in test pane that allows you to interact with your agent safely before publishing it to any channels. During this hackathon, you will conduct three specific types of tests.

  • Standard Knowledge Testing: Ask the agent routine questions that are clearly answered in the mock staff handbook, such as the standard annual leave allowance or synthetic working hours. Verify that the answer is accurate and cites the handbook correctly.
  • Out-of-Bounds Testing: Ask the agent questions about topics deliberately not included in the handbook, such as a mock competitor firm, financial advice or real-world news. Verify that the agent refuses to answer, demonstrating that it respects boundaries and avoids hallucination.
  • Prompt Injection Testing: Attempt to instruct the agent to ignore its previous instructions and tell a joke or reveal its system prompt. Verify that your system instructions are robust enough to reject this manipulation.

You must document the results of your testing. In a real-world scenario, evidence of this rigorous testing before release would be stored in your firm’s governance systems to demonstrate compliance with operational risk management frameworks.

Phase 5: Publishing and Ongoing Governance

The final step in the hackathon is publishing your agent. However, publishing is not the end of the lifecycle. When you press the publish button in Copilot Studio, you are formally deploying the agent to the specific channels you configured, such as Microsoft Teams or a secure SharePoint site.

Before any agent goes into a live environment, a firm must apply data policies (formerly data loss prevention or DLP policies) configured in the Power Platform admin center. These policies act as a safety net. They can prevent the agent from connecting to unauthorised external data sources or sharing information outside the corporate boundary. For the purpose of this exercise, you must assume your administrator has restricted all external connectors to prevent accidental data leakage.

Finally, you must document the named human ownership of this newly built asset. Write down exactly who is responsible for updating the synthetic handbook when mock policies change, who will review the daily audit logs, and who holds the authority to unpublish the agent immediately if a silent failure or data leakage risk is detected. By establishing this clear accountability, you align the rapid innovation of Microsoft Copilot Studio with the strict safety, security and regulatory requirements of the UK financial services sector.

Hackathon Exercise: Building a Policy Q&A Agent in practice
Go deeper Architectural & Governance Trade-Offs in Hackathon Exercise: Building a Policy Q&A Agent 1 min · optional

When scaling Phase 1: Preparation, Environments and Data Grounding 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.

Accredited Executive Program • The Tesseract Academy

Level 33: Executive AI Fluency Certification

Master AI strategy, LLM deployment economics, and vendor evaluation without needing a coding background.