All articles
ArticlesNovember 18, 20267 min read

Microsoft Copilot SDK 2.0: one runtime, many agent sessions

Microsoft Copilot SDK 2.0 runs many isolated agent sessions in one Rust runtime with per-user identity. What changed, the trade-offs, and what to check first.

microsoft copilot sdkcopilot sdk 2.0github copilotai agentsmulti-tenant architectureagent runtimeai securityrust
Microsoft Copilot SDK 2.0: one runtime, many agent sessions

Microsoft Copilot SDK 2.0 was announced at Ignite on November 17, 2026, and it changes how you host agents more than how you write them. The runtime was rebuilt in Rust, one process can now hold many isolated sessions, and each session can act as the user who started it instead of as your server. The SDK is also renamed: what used to be the GitHub Copilot SDK is now the Microsoft Copilot SDK.

I build agent features into products for clients, including an AI agents plugin for erxes CRM, and the hard part is never the model call. It is where the agent runs, whose credentials it uses, and what it costs when a thousand users open a chat at once. Version 2.0 is aimed right at that, so here is what changed and what I would check before moving to it.

What changed in Microsoft Copilot SDK 2.0

According to the announcement post by Patrick Nikoletich and Steve Sanderson, the old design had one assumption baked in: the runtime owns the machine it runs on. So every session got a container, the first turn waited on infrastructure, cost grew with the session count, and the session had the identity of the process running it.

Version 2.0 drops that assumption. The changes that matter:

  • One runtime, many sessions. Each session has its own state, credentials, tools, files and history, and no session can see another. Creating one doesn't start a container, a process or a VM.
  • A Rust core. On the same warmed workload, creating a client and a session and completing one turn went from 5.25 seconds on the TypeScript CLI to 55.3 milliseconds with the Rust core in-process. Ten clients use 126 MB of memory instead of 1,383 MB, and throughput went from 7.55 to 120 sessions per second. These are Microsoft's numbers, not mine.
  • In-process by default. The runtime exposes a C ABI, so the same agent code runs in your process, as a child process or against a shared service.

The v2.0.0 release went out on GitHub the same day, after two previews earlier that day.

Per-session identity and host-owned tools

This is the part I care about most as a security engineer.

Before 2.0, the runtime acted as whoever started it. In a web app that usually meant your server's identity, so every model call and tool call looked like it came from your backend. Now you pass the user's credential when you create the session, and calls are attributed to that user:

const session = await client.createSession({
  gitHubToken: user.githubToken, // or gitHubTokenProvider for short-lived, rotating tokens
});

There is also a gitHubTokenProvider callback, so the runtime can ask for a fresh token per session as tokens expire. Use it. Long-lived tokens sitting in a shared runtime are the thing you least want to leak.

The other half is mode: "empty". A session in empty mode starts with no host shell, no host file system and no default tools. You add back only what it needs, and the tools you register run in your process against your data:

const session = await client.createSession({
  gitHubToken: user.githubToken,
  mode: "empty",
  tools: [lookupOrder],
  availableTools: ["custom:lookup_order"], // an explicit allow-list per session
});

Deny by default, allow by name. I argued for the same pattern in securing AI agents, and I'm glad it's the default here.

One caveat. With no container, isolation between sessions is enforced by the application, not by a container boundary, and Microsoft says so in the post. So the bug that matters most moves into your own tool handlers. If lookup_order forgets to scope its query to the signed-in user, the runtime's isolation won't save you. Every tool handler needs the user or tenant check inside it, not just in the route that created the session.

Durable sessions and sessionFs

Sessions now outlive the process. The runtime writes messages, tool calls, results, plans and checkpoints to a session journal. Any runtime that can read that journal can resume the session, whether that's the same process after a restart or a different machine.

Where the journal lives is up to you through sessionFs. You can point it at object storage, a database or tenant-scoped paths, and resume later by ID:

const session = await client.resumeSession("user-123-task-456", {
  createSessionFsProvider: (s) => tenantStorage(user.tenantId, s.sessionId),
});

The post says to resume only after you've checked that the caller owns the session. That check is yours to write, and the journal holds full conversation history plus tool results, so treat it like customer data: encrypt it, set retention, and keep it in per-tenant storage.

It also makes some product patterns cheap. A web client can disconnect while a long task keeps running. A teammate can attach Copilot CLI to the same session to look at it or steer it. A webhook can pick a conversation back up hours later.

Six architectures on one runtime

The post walks through six ways to deploy, built from two decisions: where the agent thinks (the model loop) and where it acts (shell and files). The ones I would actually use:

Shared runtime, no sandbox

Many sessions in one process, tools are your APIs or MCP servers. Good for support assistants and CRM copilots. Not enough for coding agents.

Start shared, promote when needed

Every session starts on the shared runtime and moves into its own sandbox only when the work needs a shell or files. Same session ID and history after the move. The cost is one wait while the sandbox starts, and the move is one-way. For most SaaS products this is the one I would start with, because most conversations never need a shell.

Shared loop, sandboxed commands

The loop stays shared, and bash, view and edit become host tools that run each command in a sandbox. Changing commands need approval. Fits code interpreters.

Coordinator and workers

A coordinator session starts worker agents, each in its own sandbox, and waits without spending model calls. Real parallelism, but you pay for an agent and a container per worker, and workers don't share a disk. This is the software factory shape, close to the background agents and subagents I looked at in OpenCode 2.0.

Microsoft's rule of thumb fits in one question: does every session need a shell and files from turn one? If yes, use an isolated container per session. If not, run the loop on the shared runtime and add sandboxes only where needed.

What I would check before upgrading

  1. Read the release notes. v2.0.0 includes runtime changes such as PAC-aware proxy routing and adding the IPv6 unspecified address to the outbound request blocklist. Test against your own proxy and network setup.
  2. Package names are moving. The rename notice says the repo moves to the Microsoft org in phases, and some names and docs may still say GitHub Copilot SDK for a while. The README now lists @microsoft/copilot-sdk on npm and microsoft-copilot-sdk on PyPI. Pin versions and check imports.
  3. Audit every tool handler for tenant scoping before you switch to a shared runtime. This is the biggest new risk.
  4. Decide where journals live and who can resume a session, before the first production session writes one.
  5. Benchmark your own workload. The 55.3 ms number is a warmed turn on Microsoft's hardware. Your cold starts, tool latency and model latency will differ.

If you don't want to run this yourself, Microsoft points to two managed options: GitHub Copilot cloud sandboxes and Microsoft Foundry managed agents.

My take: the shared runtime with promotion is the right default for most agent products, and the per-session identity is overdue. I will try the shared runtime with mode: "empty" on a CRM-style assistant first and keep container-per-session only for coding work.

FAQ

Is Microsoft Copilot SDK the same as GitHub Copilot SDK?

Yes. GitHub announced on October 28, 2026 that the GitHub Copilot SDK is becoming the Microsoft Copilot SDK. Version 2.0 is the first major release under the new name. Existing users don't need to change anything right away.

Which languages does Copilot SDK 2.0 support?

TypeScript, Python, Go, .NET, Java and Rust. The repository is MIT licensed.

Do I still need a container per agent session?

No. That's the main change in 2.0. Sessions can share one runtime process, and you add a sandbox only for sessions that need a shell or files. Coding agents and untrusted code still belong in a container.

Is it production-ready?

The project README says the SDK is generally available and follows semantic versioning.


Sources: Microsoft Command Line: Introducing the Microsoft Copilot SDK 2.0, microsoft/copilot-sdk on GitHub, Copilot SDK v2.0.0 release notes, GitHub Changelog: GitHub Copilot SDK is becoming Microsoft Copilot SDK

Cover image: Microsoft, Microsoft Copilot SDK 2.0 announcement header

Related articles