> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openlayer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Microsoft 365 Copilot

> Import Microsoft 365 Copilot prompts and responses into Openlayer from Microsoft Graph interaction export

Openlayer connects to Microsoft Graph's
[Copilot interaction export API](https://learn.microsoft.com/en-us/microsoft-365/copilot/extensibility/api/ai-services/interaction-export/aiinteractionhistory-getallenterpriseinteractions)
and pulls first-party Microsoft 365 Copilot prompts and responses into your workspace as inference
data.

This is the right integration when the AI you need to evaluate is Microsoft 365 Copilot itself —
Chat, the web, Teams, Word, and Excel — rather than a custom agent you built. Each Copilot request
lands in Openlayer, where you can run tests and review real usage.

Custom agents belong on a different connector.
[Microsoft Copilot Studio](/integrations/microsoft-copilot-studio) reads Dataverse
`ConversationTranscript` records with an app consented for Dataverse. This connector is separate: it
uses Microsoft Graph app-only (`https://graph.microsoft.com/.default`) with
`AiEnterpriseInteraction.Read.All`. Microsoft's export API does not return Copilot Studio agent
interactions. Do not share one Entra app between the two connectors. The token audiences and consent
scopes are different, and the wrong app returns the wrong data.

<Info>
  All access is **read-only**. Openlayer reads interaction history and never
  writes to, modifies, or deletes anything in your Microsoft 365 tenant.
</Info>

## How it works

Once connected, Openlayer reads each licensed user's Copilot interaction history and turns the
surfaces you enable into traces.

1. **Seeds known surfaces.** Microsoft 365 Copilot Chat, Copilot Web Chat, Copilot in Teams, Copilot
   in Word, and Copilot in Excel appear under **Surfaces**. Every surface starts **disabled**, so
   nothing is ingested until you opt in.
2. **Leaves other apps off.** Outlook, Loop, and PowerPoint are not covered. An `appClass` Openlayer
   does not recognize yet shows up after a sync and stays **disabled**.
3. **Maps each surface to one project.** Enabling a surface creates an Openlayer project named for
   that surface, or writes into a project and pipeline you already have. Enabled surfaces show the
   Microsoft 365 Copilot icon on the project and appear under configured integrations.
4. **Pulls on a schedule.** Periodic sync brings in new interactions for users who hold the
   Microsoft Copilot with Graph-grounded chat service plan. You can also run a sync immediately, or
   backfill history for the surfaces you have enabled.

***

## Prerequisites

* A Microsoft 365 tenant with users licensed for **Microsoft 365 Copilot**, including the
  **Microsoft Copilot with Graph-grounded chat** service plan. A tenant with no one on that plan
  connects, then imports nothing.
* An **Entra ID** app registration with a client secret, the application permissions below, and
  **admin consent**.
* An Openlayer workspace where you are an **admin**. Connecting, enabling surfaces, and
  disconnecting are admin-only.

### Register the Entra app

Register a dedicated app for this connector. Do not reuse the app you registered for
[Microsoft Copilot Studio](/integrations/microsoft-copilot-studio).

1. In the [Azure portal](https://portal.azure.com), go to **Microsoft Entra ID** → **App
   registrations** → **New registration**.
2. Name the app (for example, `Openlayer Microsoft 365 Copilot`) and register it.
3. Under **Certificates & secrets**, create a **Client secret** and copy its value. You cannot read
   it again later.
4. Under **API permissions** → **Add a permission** → **Microsoft Graph** → **Application
   permissions**, add both permissions in the table below.
5. Select **Grant admin consent** for the tenant.

Note the **Tenant ID** and **Client ID** on the app's **Overview** page, and the client secret you
just created.

| Permission | Type | What Openlayer uses it for |
| - | - | - |
| `AiEnterpriseInteraction.Read.All` | Application | Read Copilot prompts and responses with [`getAllEnterpriseInteractions`](https://learn.microsoft.com/en-us/microsoft-365/copilot/extensibility/api/ai-services/interaction-export/aiinteractionhistory-getallenterpriseinteractions) |
| [`User.Read.All`](https://learn.microsoft.com/en-us/graph/permissions-reference#userreadall) | Application | Find users who hold the Microsoft Copilot with Graph-grounded chat service plan, so each person's history can be read. The tenant-wide interactions endpoint is not used |

Both are application permissions and both require admin consent. A delegated permission is not a
substitute. Openlayer requests a Graph app-only token (`https://graph.microsoft.com/.default`).

<Warning>
  China (21Vianet) is not supported. Connect rejects that cloud. On **Microsoft
  cloud**, choose **Global**, **US Government (L4)**, or **US Government DoD
  (L5)**.
</Warning>

***

## Setup guide

### Step 1: Open the integration

In Openlayer, go to **Settings → Integrations** and open **Microsoft 365 Copilot**.

### Step 2: Connect

Enter **Tenant ID**, **Client ID**, **Client secret**, and **Microsoft cloud**, then click
**Connect**.

Openlayer checks the credentials against Microsoft Graph before storing them. The **Microsoft API
reference** link on the form opens Microsoft's interaction-export docs. On success, the detail page
opens on the connected tenant.

### Step 3: Set the sync schedule

Open the **General** tab.

**Periodic sync** pulls new interactions on the connection's schedule. The interval shown is every
**60 minutes** by default. Openlayer checks for a due sync every 15 minutes, and the interval stays
between 15 minutes and 24 hours. Turn periodic sync off to pause ingestion without disconnecting, or
click **Sync now** to queue a sync immediately.

**Initial sync range** is how far back the first sync reads:

* **Last 7 days** — the default
* **All available data**
* **Custom start date** — a date you pick

The same tab reports **Tenant ID**, **Cloud**, **Last sync**, and **Error** when the last sync
failed.

***

## Surfaces

Connecting registers the known surfaces under **Configure surfaces**. None of them ingest until you
turn one on.

| Surface | What it ingests |
| - | - |
| Microsoft 365 Copilot Chat | Microsoft 365 Copilot Chat (BizChat) |
| Copilot Web Chat | Copilot chat on the web |
| Copilot in Teams | Copilot in Teams, including meeting recaps |
| Copilot in Word | Copilot in Word |
| Copilot in Excel | Copilot in Excel |

Outlook, Loop, and PowerPoint are not in this set. When a sync sees an `appClass` outside it, that
row appears in the table under the raw `appClass` and stays **disabled**.

Turn on a surface's **Enabled** switch and choose where its rows go:

* **Create new project** (the default) — Openlayer creates a project named
  `M365 Copilot - <surface name>` and a pipeline for that surface
* **Map to existing project** — pick an existing project and pipeline instead

| Column | Meaning |
| - | - |
| **Surface** | The Copilot app, with its Microsoft `appClass` under the name |
| **Last sync** | When that surface last finished a sync |
| **Imported records** | How many inference rows have been written for it |
| **Enabled** | Whether this surface is opted in. The switch is the only on/off control |

An enabled row's menu has **View project**, **Backfill**, and **Disable**. Disabling a surface stops
new imports for it and keeps rows already written.

### Backfill

**Backfill** re-reads history for every enabled surface, not only the row you opened it from. Graph
returns every Copilot app in one feed per user, so Openlayer rewinds the connection and reads that
feed again. Rows already stored are skipped. Openlayer dedupes on the Copilot `requestId`, so
running backfill again does not create duplicate records.

The dialog offers:

* **Initial sync range** — re-fetch from the start date on the **General** tab
* **Custom start date** — re-fetch from a date you pick

Then click **Start backfill**.

***

## What lands in Openlayer

Each Copilot `requestId` becomes one inference row, and that `requestId` is the record id. Turns
that share a Copilot `sessionId` share one Openlayer session.

The user id is the person's Entra object id (`from.user.id`). A response with no prompt — a Teams
meeting recap, for example — is attributed to the licensed user whose history was pulled, not to
`anonymous`.

When the interaction has the data, the trace is:

* A root user call named **Microsoft 365 Copilot**
* An optional retriever step named **Referenced content**, from contexts, links, and URL attachments
* A chat completion named for the Copilot app that answered (for example, **Microsoft 365 Chat**)

Latency on that completion is the time from the prompt's `createdDateTime` to the response's.
Microsoft Graph does not return a model name, token counts, or cost, so those fields stay empty.

Referenced content and URLs can appear on the row's context. Metadata keeps identifiers and types
only: not display names, mention text, or file names.

<Note>
  An edit to a prompt or response after that `requestId` is already stored is
  not ingested. The row stays as it was written.
</Note>

***

## Evaluating the ingested data

Once traces are flowing, evaluate Microsoft 365 Copilot usage the same way you evaluate application
traffic:

* [Create tests](/tests/overview) to score response quality, safety, or tone
* Detect [PII](/tests/catalog/contains-p-i-i) or [toxicity](/tests/catalog/toxicity) in prompts and
  replies
* Use [governance frameworks](/governance/overview) to evidence AI-usage controls with real traffic

***

## Disconnecting

On the **General** tab, click **Disconnect Microsoft 365 Copilot** and confirm **Remove Microsoft
365 Copilot**.

Disconnecting stops syncing new interactions. Projects, pipelines, and traces already ingested are
kept. In Entra, remove admin consent or delete the client secret if that app should no longer read
Copilot interaction history.

***

## Troubleshooting

| Symptom | Likely cause | Fix |
| - | - | - |
| Connect fails | The secret is wrong, admin consent is missing, or a Graph permission is missing | Confirm both application permissions and **Grant admin consent**, then connect again. A Copilot Studio Dataverse app does not work here |
| Connect fails and the error mentions China | The cloud is China (21Vianet) | Choose **Global**, **US Government (L4)**, or **US Government DoD (L5)** |
| Sync finishes and every surface stays at zero | No user holds the Microsoft Copilot with Graph-grounded chat service plan | Assign that plan to at least one user, then click **Sync now** |
| Outlook, Loop, or PowerPoint never imports | Those apps are not covered | Expected. A discovered row for them stays disabled. Enable Chat, Web Chat, Teams, Word, or Excel |
| An unknown surface appears and stays off | Sync found an `appClass` outside the seeded set | Expected. Leave it disabled. That app is not covered yet |
| Backfill does not add rows | Those `requestId` values are already stored | Expected. Backfill skips records Openlayer already has |
| An edited prompt never updates the stored row | The `requestId` was already written | Expected. Later edits of a stored request are not re-ingested |
| Model, tokens, and cost are empty | Graph does not return them | Expected. Latency comes from the prompt and response timestamps |
| Copilot Studio agent chats are missing | This API excludes interactions in agents created with Copilot Studio | Use [Microsoft Copilot Studio](/integrations/microsoft-copilot-studio) |
| Nothing new arrives | **Periodic sync** is off, or no surface is enabled | Turn periodic sync on, enable the surfaces you want, or click **Sync now** |
