Collaborative Human-Agent Protocol (CHAP)
The protocol for humans and agents doing real work together.
When an AI agent drafts something and a human edits it, where does that edit live?In CHAP, it lives in an envelope you can query, replay, and verify six months later.
Install · The 90-second tour · Twelve scenarios · About this repo · Paper
You have agents doing real work. Drafting code reviews, triaging tickets, suggesting settlements, reviewing contracts. A human approves, edits, or rejects each one. Right now, that decision lives in your application code, your chat threads, your ticket comments, and your head. When something goes wrong six weeks later, reconstructing what happened costs you forty-five minutes and is half guesswork.
CHAP gives you one place to put those decisions and one shape to put them in. The agent's draft is an artefact. The human's edit is a structured override with a diff, a rationale, and tags you control. The whole thing chains together by content hash. You query the chain instead of grepping logs across four UIs.
The chain survives key rotation, log expiry, and people leaving; one audit.read call returns the whole thing. The overrides your reviewers were already making accumulate into supervision data you'd otherwise have to commission. When approvals must be non-repudiable, security-signed/1.0 adds OIDC-bound signatures with a signature_meaning you define, and audit-scitt/1.0 anchors the chain in an external transparency log, verifiable without trusting your servers. And CHAP sits beside MCP and A2A rather than replacing them: MCP for tools, A2A for other agents, CHAP for the shared work with humans.
That's the whole pitch.
The 90-second tour
A solo developer using Cursor to review pull requests. The bot flags a "warning" the developer disagrees with. Here's the whole exchange, end to end. The clip below runs in about 23 seconds across six labelled steps; the matching code is right underneath.
And here's the code, every line of it. One continuous story in two languages; pick whichever stack you actually use.
1. Spin up a workspace. An embedded coordinator with SQLite persistence, two participants, a workspace:
| TypeScript | Python |
|---|---|
|
|
2. The bot drafts, you override. Wire your existing Cursor integration to emit envelopes:
| TypeScript | Python |
|---|---|
|
|
About the surfaces. TypeScript ships a typed facade (
coord.api.*) so every method gets full autocomplete and compile-time checks. Python keeps the JSON-RPC envelope shape on the surface (coord.dispatch({...})) and consumers wrap it however suits the call site; asend()helper is the idiom the Python tests use. Both paths emit identical wire bytes; the audit chain is byte-for-byte the same regardless of which client made the call.
3. Two months in, analyse what you've been doing. The reference repo ships an analytics script in both languages that reads the audit chain (over HTTP or straight from your SQLite file) and groups overrides:
# TypeScript reference, against the SqliteStore from step 1:
$ npm --prefix reference/core-plus-review run analyze -- --db ./chap.db wsp_pr_reviews
# Python reference, same idea:
$ python3 reference/python/analyze_overrides.py --db ./chap.db wsp_pr_reviews
Override Learning Report
========================
Total overrides: 47
By tag:
false-positive ████████████████ 31 (66%)
framework-pattern-misread ███████████ 22 (47%)
cosmetic-pref ████ 8 (17%)
Top file paths:
src/handlers/ 18 overrides
src/components/ 9 overrides
Your next prompt revision for Cursor cites the pattern by name instead of guessing at it.
The override envelope, in detail
If you read one shape closely, make it the override envelope. Every field has a job:
The two fields most people miss on first read are intent_preserved and tags.
intent_preserved distinguishes a refining override (the human agreed with the agent's decision but rewrote how it was expressed) from a substituting override (the human reached a different decision). These are two different failure modes and they want different fixes. A high refining rate around one policy clause means the agent's retrieval is off; a high substituting rate on the same clause means the policy itself is ambiguous, or the agent's task context is wrong.
tags is the controlled vocabulary your team agrees on. Keep it small. Whatever you put there is the dimension you'll aggregate on three months from now, when you're answering questions like which prompts need work? or which paths is the bot getting consistently wrong?
Install
TypeScript / Node:
npm install @brightbeamai/chap-coordinator
Python:
pip install chap-coordinator
Either path gets you Core plus the review/1.0 profile and a runnable reference. The TypeScript reference is in reference/; the Python reference is in reference/python/. The TypeScript library lives at packages/coordinator/; the Python library at packages/coordinator-py/.
Five-minute hands-on walkthrough: examples/00-five-minute-start.md.
Status
CHAP 0.2 is a public draft. The specification is seven Core methods plus eleven optional profiles (SPECIFICATION.md), with two reference implementations, TypeScript and Python, that cover every profile and pass the conformance harness on the same JSON-RPC 2.0 wire. A coordinator can present itself as an MCP server or an A2A agent, and five framework bridges put LangGraph, Pydantic AI, AG2, LlamaIndex Workflows, and Google ADK human-in-the-loop decisions on the audit chain. The full inventory, the repository layout, and how CHAP relates to MCP and A2A are in ABOUT.md.
Breaking changes follow Semantic Versioning. Profile surfaces move faster than Core, so if you need strict stability, wait for 1.0.
Read this next
Start with IN_PRACTICE.md, twelve scenarios from a solo developer with Cursor up to GMP-regulated manufacturing; it's the most useful next read. ABOUT.md covers what's in the repo, how CHAP relates to MCP and A2A, the standards it reuses, and how to contribute. core/SPEC.md fits the entire protocol surface on one screen. And the technical report on arXiv grounds the design choices: architecture, profile semantics, threat model, and the twelve scenarios as JSON traces in a worked appendix.
Cite
If you reference CHAP in academic or technical work, please cite the technical report:
@techreport{chap2026,
author = {Shahid, Arsalan and Suttie, Gordon and Black, Philip},
title = {Collaborative Human-Agent Protocol (CHAP): An open protocol for auditable, structured multi-human and multi-agent collaboration},
institution = {Brightbeam AI},
year = {2026},
type = {Technical Report},
number = {arXiv:2606.09751},
url = {https://arxiv.org/abs/2606.09751}
}
CC-BY 4.0 (specification) · Apache 2.0 (code) · Royalty-free, any language, any deployment.