Skip to content

Delegate work over A2A

The development A2A surface runs as a separate process and calls dac-plane through the public Surface API. It serves authenticated A2A 1.0 agent cards and handles task submission, status reads, cancellation, and streaming updates for work delegated to an agent. Follow #187 for qualification with external orchestrators and the Kubernetes environment provider.

Run the surface

Start a dac-plane deployment and create an agent in its tenant. Use a TLS certificate for the hostname clients use to reach the A2A surface. For a local development stack, reuse its certificate for localhost and pass the stack's CA for the upstream connection:

go run ./cmd/dac-a2a-surface \
  -listen 127.0.0.1:8444 \
  -public-origin https://localhost:8444 \
  -surface-origin https://localhost:18443 \
  -surface-ca-file .work/stack/ca.crt \
  -tls-cert-file .work/stack/server.crt \
  -tls-key-file .work/stack/server.key

-public-origin is the HTTPS origin clients use for discovery and RPC. -surface-origin is the HTTPS origin the process uses for Surface API calls. Supply -surface-ca-file if dac-plane uses a private CA. The surface forwards each caller's Surface API bearer to that configured origin. A principal may discover agents in its bound tenant. Retiring an agent removes its card from discovery.

Set DAC_A2A_PUBLIC_ORIGIN on dac-plane to the same value as -public-origin to discover the card from an agent response. The Link header uses the relation https://dac-plane.dev/relations/a2a-agent-card. A suspended agent keeps its card, so its existing tasks stay reachable; only retiring removes it from discovery.

Read a card and task

Reuse the token, tenant, and agent variables from Getting started and Delegate work to agents. Configure an orchestrator with the explicit card URL:

agent_url="https://localhost:8444/a2a/v1/tenants/$tenant/agents/$agent"
curl -fsS --cacert .work/stack/ca.crt \
  -H "Authorization: Bearer $token" "$agent_url/.well-known/agent-card.json"

The card shows the current agent name, role and revision. The supported interface points to the same agent's JSON-RPC endpoint. To read the status of a task that you submitted to this agent through the Surface API:

jq -n --arg id "$task" '{jsonrpc:"2.0",id:1,method:"GetTask",params:{id:$id}}' |
  curl -fsS --cacert .work/stack/ca.crt \
    -H "Authorization: Bearer $token" -H 'A2A-Version: 1.0' \
    -H 'Content-Type: application/json' --data-binary @- "$agent_url/rpc"

The caller's Surface API permissions still govern the read. The RPC reports a task not found if the identifier belongs to a different agent. Its result contains the task and context identifiers and current status.

Start and resume work

Send a ROLE_USER message with text parts and a stable messageId to SendMessage or SendStreamingMessage. Keep the message and its optional metadata.dacPlaneDeadline identical across retries. The deadline is an absolute RFC 3339 timestamp. Omit it to use one hour from the original submission. An initial task reserves 100 tokens against a 1,000-token ceiling. The agent profile supplies its providers. To start another task for the same agent in an existing conversation, send text with the conversation's contextId and a new messageId. Leave taskId out. The conversation belongs to the caller that started it.

Set configuration.returnImmediately on SendMessage to receive a task as soon as dac-plane admits it. The blocking form waits up to 20 seconds for an input request or final state. If that wait expires, retry with the same message or call SubscribeToTask with the returned task ID when you have it. Streaming returns the current task, then status and artifact updates. A caller can resume with the SSE event ID. Streams end at an input request, a final state, or the connection's two-minute limit.

ListTasks filters by status, context, and status update time. It reports the number of visible matches before pagination. Use includeArtifacts to request artifact links, with up to 20 tasks per page. On GetTask and ListTasks, set historyLength to the number of recent messages to include. On SendMessage and SendStreamingMessage, set it in configuration. Zero or an omitted value leaves history out. The owner can request up to ten messages per task, in chronological order. List pages that include history hold up to ten tasks.

History comes from task records. It includes the original objective, recorded questions and answers, approval decisions, and review dispositions. The brief keeps the original messageId when the submission recorded it. Earlier briefs and other entries use their record IDs. Runtime transcripts, original wire envelopes, and connector proposal inputs are outside the history. Each surface process allows up to 32 concurrent streams and blocking sends, capped at 8 slots per tenant so one tenant cannot exhaust the shared pool and 429 every other tenant. Each client is limited to 30 requests per second per surface process, keyed on the peer IP address (the peer the surface terminates TLS with). Callers that share an IP address, such as behind one NAT, share the 30-request budget even over separate TLS connections. When either limit is reached the surface returns HTTP 429 with Retry-After; wait for the retry interval before sending again. Use the same message ID when retrying a send.

An input request carries a structured action and the versions it references. Send one data part with the same task and context IDs and a new stable message ID:

Action Data fields
answer attentionId, attentionVersion, answers mapping each prompt ID to a one-element text array
review revisionId, taskVersion, decision set to accept or reject
approval attentionId, attentionVersion, decision set to deny or approve_once, and the confirmation fields below

For a runtime proposal, proposal shows the exact command and working directory or the exact file path. Show those fields and scope to the responder. Echo the proposal's actionDigest and scope object (its class and any target) on either decision. Read the task again if the version or confirmation is rejected. The responder sees the proposal. A tenant reader may see the task waiting for input without the proposal. If the reply's response is lost, resend it with the same message ID and confirmation fields.

For a connector proposal, echo inputDigest when choosing approve_once. When the runtime provides no scoped exact action, A2A offers only deny, without confirmation fields. This includes Codex file approvals that supply a grant root without the exact file path. Other decisions for those requests use the Surface API.

A task with exactly one open question of one prompt also accepts the answer as a single text part with its taskId, so a plain A2A client can continue it (ADR-0030). A retry with the same message ID changes nothing. Approvals, result reviews, several open questions and questions with several prompts require the structured action.

Artifact parts point to authenticated HTTPS downloads on the A2A surface. Use the Surface API bearer for that download. The Surface API serves the bytes through its configured artifact store.

Run protocol qualification

The HTTPS integration suite runs the approval replies against the public Surface API, disposable PostgreSQL and deterministic providers. Run it with Docker and Go using just test-integration-race ./internal/httpapi/ -run TestA2ARuntimeApprovalAndDenial. It checks approval and denial through task completion, refusal of a mismatched digest, scope or version, and proposal visibility for a tenant reader.

Run just qualify-a2a-task-reads with Docker, Go, and uv to verify pagination, filtered totals, artifact inclusion, and history with the official A2A Python SDK. The recipe uses the tenant-scoped card and a disposable PostgreSQL fixture. The task read decision records the Surface API fields the gateway uses.

From a dac-plane source checkout, run just qualify-a2a-tck with Docker, Go, Git, and uv installed. The recipe fetches the pinned official A2A TCK, installs its locked Python dependencies, and starts a disposable PostgreSQL database, Surface API, and simulated providers. The runner uses Python 3.15. Dependency setup can require a C++ toolchain to build gRPC.

The fixture exposes one agent on loopback HTTPS. It aliases root discovery to the agent card, supplies the fixture principal's bearer when the TCK sends none, and accepts the trailing slash the TCK client appends to the RPC URL. The production gateway serves the card and handles the JSON-RPC requests.

Each run prints its evidence directory under .work/a2a-tck/. Open tck/reports/compatibility.html for the requirement breakdown, or use compatibility.json and junitreport.xml from the same directory for automation. The recipe preserves those reports when the TCK exits with failures. See the qualification findings for the first run's results and the gaps that affect their interpretation.