Copilot SDK 2.0: choose shared or isolated agents
Developer Tools

Copilot SDK 2.0: choose shared or isolated agents

Copilot SDK 2.0 lets developers choose shared or isolated execution to balance fast, low-overhead sessions with workload isolation.

Key insights

  • A shared runtime reduces per-session overhead and can improve time to first token.
  • Shared sessions do not have sandbox files or artifacts by default.
  • Enabling unsafe host tools lets shared agents run code on the host, creating cross-user exposure risks.
  • Isolated environments place each session in its own container in the demonstrated local setup.
  • The managed-copilot-sdk sample changes where agents run without substantially changing session code.

Microsoft Copilot SDK 2.0 adds multi-tenant runtime options that let developers choose between shared agent sessions and isolated execution. This matters to developers moving an agent prototype into an application where users need to process files or run code without exposing one another’s work. Microsoft Events demonstrates the architectural tradeoffs with a staff-assistant example.

What's new

The Copilot SDK is the programmatic interface to the Microsoft Copilot runtime and harness. The runtime runs agent experiences; the harness is its default configuration, including elements such as planning, built-in tools, agents, skills, instructions, and memory. Developers can configure or extend that setup, or replace the default harness.

The significant change highlighted in version 2.0 is multi-tenant support. Instead of treating isolated containers as the only execution pattern, the runtime can also serve multiple sessions in a shared process. Developers can decide where a sandbox is needed, rather than applying the same isolation model to every workload.

That choice affects cost, startup behavior, and what an agent can safely do. A shared runtime can reduce per-session overhead and provide fast time to first token, but it does not give sessions their own sandbox files or artifacts. An isolated environment supplies a boundary for tasks that need to work with files or execute code.

Who it is for and what you need

This architecture is aimed at developers building agent applications and deciding how those agents should run as usage grows. The session’s example is a staff assistant for employees, with requests involving business information, spreadsheets, and code execution. Those requirements make the difference between a simple shared chat and an isolated workload concrete.

The demonstration uses the open-source sample as a reference implementation for running agents locally or in the cloud and changing their execution location. It is presented as a sample to learn from, rather than a required part of the Copilot SDK. The same general session code can be used while changing how the runtime starts and where it runs.

The example starts locally and uses containers for isolation. The speakers also describe cloud isolation options, including ACA Sandbox, but the deployment choice depends on the environment and workload. The session does not frame every agent as needing a container: the question is whether that task needs a shell, files, or a stronger execution boundary.

How it works

The example begins with a shared environment for staff sessions. This is optimized for speed and cost, with many sessions using one runtime. A user can ask questions against business data, but a file-processing request fails because the shared environment has no sandbox files or artifacts.

  1. Start with the workload: decide whether the agent needs a shell, files, or other sandbox capabilities from the start.
  2. For sessions that do not need those capabilities, use a shared runtime to avoid the overhead of a separate environment for every session.
  3. Do not enable as a shortcut for file or code access in a shared environment. In the demonstration, that setting lets agents run commands on the host and access files belonging to other sessions.
  4. For tasks that need code execution or file handling, move the environment to an isolated option. In the local example, each new session creates its own sandbox container.

The sample keeps the familiar pattern of creating a , creating a session, selecting a model, and sending prompts. The main adjustment is how the environment is configured and started. That makes it possible to consider a different execution boundary without rewriting the interaction with the agent.

Limitations and alternatives

A shared process is not equivalent to a per-user container. In the demonstration, sessions in a shared environment lack sandbox files and artifacts, and enabling unsafe host tools exposes the host’s files and commands. The example shows how that can reveal another user’s session data, so it is not a safe substitute for isolation when agents need arbitrary code execution.

Isolated execution brings a different operational choice: the example creates a container per session, while the shared model avoids that per-session environment. Teams should decide based on the actual work agents perform, including whether users upload files or require shell commands. Applying isolation selectively is the central design tradeoff; the session does not suggest that one pattern fits every task.

The demonstration establishes shared and isolated patterns and introduces task-specific workers and dynamic orchestration as part of the broader journey. The practical starting point is to identify the boundary each task needs, then choose a runtime arrangement accordingly. Keep the security decision separate from convenience settings: host access can make a prototype appear functional while exposing other users’ data.

Sources

Frequently asked questions

What is the difference between shared and isolated Copilot SDK sessions?

Shared sessions use one runtime, reducing per-session overhead, but do not have sandbox files or artifacts. An isolated session runs in its own environment, such as the container used in the local demonstration.

Can a shared Copilot SDK agent process files?

The shared environment in the demonstration cannot receive sandbox files or artifacts. Enabling unsafe host tools allows file and code operations on the host, but can expose other users’ data.

Does using the managed-copilot-sdk sample require rewriting session code?

The sample keeps the familiar client and session interaction. The main change is how the environment is started and where the agent runs.