On this page
VS Code Agent Host: Multiple AI Agents in Dev Containers
tl;dr
VS Code's Agent Host moves human review from before-write to after-write, so Dev Containers isolate agents but don't replace post-hoc diff review. Sessions persist across windows and run unattended through automations, making after-write oversight the primary security control rather than a pre-execution gate.
Microsoft shipped a dedicated process that owns agent sessions independently of editor windows in September 2026, and the implications for how teams run autonomous coding work are still settling. The Agent Host architecture separates session lifecycle from the UI, lets multiple agents run in parallel inside isolated Dev Containers, and persists work after you close your laptop — but it also moves the human review checkpoint from before-write to after-write, which changes the security model in ways most coverage hasn’t emphasized.
What Changed in VS Code 1.137?
Visual Studio Code 1.137 arrived on September 9, 2026, with a follow-up update roughly a week later, and the release notes frame it as the culmination of Microsoft’s Agent Host rollout for AI coding agents. The headline feature is a dedicated Agent Host process that runs harnesses for Copilot, Claude, and Codex outside the main editor process, giving each agent session its own managed runtime that can be spun up, paused, monitored, and torn down independently. That runtime isolation is the kind of plumbing you’d expect from a container orchestrator, not a text editor.
The practical upshot: a developer can kick off a background agent to refactor a module, keep working in the foreground on something else, and check back on the agent’s progress without losing their own editor state. Agent automations — recurring tasks that run hourly, daily, or weekly — shipped as a preview in the same release cycle and are off by default in Stable but enabled for Insiders. You activate them with chat.automations.enabled in the Agents window settings.
How Does the Agent Host Architecture Work?
The Agent Host is a separate process that owns agent sessions: lifecycle, state, permissions, and execution environment. It speaks the Agent Host Protocol (AHP), which reached version 1.0 on October 28, 2026, and is MIT-licensed with client libraries for TypeScript, Rust, Go, Kotlin, and Swift. AHP describes itself as “synchronized multi-client state for AI agent sessions” — clients subscribe to channels, receive a snapshot of current state, then an ordered stream of actions they can replay after reconnecting.
Editor windows don’t talk to the agent directly. They talk to the host over AHP, and the host turns harness events into durable, display-ready state with monotonic sequence numbers so multiple clients rendering the same session converge. The Copilot harness is built on the GitHub Copilot SDK; the Claude harness loads Anthropic’s Claude Agent SDK with an adapter mapping sessions, tools, and permissions into the host’s model. This separation means a session survives its window: close VS Code, reopen it, pick the session up elsewhere, and while the host runs, an active turn continues with no client attached at all.
| Execution Environment | Security Boundary | Persistence Model | Default Harness |
|---|---|---|---|
| Local Agent Host (host machine) | Process isolation + optional MXC sandbox | Session survives window close; host must stay running | Copilot |
| Local Dev Container | Container filesystem, network, credential isolation | Session survives window close; container must stay running | Copilot |
| Remote Dev Container (SSH/Tunnel/WSL) | Container isolation on remote host | Session survives local disconnect; remote host + Agent Host must stay running | Copilot |
| Cloud Agent (GitHub infrastructure) | GitHub-managed sandbox | Session survives everything; no local compute required | Copilot |
The table above captures the four execution models now available. Notice that Copilot is the default harness for new sessions across all of them — a detail that matters for billing, since Claude sessions default to Copilot billing unless three specific opt-out conditions are met.
What Security Boundaries Do Dev Containers Actually Provide?
VS Code 1.138 (released September 16, 2026) added agent sessions in Dev Containers for local folders via the chat.agentHost.devContainer.enabled setting; the agent runs against the project’s Dev Container toolchain and dependencies, and Docker is required. Version 1.139 (September 23, 2026) extended that to projects on SSH, Remote Tunnel, and WSL hosts — the remote machine and its Agent Host must remain running for the session to continue.
Running an agent in a Dev Container narrows the blast radius of agent-executed commands by isolating the agent’s toolchain, filesystem, network, and credentials. But it does not make generated code correct or remove the need for review. VS Code security documentation explicitly warns that agents can produce incorrect code and can encounter prompt injection through files, tool outputs, or web content. The container gives you a stronger boundary around the development environment and its installed tools, which reduces the blast radius compared with an unrestricted host workflow — but environmental consistency is not output correctness.
Local sandboxing for GitHub Copilot has been generally available since October 7, 2026, for Agent Host sessions, powered by Microsoft eXecution Container (MXC) according to GitHub’s changelog. It restricts agent access to filesystem, network, credentials, and GitHub CLI based on developer or organization policy and is included at no additional cost. Model execution and tool isolation are separate concerns: sandbox policies apply to tool execution regardless of which model Copilot uses. You can limit the files and directories agent-run commands can read or modify, control access to the internet, local networks, Git credentials, and GitHub CLI credentials, and apply enterprise-managed settings that developers cannot weaken.
Where Does the Review Checkpoint Live Now?
This is the part that changes your threat model. On the old extension host, an agent’s edits sat in a pending state until you kept or undid them — human judgment happened before anything touched disk. Agent Host sessions work the other way around: edits land straight in the session folder or worktree, and you review the diff afterward, then commit, merge, or discard. The checkpoint still exists. It moved from before-write to after-write.
For a one-line rename, that’s a nothingburger. For a twenty-minute agent turn that ran while you were in a meeting, the tree you come back to is already mutated, and your review is archaeology on a diff instead of a gate in front of one. The VS Code security guidance relies on post-hoc diff review as the primary control, with no documented pre-execution approval gate for autonomous turns. This matters because sessions are engineered to run unattended without any client attached — automations run on hourly, daily, or weekly schedules, and agents continue working while developers are in meetings or have closed their laptops. Anaz’s analysis confirms that Agent Host sessions apply edits directly to the session folder, so human review happens after the mutation rather than as a pre-write gate.
The tension is real: Dev Containers are positioned as security boundaries while agents mutate the working tree before review. Containers reduce blast radius by isolating agent toolchains and sandboxing filesystem, network, and credential access. But Agent Host applies edits directly to the session folder; human review happens after mutation, making oversight archaeology rather than a gate. Teams that treat the container as a substitute for review will find themselves auditing changes that have already landed.
Can You Run Agents Remotely Without Losing Control?
Yes, and the architecture supports three remote patterns. You can run the Agent Host on a separate machine while using your primary development machine for other work — VS Code’s Remote SSH and dev tunnels extend to the Agents window, and the remote agent works with the same code, tools, and dependencies. The remote machine and its Agent Host must remain running. You can also start a cloud agent session from the Agents window in VS Code; the work runs on GitHub’s infrastructure, so closing your laptop doesn’t stop it. And you can control agents on your machine from your phone via GitHub Mobile — your phone provides the controls, and the agent does the work on your development machine. Setup requires running code agent host --github-environment from the project folder and leaving the computer and Agent Host running.
The Agent Host Protocol being open and agent-agnostic means you’re not locked into Microsoft’s clients. Custom applications can connect to VS Code agent sessions using the TypeScript, Rust, Go, Kotlin, or Swift client libraries. But default settings route users into Microsoft’s commercial ecosystem: Copilot is the default harness for new sessions, and the Copilot harness became the default for new sessions in both the editor and the Agents window as of VS Code 1.143. Local remains available for editor workflows and integration migration, but the default path is the commercial one.
What Should Teams Do Differently?
The editor window is legacy; VS Code’s real product is the Agent Host, and every feature should be designed for headless, persistent sessions first with the editor as just one possible client. That shift demands new habits:
Treat session isolation as a boundary, not a guarantee. Dev Containers and MXC sandboxes limit what an agent can reach, but they don’t validate what an agent produces. Pair environmental isolation with mandatory post-write review gates — automated diff analysis, policy checks, and human sign-off before merge.
Make automations auditable by default. Since automations run on schedules without a human watching, configure them to emit structured logs, require approval for destructive actions, and surface diffs in a review queue rather than landing silently. The chat.automations.enabled setting is off by default in Stable for a reason — enable it deliberately, not reflexively.
Choose your harness intentionally. The default Copilot harness shares a runtime with other Copilot products and bills through your Copilot subscription. If you want Anthropic billing for Claude sessions, you need to satisfy three specific opt-out conditions. Codex sessions can switch between Copilot and ChatGPT subscriptions without losing conversation context. Know which contract you’re on before you start a long-running session.
Plan for host persistence. Local sessions require the host machine to stay awake. Remote sessions require the remote machine and its Agent Host to stay running. Match the execution model to your team’s uptime reality — don’t run a weekly automation on a laptop that sleeps at night.
The Agent Host architecture solves a real coordination problem: multiple agents, multiple projects, multiple devices, one synchronized view. But it also removes the last implicit gate between autonomous mutation and human oversight. The container is not the review. The diff is not the gate. The review is the review — and it now happens after the fact.
What’s your team’s plan for after-write review at machine speed?
Recommended Reading
-
Control VS Code AI Agents via Phone: Agent Host Protocol
VS Code's Agent Host lets you steer Copilot, Claude, and Codex agent sessions from GitHub Mobile while they keep running on your laptop or cloud sandbox. Local sessions require your host computer to stay awake, while cloud sessions draw from your shared Actions compute entitlement.
-
10 AI Agent Orchestration Tools: Isolation, Review, Security
Fix review and merge governance before adding parallel agents, since generation capacity already exceeds absorption capacity. Open-source desktop orchestrators avoid vendor lock-in after cloud shutdowns like Conductor Cloud.
-
Beyond Localhost: Safely Deploying AI Coding Agents to Prod
Sandbox validation proves code runs but not whether it is allowed to deploy. You need a deployment control plane with identity, policy, human approval, and rollback before AI coding agents reach production. Inherited developer permissions cause production database deletions and plaintext secret leaks.