Skip to content

Repository files navigation

Context Handoff Protocol

Portable, permissioned, verifiable context handoff for AI agents and workflow systems.

Context Handoff Protocol, CHP, is an open protocol that lets agents, users, and systems pass working context forward without dumping private history, raw data, or unverifiable state.

Use CHP when:

  • one agent or workflow needs to continue another's work;
  • context needs evidence, provenance, policy, and history instead of a prompt paste;
  • raw data must stay behind governed references;
  • receivers need to verify what they received before trusting or replaying it.

New here? Start with Quickstart, then Profiles, then Specification. For enterprise-safe gateway-mediated handoff, see the Enterprise Context Gateway Profile.

Why CHP Exists

Agent-to-agent delegation needs more than a task message. The receiving agent needs enough context to continue work, but sharing full conversation history, raw documents, internal memory, or tool traces is risky and hard to audit.

CHP exists to standardize the handoff layer:

  • what context is handed off;
  • how each claim traces back to evidence;
  • how raw data is referenced without being copied by default;
  • how access is scoped by purpose, actor, tenant, time, and revocation state;
  • how context evolves through append-only history;
  • how implementations verify compatibility.

Non-Goals

CHP is deliberately narrow.

  • CHP is not an agent framework.
  • CHP is not a UI product.
  • CHP is not a memory dump format.
  • CHP is not a replacement for enterprise IAM, policy engines, or data stores.
  • CHP is not an enterprise context gateway; it defines how gateways interoperate with handoff packages.
  • CHP does not define blockchain consensus.
  • CHP does not define CRDT-based collaborative editing.
  • CHP does not require sharing raw data.
  • CHP is not dependent on A2A.

Relationship to A2A and MCP

MCP is for agent-to-tool integration. A2A is for agent-to-agent task delegation. CHP is for governed context handoff across agents, users, and systems.

MCP = agent-to-tool
A2A = agent-to-agent task delegation
CHP = governed context handoff

A2A can carry a CHP pointer, such as a context_id, head, schema, and resolver URL. CHP can also be used without A2A through HTTP APIs, MCP tools, enterprise workflow systems, browser extensions, or human collaboration products.

Core Scope

CHP focuses on a complete protocol base:

  • Context package format
  • Context node append-only history
  • Claim-level provenance
  • RawRef references without implicit raw sharing
  • Policy model
  • Context quality and degradation
  • Identity and trust registry model
  • Hash and signature verification
  • Revocation semantics
  • Replay semantics
  • Extension rules
  • HTTP+JSON API contracts
  • A2A and MCP profiles
  • Reference implementation
  • Conformance fixtures and tests

Optional profiles, including the Enterprise Context Gateway Profile, build on this base without changing core CHP semantics.

The 1.0.0 release includes the protocol docs, schemas, reference server, conformance runner, reference client wrappers, examples, A2A/MCP profiles, governance, and security policy. Existing v0.1 and 1.0-rc.1 wire artifacts remain accepted during the v1.0 transition.

Repository Layout

README.md
SPEC.md
THREAT_MODEL.md
GOVERNANCE.md
docs/
  object-model.md
  operations.md
  security.md
  authorization.md
  history.md
  replay.md
  extensions.md
  audit-events.md
  api-conventions.md
  profiles.md
  profiles-a2a.md
  profiles-mcp.md
schemas/
  chp-package.schema.json
  chp-node.schema.json
  chp-claim.schema.json
  chp-rawref.schema.json
  chp-policy.schema.json
  chp-provenance.schema.json
  examples/
examples/
  sales-renewal/
  raw-revocation/
  branch-merge/
reference/
  server/
  sdk-python/
  sdk-js/
conformance/
  fixtures/
  tests/

Current Status

CHP is a stable v1.0 protocol (1.0.0). Core requirements and optional profiles are defined in docs/profiles.md; existing v0.1 and 1.0-rc.1 fixtures and reference behavior remain supported during the v1.0 transition.

The reference server and conformance runner are intentionally minimal. They prove the core create, append, verify, revocation, and replay loop, plus reference RawRef resolver behavior. Production deployments still need real identity, policy, storage, and JWS integrations.

First-Time Reader Path

If you are new to CHP, read in this order:

  1. Quickstart: plain-language mental model.
  2. Profiles: Core vs optional profiles.
  3. Implementer guide: smallest implementation checklist.
  4. Specification: normative protocol map.

Implementing CHP

Start with docs/implementer-guide.md.

Verification

Prerequisites:

  • Git
  • Node.js 22 or newer
  • npm
  • Python 3 for the Python reference client smoke test

On Windows, confirm that python --version prints a real Python 3 version. Some Windows installs resolve python to a Microsoft Store stub; if that happens, install Python 3 or run the Python reference client command with the full path to a real Python interpreter.

If you clone the annotated release tag directly, Git may print a detached HEAD message or say the tag is not a commit before checking out the tagged commit. That is normal for inspecting v1.0.0.

Run the release checks locally:

cd reference/server
npm ci
npm test

cd ../../conformance
npm test

cd ..
node --test conformance/tests/*.test.js

cd reference/sdk-js
npm test

cd ../sdk-python
python -m unittest discover -s . -p '*test*.py' -v

cd ../..
node scripts/check-v1-consistency.mjs
git diff --check

GitHub Actions runs the same checks for pull requests and pushes to main.

License

CHP is licensed under the Apache License 2.0. See LICENSE.

About

Portable, permissioned, verifiable context handoff for AI agents and workflow systems.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages