Agent Host Protocol: AI Agent Sessions That Follow You
Close your editor, and your coding agent dies with it. That has been the quiet limitation of most AI agent integrations, and the Agent Host Protocol (AHP) is GitHub and the VS Code team's answer to it. On November 17, 2026, GitHub's engineering blog published a detailed write-up on how the open protocol was designed, how two independent implementations were built, and which products already run on it: Copilot in VS Code, the Copilot app, the GitHub mobile apps and GitHub's cloud agents.
The timing matters for anyone running agents in production. As the article puts it, "Models are now good enough to work for hours or even days on their own." An agent that works for hours cannot be tied to a single window or extension. It needs a host, durable state, and a clean way for several interfaces to attach to it. That is what AHP specifies.
The context
Until now, most coding agents were bound to one client. GitHub's own Copilot Chat lived as a VS Code extension, and the authors are blunt about the consequence: "Extensions are attached to a single VS Code window. Close that window, and the agent is gone." Meanwhile, the Copilot app, iOS and Android had each built their own integration with cloud agents.
That is a textbook N-by-M problem. Every new client needed a bespoke integration with every agent host, and a session started in one interface could not be resumed in another.
Two terms are worth pinning down:
- The agent host is the process that actually runs the agent: the reasoning loop, the tool calls, the terminals. It can live on a laptop, in a container, on a remote server or in the cloud.
- The client is any interface that renders the session and lets you act on it: an editor, a desktop app, a phone, or a tool you built yourself.
AHP standardises the conversation between the two, much as the Language Server Protocol and the Debug Adapter Protocol did for editors and language tooling.
How the Agent Host Protocol works
The specification site describes AHP as "a display protocol built to let many interfaces operate on shared session state." In other words, it does not dictate what the agent does. It defines how multiple interfaces observe and change the same session.
URI-addressed channels
AHP is built on JSON-RPC 2.0 over a reliable, bidirectional message stream. Every message carries a top-level channel parameter expressed as a URI, which acts as the routing key. The specification overview lists ahp-root:// for the root, ahp-session:/<uuid> for a session and ahp-chat:/<cid> for a chat. Root, session and chat channels are mandatory; terminals, automations, MCP additions and OpenTelemetry reporting are optional extensions.
For implementers, this design has a practical upside: any incoming message can be dispatched by inspecting the (method, params.channel) pair, without per-method deserialisation.
Reducer-driven state
Inside each channel, state is an object driven by pure reducers, in the style of Redux. The host is the arbiter of that state. Clients send actions through dispatchAction, which either mutate state or trigger side effects such as sending a chat message, and the host broadcasts updates tagged with sequence numbers. A client that calls subscribe on a channel first receives a snapshot, then the stream of subsequent actions.
GitHub lists three direct benefits of this model: reconnection and replay become straightforward, clients and servers are easy to debug, and the state maps naturally onto React and similar UI frameworks.
Reconnects, versions and auth
When the network drops, the client keeps queuing actions. On reconnect, the host sends either the actions the client missed or simply a snapshot of current state, and it can reject or reconcile conflicting concurrent actions. Protocol versions are negotiated during initialize using SemVer strings, and authentication follows RFC 9728 and RFC 6750, with an auth/required notification from the server. For vendor-specific needs, the spec reserves an x- prefix and supports _meta fields for out-of-band signalling.
Two hosts, one Agent Host Protocol
The most useful part of the article is not the spec itself but how it was stress-tested. There are two independent hosts:
- VS Code's host, in TypeScript, runs locally and also works over SSH, containers, WSL or Dev Tunnels. It ships in the VS Code Server bundle.
- GitHub's host, in Rust, runs in cloud infrastructure under a broader set of security constraints.
The VS Code side was no small migration. The Copilot Chat extension had grown past 400,000 lines of TypeScript, not counting tests, over three years. The authors point out that building a harness that says hello and edits files is easy; covering the long tail of features developers expect is not.
Running two implementations proved to be "a good acid-test for the protocol itself." Early versions could not faithfully represent shell tool output without a pseudo-terminal (PTY) behind it. Some divergence was legitimate GitHub-specific extension, such as metadata linking to project boards; some exposed real protocol gaps or hidden assumptions, for instance about the shape of session URIs. Reconciling the two hosts is what made AHP, in the article's words, "portable in practice, not just in theory."
One session, four screens
The article illustrates continuity with a concrete timeline. A session called "Fix the flaky login test" runs continuously on one host. It is started from the Copilot app at 9:02 AM, a tool call is approved from a phone at 9:40 AM, the diff is reviewed in VS Code at 11:15 AM, and a cloud agent lands the pull request at 11:32 AM.
The point is not multi-screen convenience. It is separation of concerns: execution stays in one place, only the views change. Approving a tool call is no longer tied to whichever interface started the task.
The protocol is open, with SDKs in Rust, TypeScript, Kotlin, Swift, .NET and Go, a specification repository and sample implementations. You can already connect your own host from the Copilot app (Experimental > Direct Connections, then Environments) and from VS Code via "Add Remote Agent Host".
What it means for AI teams
For DevOps and MLOps teams putting agents into production, the Agent Host Protocol reframes several decisions.
The host becomes infrastructure. If the session lives on a host rather than a client, that host has to be deployed, monitored and backed up like any stateful service. Where does it run: a developer machine, an ephemeral container, a shared cluster? What happens to a session when the pod restarts? Reducers and snapshots make recovery easier, but you still need to persist state somewhere and decide how long sessions live.
The approval surface grows. Approving a tool call from your phone is convenient, and it is also a new authorisation path. Teams need to define who can approve which actions, from which client, and keep an audit trail of every approval. Building on standard OAuth RFCs helps here: client authentication can plug into your existing identity provider rather than a home-grown scheme.
Observability gets an anchor. The optional OpenTelemetry channel lets you attach an agent's traces to the host that executes it, regardless of which client is driving. For an internal platform, that is a chance to centralise collection instead of instrumenting every interface separately.
Decoupling protects your investment. Because AHP does not encode agent behaviour, harnesses, models and tools can evolve without breaking clients. A team building an internal dashboard, a chat bot or a review tool can target the protocol rather than a specific product.
It complements MCP rather than replacing it. The Model Context Protocol connects an agent to tools and context; AHP connects people and interfaces to the agent's session. The two sit at different layers, and AHP even lists MCP additions among its optional channels, so an existing MCP tool catalogue stays relevant.
The engineering lessons travel. Validating a contract with two independent implementations, backing shell output with a real PTY, and offering extension fields instead of forking the protocol are habits worth applying to any internal API between an agent and its front ends.
A sensible first step: read the spec, run the official samples against a local host, then map where your agent sessions live today and who is allowed to approve their actions. If your agents already run for hours, the Agent Host Protocol asks the right architecture questions, whether or not you adopt it.
Key takeaways
- The Agent Host Protocol is an open, JSON-RPC 2.0 based standard that lets many interfaces share one AI agent session.
- State lives on the host as pure reducers; clients dispatch actions and receive snapshots plus sequenced updates.
- Two independent hosts, TypeScript in VS Code and Rust in GitHub's cloud, were used to prove the protocol is portable.
- Copilot in VS Code, the Copilot app, the GitHub mobile apps and cloud agents already use it, with SDKs in six languages.
- For AI teams, the host becomes a stateful service to deploy, observe and secure, with an approval surface to govern.
Industrialising AI agents? SeedVision offers 3-5 day AI audits and 15-30 day production rollouts. See the packages or book a 30-min call.
Cover photo: Photo by Firmbee.com on Unsplash.