# How do I preserve a Copilot Studio conversation across turns in a custom app?

Exam: AB-400 — Power Platform Developer Associate
Knowledge domain: Extend Microsoft Power Platform (35–40%)
Updated: 2026-11-25T06:47:23.03955+00:00
HTML: https://learningpathx.com/faq/AB-400/ab400-copilot-studio-agent-conversation-state.html

## Also asked as

- How should a client retain Copilot Studio conversation state for one signed-in user?
- How can an application continue an agent conversation without mixing users' context?

Keep the Copilot Studio conversation's continuation state bound to the signed-in user and the configured agent and environment. The .NET Copilot Studio client sample starts the conversation with `StartConversationAsync` and sends input with `AskQuestionAsync`. Choose the client lifetime or explicit state storage so that the next turn uses the same intended conversation. Sharing a stateful client across users can expose one user's context to another.

To initialize app context through the documented web or native integration, wait for the first agent message, then send a custom event and handle it in an `OnEventActivity` topic. Pass only approved values such as a selected device reference or UI language. Track whether the event was handled before making context-dependent requests. Display returned message activities and handle status activity types separately.

Test a follow-up that depends on an earlier message, and repeat the same steps in a fresh second user's session. Verify the second session receives its own context only. On sign-out, clear continuation state and follow the application's retention rules for cached content. Keep any eventual business request ID separate from conversation state.

**Microsoft references**

* [Integrate with Copilot Studio](https://learn.microsoft.com/en-us/microsoft-365/agents-sdk/integrate-with-mcs)
* [Integrate web or native apps with Microsoft 365 Agents SDK - Microsoft Copilot Studio](https://learn.microsoft.com/en-us/microsoft-copilot-studio/publication-integrate-web-or-native-app-m365-agents-sdk)
* [Agents/samples/dotnet/copilotstudio-client at main · microsoft/Agents · GitHub](https://github.com/microsoft/Agents/tree/main/samples/dotnet/copilotstudio-client)
* [Microsoft 365 Agents SDK .NET Copilot Studio conversation sample](https://raw.githubusercontent.com/microsoft/Agents/main/samples/dotnet/copilotstudio-client/ChatConsoleService.cs)

Source: [AB-400: Integrating Foundry and Copilot Studio Agents](https://learningpathx.com/news/ab-400-integrating-foundry-and-copilot-studio-agents.html)
