A3S Docs
A3S AHP

Protocol

JSON-RPC methods, handshake, request/notification semantics, and decision shapes in AHP v2.4.

AHP Protocol

AHP v2.4 is a JSON-RPC 2.0 protocol. Requests are used for control points that need a decision; notifications are used for telemetry and durable runtime state that must not block the agent.

Versioning

ItemValue
Wire protocol2.4
Rust cratea3s-ahp
Crate version2.4.0
Repositoryhttps://github.com/A3S-Lab/AgentHarnessProtocol

The handshake rejects protocol major-version mismatches. Patch crate releases can happen without changing the wire protocol version.

Methods

MethodDirectionPurpose
ahp/handshakeAgent to harnessNegotiate compatibility, agent info, harness capabilities, and limits.
ahp/eventAgent to harnessSend one event as a request or notification depending on event type.
ahp/queryAgent to harnessAsk the harness for extra information.
ahp/batchAgent to harnessSend multiple generic-decision events in one request.

handshake and query exist in the event taxonomy, but normal clients should use the dedicated methods.

Event Envelope

Every AHP event carries:

FieldMeaning
event_typeSnake-case event name such as pre_action or task_list.
session_idRuntime session identifier.
agent_idAgent identifier.
timestampRFC3339 timestamp string supplied by the runtime.
depthRecursion depth for nested AHP activity.
payloadEvent-specific JSON payload.
contextOptional structured context for context-aware decisions.
metadataOptional extra runtime or harness metadata.

Full-event client APIs preserve caller-supplied session, agent, depth, context, and metadata. Convenience APIs can create those values for simple callers.

Decisions

Generic events return Decision:

DecisionMeaning
allowContinue, optionally with metadata or a modified payload.
blockStop and surface a reason.
modifyContinue using harness-modified parameters.
deferRetry later.
escalateHand off to a human or external approval path.

Specialized events return typed decision shapes: IdleDecision, IntentDetectionDecision, ContextPerceptionDecision, MemoryRecallDecision, PlanningDecision, ReasoningDecision, RateLimitDecision, and ConfirmationDecision.

Request And Notification Rules

  • Blocking events must be sent as JSON-RPC requests.
  • Fire-and-forget events must be sent as JSON-RPC notifications.
  • The server rejects blocking events sent as notifications.
  • The server rejects non-blocking events sent as requests.
  • Runtime contract payloads are validated even when sent as notifications.

This distinction is the core supervision contract: the harness decides where a decision is required, while non-blocking state remains cheap to stream.

On this page