How to ground a Copilot Studio agent in your own documents

Day 2, 25 minutes · beginner

Goal of this lessonUpload a rules document as knowledge, switch off ungrounded answers and web search, and check the agent answers from your file with a citation.

Why it matters

Today you write a short practice rulebook for Tidewater Bike Hire, give it to the agent and limit the agent to it. At the end your agent answers rules questions from your file, shows where the answer came from and admits when the file has no answer.

Yesterday your agent answered a rules question without having any rules. That is the biggest risk of a team agent: a confident answer that is not your policy. A new colleague cannot tell the difference, and a customer pays the wrong deposit.

The fix is knowledge. A knowledge source is a document, website or other data that the agent searches before it answers. When the answer comes from your document, the agent can show a citation: a reference to the source, so the reader can check it. Then you switch off the agent's habit of answering from general knowledge.

Two settings that matter

  • Allow ungrounded responses sits in the Generative AI part of the agent's Settings page. Turned on, the agent may answer from the model's general knowledge without using any knowledge source or tool. Turned off, a reply from a turn where the agent used no knowledge source or tool is blocked, and the agent's fallback topic runs instead.
  • Web Search sits in the Knowledge section of the Overview page (the Settings page calls the same switch "Use information from the web"). Turned on, the agent can also search all public websites indexed by Bing. For a rules agent you want it off.

Both settings need generative orchestration: the way an agent picks its own tools and knowledge for each question. New agents use it by default.

The honest limit

Microsoft says it plainly: turning off ungrounded responses does not guarantee that the agent never uses general knowledge. The model can still mix general knowledge into an answer it built from your file. The setting only blocks replies where no knowledge source or tool was used at all in that turn.

Two side effects to expect:

  • A follow-up question can be blocked. If the agent answers "does that apply to e-bikes too?" from the conversation instead of searching again, the reply is blocked. That is why every test below starts with a new test session.
  • A correct answer can be withheld now and then. With ungrounded responses off, the agent only returns an answer from a knowledge source when it includes an in-text citation. Models do not always add one, so the same question may work the second time.

Microsoft's pages differ on what to do about the second point. The knowledge settings page suggests an instruction such as "Always include an in-text citation to the source document for every statement". The instructions page warns against instructions that change how citations are made. Start without such an instruction, and add it only if answers keep being withheld.

The steps

  1. Write the rulebook: six numbered rules in a Word or plain text file. Use the text in the guide or your own team's rules, without anything confidential.
  2. Upload it as knowledge, with a clear description. The orchestrator reads the description to decide when to search the file.
  3. Turn off ungrounded responses and web search.
  4. Test with two questions in two new sessions: one the file answers, one it does not.

A public website can also be a knowledge source: the address may be at most two levels deep, the site must be indexed by Bing, and sites that need a sign-in (such as SharePoint) do not work this way. Tidewater is made up, so you skip it today.

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

What to avoid

  • Uploading files with a sensitivity label or password. Encrypted files are not supported.
  • Editing the file on your computer and expecting the agent to notice. An uploaded file is a copy. Lesson 5 shows how to swap it.
  • Testing in one long conversation. Start a new test session for each question.

Example: Pippa tests the gap

Pippa asked "A customer is 45 minutes late, what do we charge?". The agent answered 10 euros and pointed to rule 3 in the file. Then, in a new session, she asked "Do we hire out child seats?". The agent said it could not find that. Dorian wrote "child seats" on his list of rules to add.

Deeper dive

Today's actions

Ticks are not saved without an account

Do it in Microsoft Copilot Studio

Microsoft Copilot Studio

  1. Create a new file with this text in Word or a plain text editor and save it as tidewater-hire-rules (.docx or .txt).
    Tidewater Bike Hire: hire rules (version 1)
    
    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 30 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.
  2. Open your agent. On the Overview page, select Add knowledge and drag the file in or browse to it.
  3. Keep the file name as the name, paste this description and select Add to agent.
    The hire rules of Tidewater Bike Hire: hire day, deposits, late returns, damage, repair costs and returning a bike to another branch.
  4. Select Settings at the top. In the Generative AI section, find the Knowledge part, turn off Allow ungrounded responses and save.
  5. Go back to the Overview page. In the Knowledge section, turn off Web Search.
  6. Select the Start new test session icon in the test panel and ask a question the file answers. Check that the answer matches rule 3 and shows a citation.
    A customer is 45 minutes late. What do we charge?
  7. Start a new test session again and ask a question the file does not answer. The agent should not invent a rule.
    Do we hire out child seats?

Note: If you cannot add the file, your environment may not have Dataverse search turned on: uploaded files need it, so ask your admin. If a correct answer is withheld, ask the same question again in a new session; this can happen when the model leaves out the citation.

Works on the free Copilot Studio trial with a work or school account. The trial cannot publish.

Checked on 4 December 2026 · Source: Microsoft Learn: Configure knowledge source settings (opens in a new tab)

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