Agent Host Protocol Moves the Transport, Not the State
The Agent Host Protocol as a build spec: the state your app must externalize before sessions hop devices, and what a roaming session costs to secure.

In this article
- 1.What the Agent Host Protocol standardizes, and what it leaves to you
- 2.Where session state lives today, and why it is trapped
- 3.The four kinds of state a portable session must externalize
- 4.Designing the side-effect ledger so a resumed agent cannot re-execute
- 5.Why resume without a ledger means re-execute
- 6.Importing the payments fix
- 7.Scoped, expiring credentials for a session that travels
- 8.What a roaming session costs to run
- 9.What a roaming session costs to secure
- 10.An adopt, build, or wait rubric for engineering teams
GitHub's Agent Host Protocol announcement reads like a feature launch: start a session on your laptop, check in from your phone, keep working after you close the window. The durable payload is less photogenic. The protocol elevates the session, not the model, to the unit of portable state, and that elevation forces engineering decisions the announcement never names. Four categories of state (externalized context, scoped credentials, a side-effect ledger, and rebindable tool definitions) must move out of any app that wants its sessions to hop devices or hosts. Read as a build spec, the Agent Host Protocol also tells you what a roaming session costs to run and to secure. Adoption is a pricing decision on run cost and attack surface, not a feature vote.
Stay in the loop.
Get the latest posts and exclusive content delivered to your inbox.
Join 15 readers. No spam. Unsubscribe in one click, anytime.
What the Agent Host Protocol standardizes, and what it leaves to you
GitHub introduced the Agent Host Protocol as an open protocol for connecting coding agents to hosts, meaning editors, terminals, and cloud environments, with one key property: clients can attach to and detach from running sessions from multiple devices. The stated motivation is modest and honest. Agent tasks now run for hours or days, and people need to check in from anywhere, as GitHub's engineering post puts it. The interesting engineering is what had to be true underneath that sentence.
The public spec standardizes the transport layer: JSON-RPC 2.0 style messaging (the same request-and-notification grammar as the JSON-RPC 2.0 spec), session lifecycle, permission request and response flows, and progress and awareness notifications, so a phone client can render what a laptop started. The protocol is organized around URI-identified channels (root, session, and chat at minimum), each holding a reducer-based state object with the server as arbiter; clients send sequenced actions that mutate state or trigger side effects. That choice is what makes reconnection and replay under flaky networks tractable. The AHP specification overview and the session channel spec are worth reading directly.
What the spec does not standardize is the durable state behind the wire. There is no session-state schema. How context persists, where credentials are vaulted, how side effects are tracked: all of that remains an implementation responsibility. That boundary is the most useful thing in the announcement, because it is exactly the line your team has to engineer.
The architecture echoes the Language Server Protocol. LSP decoupled language tooling from editors so any editor could drive any language server; AHP decouples agents from surfaces so any client can drive any agent session. And, like LSP, it stays out of the domain on purpose. GitHub's team notes that the agent world is evolving too quickly to encode how agents work, so AHP standardizes how you interact with them, not what they do.
This also settles the Agent Host Protocol versus MCP question people keep asking. They are complementary. MCP standardizes how an agent reaches tools and data; AHP standardizes how a client reaches and supervises an agent session across hosts and devices. An agent can speak MCP to its tools while a host speaks AHP to its clients, and neither layer needs to know about the other.
Three questions follow, and the rest of this piece answers them: what state must leave your app before sessions can travel, what a roaming session costs to run, and what it costs to secure.
Where session state lives today, and why it is trapped
Model portability is a solved problem. Every serious inference API takes a model name and a context and returns tokens; the capability travels with the account, not the machine. Session state does not. It hides in per-machine places: in-process memory that dies with the window, local dotfiles, terminal scrollback, per-machine tool result caches, environment-specific credential files.
Even the best CLI agents behave this way. Claude Code's resume flag reattaches to a session, but the session lives on the machine that started it, because that is where the transcript and its caches sit. That is simply what happens when nothing forces the state out, and it is the default state of agent session management today.
The scale of the trapped-state problem is visible in GitHub's own numbers. The Copilot Chat extension that bundled its own harness in VS Code had grown past 400,000 lines of TypeScript, by GitHub's account, and its lifetime was tied to a single editor window. Close the window and the agent was gone. Update the editor and every agent stopped. A protocol kills the N-clients-times-M-integrations half of that problem, but only the integration half. The state half is yours.
So separate the two problems the announcement blends. Check-in from anywhere is a UX problem, solved by transport and notifications. A session that hops devices is a state-schema problem, solved by externalizing whatever the transport needs to rehydrate. You can adopt the first. You have to build the second.
The four kinds of state a portable session must externalize
Strip the wire format away and ask what any portable agent session needs, protocol or not. Four categories of state must leave the app that started the session before an agent session handoff across devices or hosts is possible.
| State category | What it holds | Where it must live | Failure if it stays app-local |
|---|---|---|---|
| Externalized context | Transcript, summaries, file references, tool results | Durable store reachable from any host | Session dies with the process; resume works only on the origin machine |
| Scoped, expiring credentials | Per-session tokens, refresh path, permission grants | Host-side vault plus a session-bound reference | Long-lived ambient tokens travel with the session as portable loot |
| Side-effect ledger | Idempotency keys, completion status, affected resources | Append-only store the agent consults before acting | A resumed agent re-executes writes it already performed |
| Rebindable tool definitions | Tool identity, binding endpoints, permission requirements | Declarative, host-resolvable registry | Bindings break, or silently resolve differently, on the new host |
The point worth internalizing: this contract is AHP-independent. Any portable session needs these four things whether you adopt the protocol, build your own, or never move state across devices at all and simply want resumable agents after a crash. AHP is one wire format for moving some of it; the contract is the underlying physics of agent state management. Teams that never adopt AHP still benefit from building it, which is why the derivation matters more than the launch.
Designing the side-effect ledger so a resumed agent cannot re-execute

Why resume without a ledger means re-execute
The mechanism is easy to misjudge. After a context gap, a plain context window has no reliable signal separating actions the agent planned from actions the agent completed. The transcript says "deploy to production." The agent wakes up on your phone, reads that plan, and has no record that the deploy already fired. So it fires it again.
Importing the payments fix
The design is a direct import from payments, where the identical double-execution problem was solved years ago. Stripe's idempotency keys exist precisely because networks drop responses after requests succeed: you send a key with each write, the server records the key with the outcome, and a retry returns the recorded outcome instead of a second charge. Agent tool calls are the same shape with a higher blast radius, and idempotency keys for agent tool calls transfer directly.
Walk the failure end to end without the ledger. An agent on your laptop finishes a build, opens a PR, and queues a deploy as its next step. You close the lid. The session syncs to your phone an hour later and you say continue. The resumed agent re-reads its plan, sees deploy pending, and runs it, except the deploy fired before the gap. With a ledger, the pre-action read shows that deploy completed under a known key, and the agent moves to verification instead.
Concretely: make every mutating tool call carry a client-generated idempotency key, append a record (key, tool, argument hash, status, affected resources) before execution, mark it completed or failed after, and on resume, read the ledger before the agent acts. Keep it append-only and tamper-evident, a property that pays off again in the security section.
Scoped, expiring credentials for a session that travels
Ambient credentials are the state category that turns portability into breach velocity. The common pattern in agent setups is a long-lived bearer token sitting in a config file or environment block, valid for weeks, scoped to everything the agent might need. That is tolerable when the session never leaves one machine. When session state travels, the token travels with it, and anything that exfiltrates the session state exfiltrates live access.
The replacement is a per-session design for scoped credentials: short-lived, narrowly scoped access tokens with a refresh path, provisioned when a session starts, bound to that session, and revoked when it ends. The device authorization grant flow fits naturally here, because the typical roaming path is exactly a phone attaching to a session that started elsewhere.
Divide what travels from what stays. The session record carries a reference and the refresh path; the vault holding actual secrets and the capability to mint tokens stays host-side. A leaked session record then yields a revocable reference, not a master key.
What a roaming session costs to run
The dominant run cost of a roaming session is usually operational, not per-token. The bill components, sorted by what drives them:
| Cost | Scales with | Notes |
|---|---|---|
| Durable host uptime | Session duration | Hosts stay warm for hours or days, idle or not |
| Context storage | Session duration | Transcripts and tool results grow monotonically |
| State re-sync | Attach frequency | Every attach ships current state to the new client |
| Context replay | Resume frequency | Stateless APIs require re-supplying the context |
| Lifecycle management | Both | Timeouts, orphan cleanup, concurrent mutation |
Statelessness is the hidden line item. Inference APIs keep no server-side session, so resuming an agent session on another device means re-supplying its context, every time. OpenAI's prompt caching shows the standard mitigation, cached prefixes that can cut the input cost of repeated context. The caveat is locality: caches are generally not portable across providers, and a host or region hop can bust them, so a session that changes hosts can pay to rebuild context from scratch. Budget for the worst case and treat cache hits as a discount.
Multi-client attach is also a concurrency problem wearing a UX costume. Two devices issuing instructions to one session is a distributed-systems problem: someone must sequence the actions and reconcile conflicts. AHP's reducer-plus-server-arbiter design exists precisely for this, which is a genuine reason to prefer the protocol over a hand-rolled attach mechanism for long-running agent sessions.
What a roaming session costs to secure

A session that travels is an exfiltration target that travels with it. Treat the session record as sensitive data with live capability attached, because that is what securing roaming agent sessions actually means. Four threats and their pairings:
- Synced context. Transcripts carry secrets, file contents, and internal URLs. Mitigate with redaction at the sync boundary, encryption at rest, and retention limits.
- Replayable bearer credentials. The fix is the previous section: scoped, short-lived, revocable tokens instead of ambient ones.
- Confused deputy on rebind. Rebindable tool definitions can resolve differently on a new host; a tool named deploy may bind to a different pipeline with different permissions. Re-verify bindings and permissions at attach time, not just at session start.
- Attach-channel hijack. When any device can attach, any device-shaped attack is an entry point. Mitigate with device trust and per-attach authorization.
These map onto OWASP's LLM Top 10: sensitive information disclosure for synced context, excessive agency for confused-deputy rebinds, and the identity categories for attach-channel compromise. A roaming session does not create new risk categories. It raises the severity of existing ones by making the target portable.
An adopt, build, or wait rubric for engineering teams
| Team archetype | Call | Rationale |
|---|---|---|
| Single-surface CLI, sub-hour tasks | Build the contract, defer the wire protocol | Users work in one place; the four-state contract still pays off for crash resume |
| Platform team running cloud environments | Adopt AHP-shaped interfaces now | Sessions already outlive surfaces; attach, notify, and permission flows are your roadmap anyway |
| Multi-vendor enterprise | Adopt for interoperability | Client choice and host choice are the point; GitHub lists libraries in Rust, TypeScript, Kotlin, Swift, .NET, and Go |
The failure modes of deferring each state category are the honest cost of waiting:
- Context stays local. Sessions are unrecoverable after a crash, there is no cross-device story, and debugging depends on one machine.
- Credentials stay ambient. Every incident involving the dev box becomes an incident involving every session it ever ran.
- No ledger. The double-execution failure is a when, not an if, and it lands on writes with consequences: deploys, PRs, purchases.
- Hard-coded bindings. Host changes break silently, or worse, resolve to the wrong target.
The minimal moves pay off even if you never adopt AHP: make mutating tools idempotent, externalize context to a durable store, and replace ambient tokens with scoped ones. Those three buy crash resume, incident containment, and double-execution immunity with no protocol required. The Agent Host Protocol decision then reduces to what it always was: whether your users' sessions are worth a standard wire format this quarter, or whether the state work, which you have to do anyway, buys you time to wait.
Stay in the loop.
Get the latest posts and exclusive content delivered to your inbox.
Join 15 readers. No spam. Unsubscribe in one click, anytime.
About the author
Rachel Brennan
AI Research Editor
Rachel tracks AI research so the rest of us don't have to. With a background in NLP and a habit of reproducing papers, she turns new models and methods into ideas you can actually use.
Related Posts
What Harness Distillation Moves Into Model Weights
Harness distillation can move routing, formatting, and retry policy into weights; permissions, state, verification, and audit trails belong in code.
MCP Agent Verification That Proves Every Claim's Source
MCP agent verification grades each claim's source, not just truth. The decision grid, provenance binding, and eval additions catch wrong-source answers.
Orchestrate Open Source LLMs vs Frontier Models
Should you orchestrate open source LLMs or call a single frontier model? We break down Sakana Fugu's claims and the real cost and latency tradeoffs.


