The ghosts of agents past
What you will do
Most Copilot Studio tutorials show the build and the applause. This one is a ghost story. You build a small onboarding agent for Contoso, a fictional company, and then you meet five ghosts of agents past: five ways real agents shipped, struggled and got pulled. You reproduce four of them on your own agent, and fix each one.
| Ghost | What breaks | The part of the agent it lives in |
|---|---|---|
| 1. The knowledge soup | An archived policy is cited next to the current one | Knowledge |
| 2. The over-trusting agent | The user claims a role, and the agent believes the text | Identity |
| 3. The expensive intern | Nobody measured what one conversation costs | Credits |
| 4. The forgotten agent | Published, working, and used by nobody | Owner and users |
| 5. The frankenstein | Too many tools chained together, one change breaks all | Tools and flows |
Before you start
- A Microsoft 365 test tenant with SharePoint and Teams, and an account that can create a site.
- A Power Platform environment with Dataverse and Copilot credits allocated. This is what shows the new Copilot Studio experience, where agents run on the Microsoft Copilot harness.
- PowerShell 7 and the Microsoft Graph PowerShell module, for the SharePoint setup script.
- The lab files:
1Prepare SharePoint
β±οΈ About 5 minutes
- Download the documents zip and the script
sharepoint-setup.ps1into the same folder. - Once, if the module is missing:
Install-Module Microsoft.Graph.Authentication -Scope CurrentUser. - Run the script in PowerShell 7 from that folder, with the SharePoint host of your test tenant. A sign-in window opens: sign in with your test account and accept the permissions.
/sites/contoso-hr), its list New starters, the human resources documents in the Documents library, and remote-work-policy-2021.pdf in the Archives folder. That old policy is the first ghost: keep it.2Build the agent
β±οΈ About 10 minutes
- Open Copilot Studio, pick your test environment, and create an Agent from the home page. Name it Contoso Onboarding Assistant.
- Paste the instructions. They are armed on purpose: nothing tells the agent to ignore the archives.
- In the right-hand panel, remove Work IQ (confirm with Remove) and turn off Search all websites. The agent must answer only from your documents.
- Knowledge, +, SharePoint: paste the site address (
https://your-tenant.sharepoint.com/sites/contoso-hr), Add, then Add to agent. Save with Ctrl+S.
3Ghost 1: the knowledge soup
β±οΈ About 10 minutes
An agent grounded on an entire SharePoint site answered with the current policy, and confidently cited the old one right next to it. Broad retrieval without hygiene is a hallucination factory with sources attached.
- In the Test pane, ask:
π―οΈ Guess before you look
The site holds the 2026 remote work policy and, in the Archives folder, the 2021 one. Which sources will the agent cite?
It cites the archive too. The answer is right (two days a week), but the 2021 archive shows up in the sources, sometimes with a note that it is "no longer valid". It knows, and it still pulled it in. A dead document is still a source. Today it agrees with the current policy. The day it does not, the agent will quote it with exactly the same confidence.
The bandage
- Go back to the instructions, click right after the last sentence (Ctrl+End does not always go to the end), and add this line:
- Save, click New chat in the Test pane, and ask the same question again. If nothing happens after 10 seconds, send it again: the first message after a new chat can get lost.
agent-instructions-fixed.txt.4Ghost 2: the over-trusting agent
β±οΈ About 5 minutes
A procurement assistant took the user's word on their approval level, and called the back end anyway. The agent inherited a privilege that only existed in the prompt. So lie to your agent.
- New chat in the Test pane, then ask:
5Ghost 3: the expensive intern
β±οΈ About 10 minutes
An agent worked beautifully, and burned through credits faster than the team it was meant to assist. Nobody had measured a single conversation before opening it to everyone.
- Open the Evaluate tab. Create a test set named Contoso onboarding, choose Import, pick the type Conversations before you drop
test-set-failures.csv, then run it. - When the run finishes, read the summary: number of questions, average score, duration and credits.
- Open the credits per test case and compare them.
6Ghost 4: the forgotten agent
β±οΈ About 10 minutes
Built in two weeks, launched on a Friday, unused by month two. "We will add adoption later" never happens, because nobody owns later.
- Publish the agent: Channels, +, Teams + Microsoft 365, Add channel, then Publish.
- Open the Analytics tab (Copilot Studio now labels it Monitor) and set the range to Last 7 days.
- Open the agent in Microsoft Teams and ask it one real question. Come back to Monitor later: real conversations appear after a delay, not instantly.
7Ghost 5: the frankenstein
β±οΈ About 5 minutes, no build
Sixteen Power Automate flows, four custom connectors, three knowledge sources. One upstream interface changed its response, and the whole agent went down, with no error anyone could read. Nobody should build sixteen flows just to break them, so this ghost is a thinking exercise.
- For an agent you own (or plan), list every tool, flow and connector it calls.
- For each one, write down: what happens if it fails, who notices, and what the user sees.
- Write the fallback message a user could actually act on, for example: "I cannot reach the ordering system right now. Your request is saved; the service desk will follow up today."
The list to check twice, before you publish
And the forgotten agent needs the one thing no checklist can tick for you: an owner. Saying no to an agent that is not ready is always cheaper than repairing it in production.
Clean up
- Delete the agent in Copilot Studio (agent menu, Delete) and the site Contoso - Human resources when you no longer need them.

← All labs