Agent Harness Protocol
Transport-agnostic JSON-RPC protocol for supervising autonomous agents.
Agent Harness Protocol
AHP separates agent execution from policy enforcement. An agent emits structured events at meaningful control points, the harness evaluates those events, and the agent applies the returned decision before continuing.
The current crate is a3s-ahp 2.4.0; the wire protocol version is 2.4.
Capability Map
| Area | Current capability |
|---|---|
| Protocol | JSON-RPC 2.0 methods: ahp/handshake, ahp/event, ahp/query, and ahp/batch. |
| Transports | Rust client/server support for stdio, HTTP, WebSocket, and Unix socket transports. |
| Auth | Optional API key and bearer auth for HTTP and WebSocket clients. |
| Compatibility | Handshake rejects protocol major-version mismatches and advertises harness limits. |
| Decisions | Generic Decision plus specialized payloads for context, memory, planning, reasoning, rate limits, confirmation, idle, and intent detection. |
| Runtime contracts | Durable non-blocking events for run lifecycle, task-list snapshots, and verification evidence. |
| Batching | Batch requests for generic decision events with fail-closed handler behavior. |
Start Here
- Protocol covers JSON-RPC methods, handshake, requests, notifications, and decisions.
- Events maps blocking events, notifications, runtime contracts, and batching rules.
- Typed Decisions expands the specialized context, memory, planning, reasoning, rate-limit, confirmation, idle, and intent-detection contracts.
- Transports explains feature flags, client/server lifecycle, auth, and limits.
Where It Fits
AHP is useful when a product wants one supervision plane for multiple agent runtimes. A3S Code can integrate with AHP hooks; other runtimes can speak the same protocol without adopting A3S Code internals.
Boundary
AHP defines the wire contract and typed decisions. It does not execute tools, run models, or enforce policy by itself. Enforcement still belongs to the agent or runtime that receives the decision.