R146 · Infrastructure for agents at scale › Agent session hosting and control planes

Copilot SDK shared runtime: one process for many sessions, a sandbox only when a shell is needed

Read the original

Authors André Lindenberg

agent-harnesssandboxingagents-at-scaleagent-authvendor

Source: André Lindenberg's LinkedIn post, 2026-11-18. SDK docs: the copilot-sdk README, Choosing a setup path, Multi-tenancy and server deployments and In-process runtime. The SDK is moving from GitHub to Microsoft and is being renamed Microsoft Copilot SDK.

TL;DR

SDK v2 exposes the Copilot CLI's agent engine as a standalone, multi-tenant runtime driven over JSON-RPC. The architectural point is what an agent session costs. A session that only calls your app's own tools does not need its own container. Many such sessions can share one runtime process, each with an explicit tool allowlist, its own identity token and its own state directory. You reach for real isolation (a separate runtime, or a cloud or sandboxed session) only when a session needs a shell or host filesystem.

So a support bot answering "why did my bill go up?" can start in milliseconds, without waiting for a container to be scheduled. That is the post's example.

Three hosting modes

(1) in process (v2 default)      app ──C ABI, in-memory JSON-RPC──► native runtime
                                  fast; NOT a sandbox, no crash isolation
(2) SDK-spawned child process    app ──stdio/TCP──► runtime process
                                  crash isolation, per-client env/args
(3) standalone runtime server    many app instances ──TCP(+token)──► copilot-runtime --server
                                  one multi-tenant runtime, many concurrent sessions

Sessions on the shared server are separated by convention and configuration, not by the kernel:

 session = { sessionId: "user-<id>-<uuid>",
             mode: "empty",                 # no ambient OS tools, no built-in skills
             tools.availableTools: ["custom:lookupOrder", "custom:createTicket"],
             github.token: <per-user token> }
 state  → COPILOT_HOME/session-state/<sessionId>   (or sessionFs → your storage)

What mode: "empty" buys

The pattern menu

The docs offer three patterns:

PatternUse whenCost
Isolated runtime per userYou need the strongest boundary or separate process credentialsHigher resource cost
Shared runtime, mode: "empty"One runtime serves many users and the app controls tools, auth and IDsNeeds careful allowlists, per-session tokens and ownership checks
HybridHeavy work goes to cloud sessions, light work stays localNeeds routing and policy

The post's "move it into a sandbox once it needs a shell" is the hybrid pattern. The app decides when to escalate. The runtime does not detect that a session needs a shell and move it for you.

Tradeoffs and failure modes

Review checklist for a shared agent runtime

Cited in field guides

Connections

See R146 on the knowledge map

Part of the Research notes on nowucca.com. Figures and claims are the source's own unless the summary says otherwise.