microsoft / microsoft/agent-host-protocol

Reconsider host-level agent auth state

Open
#153 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

under-discussion
Dominant language
TypeScript
Stars
348
Forks
122
Avg merge
14h 12m
Merged PRs (30d)
22

Description

Currently each client must independently obtain OAuth tokens and push them to the host via authenticate. The token lifecycle (refresh, expiry) is also per-client. In practice this means the host holds N copies of the same Copilot
token for N connected clients — all granting access to the same GitHub account on the same machine.

The per-client isolation this model assumes doesn't exist in practice. In the VS Code agent host, all clients share a single process. Any connected client can execute arbitrary commands and access credentials on the host via tool
calls. Per-client token isolation would only be meaningful with per-client sandboxing, which the current architecture doesn't provide.

Suggestion: Make agent auth state host-level. The host manages tokens for agents like Copilot centrally — obtaining, storing, and refreshing them. Clients authenticate their connection to the host (--connection-token), not
separately with each agent's upstream service.

Clients could still assist with the initial auth flow when the host has no token (e.g. presenting a device code UI and passing the result back), but the token would be stored and refreshed by the host, shared across all
connections. This also simplifies reconnection — clients don't need to re-push tokens after a dropped connection.

ahpx already works around this by resolving GitHub tokens from the environment (GITHUB_TOKEN / gh auth token) client-side — effectively treating agent auth as a host-level concern.

Spec references

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with docs/specification/authentication.md, especially the per-client flow at lines 7–25 and the per-resource and per-connection rationale at lines 197–206. Compare those sections with the proposed host-level lifecycle and define the protocol changes needed for shared token storage, refresh, and client-assisted initial authentication. Done means the authentication specification and its rationale consistently describe the accepted model.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
authentication, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.