-
Notifications
You must be signed in to change notification settings - Fork 4
CHAP vs AG‐UI
AG-UI connects an agent backend to a user-facing application. CHAP gives the work and decisions moving through that interface portable accountability semantics.
AG-UI and CHAP overlap at the human-in-the-loop moment, but they approach it from different layers.
AG-UI is an event-based protocol for agent-user interaction. It supports streaming output, shared state, frontend tools, human interrupts, agent steering and UI-oriented events. It helps an application present and control a responsive agent experience.
CHAP is a collaboration and evidence protocol. It represents participants, workspaces, tasks, artefacts, reviews, decisions, overrides, escalation and an append-only evidence chain. It does not specify how an approval dialog should look or how tokens should stream to the browser.
A strong implementation can use AG-UI for the live interface and CHAP for the accountable record.
| Question | AG-UI | CHAP |
|---|---|---|
| Primary job | Connect agent backends to user-facing applications | Standardise accountable human-agent work |
| Main boundary | Agent backend and frontend | Humans, agents and services in a workspace |
| Data shape | Event stream, messages, state updates, tool events and UI intent | Signed envelopes, tasks, artefacts and decisions |
| Human-in-the-loop | Pause, approve, edit, retry or escalate in the live experience | Review, approve, reject, override, abstain, escalate and handoff semantics |
| UI rendering | Central concern | Out of scope |
| Streaming | Central concern | Transport-dependent, not the defining concern |
| Persistence | Chosen by the application and integration | Evidence chain and audit methods are protocol concepts |
| Human edit | Can flow through shared state or tool results | Can become a structured override with diff, rationale, tags and intent |
| Best composition | Render and collect a CHAP decision | Supply the durable meaning behind an AG-UI interaction |
AG-UI documentation includes human-in-the-loop interrupts that can pause, approve, edit, retry or escalate without losing state. Those verbs are close to CHAP's decision vocabulary. This creates a useful integration point, not a reason to choose one protocol and reject the other.
An interface event answers: what should the application show or do now?
An accountability envelope answers: what work was proposed, who decided, what changed, why did it change, and how can the sequence be verified later?
The same user action can generate both.
Consider a customer-support agent that drafts a refund response.
- The backend creates a CHAP task and records the draft artefact.
- It emits
review.requestfor the support specialist. - AG-UI streams the draft and review controls to the frontend.
- The specialist approves, edits, rejects or escalates in the application.
- The backend validates the response and maps it to the corresponding CHAP method.
- An edit becomes
decide.overridewith a structured patch and rationale. - AG-UI updates shared state and continues the experience.
- CHAP retains the decision evidence independently of the transient UI session.
No duplicate decision is needed. The AG-UI event and CHAP envelope are two views of the same application action, with separate responsibilities.
| Interface action | Possible CHAP meaning | Important qualification |
|---|---|---|
| Approve | decide.approve |
Only if the presented artefact is unchanged |
| Edit and continue | decide.override |
Preserve the original, revised value, diff and rationale |
| Reject | decide.reject |
Distinguish policy rejection from malformed input or cancellation |
| Escalate | escalate.raise |
Identify destination or required authority where policy permits |
| Retry | No automatic one-to-one mapping | It may be rework, a new task attempt or an operational retry |
| Cancel UI | No automatic one-to-one mapping | Closing a dialog is not necessarily a business rejection |
This table shows why blindly translating event names is risky. Interface intent must be interpreted in the task and policy context.
AG-UI shared state is useful for a responsive application. It lets the agent and frontend stay synchronised as work changes. That state may be persisted and event-sourced by an implementation.
CHAP evidence focuses on protocol-level attribution and sequence. A reviewer should be linked to the exact artefact and authorised decision, and a later verifier should be able to inspect the hash-linked history.
An application may store both in the same database, but their logical purposes remain distinct. UI state supports interaction. Decision evidence supports accountability.
Do not force CHAP to carry token deltas, visual layout, every hover event or all frontend state. That would turn an accountability protocol into an inefficient UI transport.
Record the consequential boundary:
- The proposal became reviewable.
- A participant made a decision.
- The accepted artefact changed.
- Work was handed off or escalated.
- An external action was invoked or completed.
Keep presentation details in AG-UI and application telemetry.
The backend should bind the authenticated application user to the correct CHAP participant. Never trust a participant identifier supplied only by browser state.
Use stable identifiers or idempotency keys so reconnects and event retries do not create multiple CHAP decisions. Define which system is authoritative if the interface reports success but the CHAP write fails.
Avoid copying sensitive shared state into the evidence chain. Where appropriate, retain an opaque reference and content hash rather than the full payload.
Use AG-UI alone when you need a rich, interoperable agent interface and application-specific persistence is sufficient.
Use CHAP alone when an existing interface or non-interactive system already transports the work, but you need standard collaboration and evidence semantics.
Use both when a live user-facing agent performs consequential work that must be reviewed, modified or traced across more than one application or organisation.
- CHAP with LangGraph human-in-the-loop
- Why AI audit logs do not capture human judgement
- MCP, A2A and CHAP: how the open agent stack fits together
- AG-UI overview
- AG-UI tools and human-in-the-loop workflows
- CHAP specification
- CHAP relationship to other standards
If you are connecting AG-UI to an accountable workflow, star CHAP and describe the event mapping you need in Discussions.
Last reviewed: 25 August 2026.