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
Explicit tools. In empty mode no host tools are exposed unless the app registers or allows them. In
coding-agentmode the CLI's first-party tools are ambient, and the host filesystem is shared through the runtime process. The docs say never to use coding-agent mode on a shared server.Explicit skills. Built-in skills are excluded by default and allowed one by one. The app can opt into its own skill directories.
Per-session identity. A GitHub token, or a rotating token provider, is set per session, so quota, model routing and content exclusion follow the requesting user.
Per-session state. State lives under a session-ID directory, or goes through a
sessionFsprovider into your storage. Agent memories can go to your store through astoreMemorycallback. When you do that, recall becomes your job too.
The pattern menu
The docs offer three patterns:
| Pattern | Use when | Cost |
|---|---|---|
| Isolated runtime per user | You need the strongest boundary or separate process credentials | Higher resource cost |
Shared runtime, mode: "empty" | One runtime serves many users and the app controls tools, auth and IDs | Needs careful allowlists, per-session tokens and ownership checks |
| Hybrid | Heavy work goes to cloud sessions, light work stays local | Needs 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
The tool allowlist is the whole isolation story. A shared runtime with a broad pattern such as
builtin:*, or one shell tool, gives every session the runtime process's host access. The docs state that the host filesystem is shared by the runtime process whenever host tools are available.Session IDs are a capability. Because sessions are addressed by ID, a client-supplied ID that the backend doesn't check against ownership lets one user resume another's session. The docs list this as a common pitfall.
Remembered permission grants can leak. Grants stored through
sessionFsare shared by any sessions that use the same provider namespace. Give each tenant or session its own namespace, or a "yes, always" from one user becomes everyone's grant.Shell bypasses
sessionFs. Shell tools do not run through the session filesystem. Its protection of approval metadata is defense in depth, not a boundary. If a shell can reach the backing storage, the shell can rewrite approvals.In-process is not a sandbox. The v2 default loads native code into your process, so a runtime crash kills your app. Pick a spawned process when crash isolation matters.
Noisy neighbours. One runtime serving many sessions shares CPU, memory and model-call concurrency. The docs push idle timeouts (15 to 30 minutes for chat) and explicit deletion. You still need per-tenant rate limits on top.
Escalation is app code. Deciding when a conversation needs a shell, then moving it to a sandbox with its state, is your routing logic. Done badly, it either over-provisions or lets a shell request run in the shared runtime.
Review checklist for a shared agent runtime
Is every client in
mode: "empty"? Is coding-agent mode impossible in production config?Are tool allowlists source-qualified (
custom:*,mcp:<name>) and reviewed per tool, with nobuiltin:*?Does the backend own session IDs and check ownership before resume, delete or any UI action?
Does each session carry its own user token, ideally from a rotating provider, never a shared service token by accident?
Does each tenant or session have its own
sessionFsnamespace, so permission grants don't spread?Is there a written rule for when a session escalates to an isolated runtime or sandbox, and a test that a shell request in the shared pool is refused?
Are idle timeouts, per-tenant concurrency limits and explicit cleanup set?
For in-process hosting, have you accepted that a runtime crash takes the app down?
Related entries
R093 kagent 1.0: one sandbox per conversation. This is the opposite default, isolation first.
R122 Agent Substrate: suspend idle agents and resume them on a warm pool, another way to avoid cold starts.
R030 OpenShell: kernel-enforced sandboxes for when the shell path is taken.
R061 Pydantic Agent Sandboxes: an interpreter instead of a VM for agent code.
R074 Omnigraph 0.15: hiding an agent's write tools is not the same as denying them, which applies directly to allowlists.
R071 A gateway as the control point for agent tool access.
R054 Harness engineering: harnesses shipping as SDKs and hostable backends.