Skip to main content
Add an A2A interface to the root agent-card.yaml. Harnest mounts only the bindings declared by the compiled card; you do not implement A2A route handlers.
agent-card.yaml
The URL path, /support/a2a in this example, becomes the mounted route. Use the public deployment URL in the Agent Card, then serve from the agent folder:
Discover the card at GET /.well-known/agent-card.json. Use A2A 1.0 with HTTP+JSON or JSONRPC; version 0.3 remains supported on both. Test the HTTP+JSON binding at the exact path declared by the card:

Understand when a Task exists

Harnest supplies GetTask, filtered ListTasks, CancelTask, and explicit Task subscriptions. These operations are part of the mounted adapter, but callers use them only when their workflow needs Task state.

Persist A2A Tasks

Register a built-in Harnest store for both session and checkpoint responsibilities when A2A Tasks must survive a restart:
1

Create lib/state.py

lib/state.py
2

Create lifecycle/storage.py

lifecycle/storage.py
Queued work also needs @lifecycle.storage.tasks; recurring work needs the same provider under @lifecycle.storage.cron. See Task and cron storage. An unfinished @task awaited inside @tool(durable=True) shares the Harnest run and continuation represented by its A2A Task. On GetTask or subscription, Harnest reconciles a durable result without replaying the original tool call. A2A contextId maps to the Harnest session. Text agents accept text parts; typed-input agents require one structured data part. Tool arguments and results stay private. Configure optional reasoning, decision, and metadata events through Output policy; see A2A event fields. When OutputPolicy(agent_metadata=AgentMetadataMode.RAW) is enabled, streaming metadata updates also carry the native ADK or LangGraph raw mapping. A remote A2A task store or consumer may retain those values. Keep the normalized default unless every A2A caller is authorized to receive provider metadata. CancelTask succeeds after the owned run becomes terminal and any queued-task lease is invalidated. It cannot undo external side effects.
Human approvals and client-tool requests are process-local. If a durable run resumes into one of those interactions on a replica that does not own it, Harnest fails the A2A Task rather than advertising input that replica cannot accept.

Apply security and protocol limits

A2A routes use the root authentication pipeline. Security requirements in agent-card.yaml advertise the contract; an @lifecycle.authenticate extension enforces it. Agent Card discovery remains public. Task IDs are scoped to the compiled application and authenticated user; another user receives 404 rather than task-existence information. Harnest does not currently serve gRPC bindings, push notifications, extended Agent Cards, or A2A extensions. Server startup rejects a card that asks the runtime to claim unsupported behavior.

Call this agent from Harnest

Use the lazy client directly or compose the endpoint as a portable remote agent.