Tools exposes Microsoft 365 Copilot through two entry points:
/admin/copilot for administration, Microsoft account connection and direct testing.POST /api/ai/copilot/respond for external API clients.Both paths call Microsoft 365 Copilot directly through Microsoft Graph. Copilot does not use OpenAI Engine and has no OpenAI fallback.
Microsoft 365 Copilot Chat requires delegated authentication with a work or school account. Application-only authentication and personal Microsoft accounts are not supported for Copilot Chat.
The environment-backed Copilot setup uses the Copilot Microsoft application profile and the same configured tenant as the licensed Copilot resource tenant. Other Microsoft integrations can continue to use their own Microsoft profile independently.
The supported sign-in sequence is:
/admin/copilot when tenant-wide consent is required.Tools does not use Microsoft device-code authentication for this web-app flow. A tenant may intentionally block device-code authentication through Conditional Access even when the account credentials are valid.
On /admin/copilot, an administrator can:
The direct test creates a conversation through POST /beta/copilot/conversations and sends the prompt through POST /beta/copilot/conversations/{conversationId}/chat. A test succeeds only when Microsoft returns an actual Copilot response.
The reconnect flow requests the OAuth helper scopes offline_access, openid, profile and User.Read, together with these Copilot permissions:
Sites.Read.AllMail.ReadPeople.Read.AllOnlineMeetingTranscript.Read.AllChat.ReadChannelMessage.Read.AllExternalItem.Read.AllSome permissions require administrator approval. If any required Graph permission is missing, Tools stops the Copilot request and asks for consent/reconnect instead of falling back to another AI provider.
Tools validates that:
A Microsoft 365 Copilot entitlement is also required for the signed-in user.
A successful password/sign-in followed by an access-denied page does not prove that the Copilot credentials are wrong. The tenant can reject the authentication or authorization because of Conditional Access, application assignment, consent policy or another Entra access rule.
Use the normal browser reconnect from /admin/copilot, not device-code authentication. If Microsoft still denies access, inspect the Microsoft Entra sign-in event for the failed attempt and use its error/AADSTS code to identify the exact policy or permission that blocked the request. If administrator consent has not been granted for the required Graph permissions, run Grant tenant admin consent + reconnect first.
External clients use:
POST /api/ai/copilot/respond
The client authenticates to Tools with a bearer token that has the ai.copilot scope. Tools resolves that token to a Tools user and uses the user's delegated Microsoft 365 Copilot connection.
Example:
curl -X POST "https://tools.example.test/api/ai/copilot/respond" \
-H "Authorization: Bearer YOUR_TOOLS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"user_prompt": "Summarize this issue in three bullets.",
"response_language": "en",
"use_web_search": false
}'
At least one of context and user_prompt is required. Supported request fields include context, user_prompt, modifier, previous_reply, mood, custom_mood, instructions, custom_instruction, response_language, use_web_search, web_search_required and an administrator-only connector_slug override.
Microsoft 365 Copilot controls model selection. OpenAI model names, reasoning effort, temperature and OpenAI token limits do not control this connector.
A successful response includes ok: true, the Microsoft 365 Copilot response text, connector metadata and diagnostics identifying Microsoft Graph/Microsoft 365 Copilot as the upstream provider.
Copilot changes are not considered live-verified by application credentials alone. The live CI gate must receive a real answer from Microsoft 365 Copilot.
The preferred live test calls the deployed Tools Copilot API with a protected bearer token whose Tools user has already completed browser OAuth with the licensed Microsoft account. A pre-seeded delegated Microsoft refresh token issued by the same browser authorization-code flow can be used as a direct Graph fallback.
The live gate does not bootstrap with device code. It fails when no delegated live identity is configured, when tenant/client/scope validation fails, or when Microsoft returns no usable Copilot answer. Authentication tokens and secrets are never printed.
401: the Tools user could not be identified.403: Copilot access, tenant validation or required Microsoft Graph permission is missing.409: the Microsoft account is missing or needs reconnecting.422: the prompt or connector request is invalid.502: Microsoft Graph returned an unusable response or could not be reached.Copilot request operations are audit logged separately from the normal application log. OAuth operations record safe action/result and diagnostic identifiers without storing OAuth state, authorization codes, access tokens, refresh tokens or client secrets.