Configuration Reference

Reference of the configuration options across a2a-rust crates; the builder and each type's rustdoc list the rest.

Server Configuration

RequestHandlerBuilder

OptionTypeDefaultDescription
with_agent_cardAgentCardRequiredDiscovery card for /.well-known/agent-card.json; the handler checks requests against what it declares
with_extended_agent_cardAgentCardNone: a card that declares extendedAgentCard answers ExtendedAgentCardNotConfiguredErrorWhat GetExtendedAgentCard serves to an authenticated caller (§3.1.11, §13.3); checked and advertised on like the public card
with_extended_card_providerimpl ExtendedCardProviderNone: every caller gets the extended card as setChooses each caller's extended card from the one set (§13.3 MAY); its card is checked like the configured one
without_agent_card()——Build without a card, which build() otherwise refuses (spec §8.1): for a card published elsewhere, or a handler that is not a public A2A server
with_task_storeimpl TaskStoreInMemoryTaskStore; TenantAwareInMemoryTaskStore when tasks are isolated by callerCustom task storage backend
with_task_store_configTaskStoreConfig1hr TTL, 10k capacityTTL and capacity for default store; per caller partition when tasks are isolated by caller, so the store holds up to 1,000 times the capacity
with_push_config_storeimpl PushConfigStoreInMemoryPushConfigStore; the tenant-aware one when the task store partitions by tenantCustom push config storage
with_push_senderimpl PushSenderNoneWebhook delivery implementation. Without one, every push-config operation answers PushNotificationNotSupported, and build() refuses a card that declares pushNotifications (spec §3.3.4)
with_interceptorimpl ServerInterceptorEmpty chainServer middleware
isolate_tasks_by_caller()—On, with an authenticating interceptorA partition per caller within a tenant (spec §13.1). On by default for the callers an authenticating interceptor identifies; calling it also refuses a request with no identity. See Multi-tenancy
share_tasks_across_callers()—OffEvery caller in a tenant sees its tasks, and build() accepts task and push-config stores that do not partition by tenant (a request that names a tenant is still refused over them unless accept_unisolated_tenants() is also called)
with_executor_timeoutDuration1 hourMax time for executor completion (DEFAULT_EXECUTOR_TIMEOUT); without_executor_timeout() removes the bound
with_event_queue_capacityusize256Bounded channel size per event queue. A reader that falls further behind than this catches up from the event log; raise it to reduce how often a slow reader has to.
with_max_event_sizeusize16 MiBMax serialized SSE event size
with_max_concurrent_streamsusize1,024Limit concurrent event queues: one per task being run, whether its send blocks or streams; a send that would open one more is refused as overloaded (pass usize::MAX to disable)
with_admissionAdmissionNone (refuse-only)A gate in front of the send path: a capacity, per-tenant reserved slots, a bounded wait inside the send's budget, priority classes and weighted rounds, all from server configuration. The build refuses a capacity of 0 or above with_max_concurrent_streams, and reservations past the capacity. See Multi-tenancy (ADR 0045)
with_load_reporting()—OffServe GET /load and add endpoint-load-metrics to every response of the crate's server and the axum router. See Health checks (ADR 0046)
with_metricsimpl MetricsOtelMetrics on the global meter provider (otel, on by default); NoopMetrics without itMetrics observer for handler activity
with_handler_limitsHandlerLimitsSee belowConfigurable validation limits
allow_undeclared_input_modes()—OffAccept message parts whose mediaType the card's input modes do not declare; by default, when the card declares any, such a part is refused with ContentTypeNotSupportedError
with_tenant_resolverimpl TenantResolverNone (single-tenant)Derives each request's tenant; it partitions the tenant-aware stores and keys with_tenant_config limits
require_resolved_tenant()—OffRefuse a request the resolver returns no tenant for, instead of serving the default "" partition
accept_unisolated_tenants()—OffBy default a request naming a tenant is refused (UnsupportedOperation) unless both stores partition by tenant
with_tenant_configPerTenantConfigNonePer-tenant max_concurrent_tasks, executor_timeout, event_queue_capacity and rate_limit_rps (the last also needs RateLimitInterceptor::with_tenant_config)
allow_unauthenticated_extended_card()—OffServe GetExtendedAgentCard with no authenticating interceptor (§13.3); by default it is refused
authenticated_upstream()—OffAccept a card whose securityRequirements ask for a credential although no interceptor here authenticates (a gateway does)
with_additional_metricsimpl Metrics—Also report to this observer, keeping the default
refuse_private_file_urls()—OffRefuse file-part URLs into private, loopback or link-local networks

HandlerLimits

FieldTypeDefaultDescription
max_id_lengthusize1,024Maximum task/context ID length
max_metadata_sizeusize1 MiBMaximum serialized metadata size
max_cancellation_tokensusize10,000Cleanup sweep threshold, not a hard cap: a live task's token is never removed
max_token_ageDuration1 hourStale token eviction age
push_delivery_timeoutDuration30sPer-webhook delivery timeout, retries included (the sender's own request timeout is 10s)
push_delivery_budgetDuration30sTime one event's deliveries are budgeted across all configs. Every config is attempted; the budget sets how many deliveries of an event run at once (ceil(configs / (budget / push_delivery_timeout)))
push_queue_capacityusize1024Deliveries that may wait behind the one under way for one task. A full lane drops the oldest that does not end a turn (dropped); a terminal or interrupted status is never dropped. Zero is read as one
push_suspend_afterusize5Failed deliveries to one webhook in a row before it is suspended; zero turns suspension off. A suspended webhook is skipped (suspended) for push_suspend_for, then one event is tried; the events that end a turn are always tried. Per replica, in memory
push_suspend_forDuration30sHow long a suspended webhook is left alone before one event is tried again; each failed probe doubles it, up to 32 times as long
push_remove_gonebooltrueRemove the config of a webhook that answers 410 Gone (gone). Only 410: a 404 counts as any other failure
push_max_in_flightusize512Webhook deliveries in flight at once across every task. A delivery over the bound waits, so every config is still attempted. The wait is bounded by push_delivery_timeout but does not spend it: the webhook's time starts when the delivery is let through, and one never let through is the outcome throttled (until 0.16.0 the wait counted against the timeout). Each delivery that waited is counted once as the error push_throttled on method PushDelivery. Covers any sender behind the handler, a custom one included. Zero is read as one. A choice, not a measurement
push_max_in_flight_per_hostusize64Deliveries in flight at once to one destination (host and port). Bounds how many requests a third party sees from this agent when a caller registers many webhooks at its address; not a rate limit. The same bound holds on each address the bundled sender connects to, so names that resolve to one address (a wildcard record) share its count. Raise it for one receiver that takes every agent's callbacks. Zero is read as one
push_max_in_flight_per_partitionusize256Deliveries in flight at once for one store partition (a tenant, or a tenant and caller where callers are isolated), so one caller's slow webhooks cannot hold every overall permit. A share, not a reservation: a deployment with one partition runs at most this many at once, so raise it with push_max_in_flight there. Zero is read as one
push_outbox_max_ageDuration24 hoursWith with_push_outbox: a delivery still not delivered this long after it was recorded is dropped when next due and counted expired. A choice, not a measurement
push_outbox_backoff_maxDuration1 hourWith with_push_outbox: the longest wait between two attempts of one delivery; the wait doubles from 1 s up to this, less up to a fifth of jitter
executor_drain_timeoutDuration5sBound on the blocking path's wait for the queue to close after the executor finished; also how long a continuation waits for a parked (input-required/auth-required) turn to finish: its executor to return and its events to be stored
max_artifacts_per_taskusize1,000Maximum artifacts per task (prevents O(n²) serialization)
max_context_locksusize10,000Max per-context locks before cleanup
max_push_configs_per_taskusize100Maximum push configs per task (uniform across store backends)
max_parts_per_artifactusize10,000Maximum parts a single artifact may accumulate
max_total_push_configsusize100,000Global push-config ceiling across all tasks
subscribe_reattach_intervalDuration250msThe first wait of a SubscribeToTask stream between turns before it checks the store: for the task finishing, the next turn's queue, or events logged meanwhile, which it replays. It doubles while nothing changes, up to the next row, and starts over at any change
subscribe_reattach_max_intervalDuration4sThe longest wait between two checks of an idle SubscribeToTask stream (audit E-F25); below the interval, no back-off. The first frame after a long quiet can be this late, unless the store wakes the stream (with_log_notifications, PostgreSQL only: the interval is then the least between two checks, and this ceiling the fallback if a notification is lost). subscribe_max_idle, when set, is still met at its own time
subscribe_max_idleOption<Duration>noneIf set, how long a SubscribeToTask stream waits on a parked task before ending without a terminal state; the client resubscribes. Unset, the stream ends at the terminal state or when the client goes (§3.1.6)
max_subscribers_per_taskusize256The most SubscribeToTask streams open on one task; one more is refused before any work as overloaded, with a retry delay on every binding (audit H5, ADR 0044)
max_subscribersusize10,000The most SubscribeToTask streams open on the handler, over all tasks, refused the same way; nothing else bounds them unless the server's max_connections is set
hand_off_windowDuration600sHow long the reaper leaves a turn a graceful shutdown handed back to its caller (an executor with resumes_after_hand_off, on a store with turn claims) before it ends the task failed, class transient; the caller continues the task inside it (ADR 0054)
subscribe_replay_limitusize1,000Maximum logged events one read of the event log returns, for a lag's catch-up, a missed turn or a Last-Event-ID resumption. The offset is client-supplied, so the cap bounds each read; a longer replay is read a page at a time
final_task_snapshotboolfalseWhether a stream sends the finished task once more, as a final Task, after its terminal state (§11.7); sent only when the store shows the finished task within subscribe_replay_catchup
subscribe_replay_catchupDuration2sHow long a resuming stream waits for the event log to catch up with what was already broadcast. Zero disables the wait; on expiry the shortfall is logged and counted under event_log_catchup
max_buffered_event_bytesOption<usize>NoneThe most bytes of events held in event queues at once, across every task: each event is charged its serialized size until its last holder (processor, subscriber, broadcast buffer) drops it. A write that finds it spent waits as long as for a full queue, then fails; a new turn is refused Overloaded while under a tenth is free (ADR 0047)
saturation_readinessOption<(u8, u8)>None(unready_at, ready_at) in percent of capacity: /ready answers 503 "saturated" from unready_at until utilization is at or below ready_at (ADR 0046). Off by default; prefer with_load_reporting for a balancer that reads load
store_write_retryDuration30sHow long a turn's event consumer goes on writing one event, to the log or the task, while the store answers it is unavailable for now (a lost connection, a restart, a lock or statement timeout): after 50 ms, then doubling up to 1 s. The events after it wait, in order. Zero writes each once; an outage longer than this still loses the event it was writing
terminal_confirmationTerminalConfirmationRequiredWhat a streaming client is told when the store does not confirm a terminal event (the write of completed, failed, canceled or rejected failed and a read back shows the task is not in that state, nothing answered within the queue's write timeout, or the processor had stopped). Required: the stream ends with an UNAVAILABLE error and GetTask says what the store holds, so no client hears that a task finished that the store does not record as finished. BestEffort: the event is delivered as emitted, as before 0.16.0, and the stream and GetTask can disagree. A write that lands later is still logged and sent to the webhooks

Build-time validation: max_id_length, max_metadata_size, and push_delivery_timeout must be non-zero. Zero values are rejected by RequestHandlerBuilder::build(), which refuses more than that: see Build-Time Validation for the full list.

TaskStoreConfig

FieldTypeDefaultDescription
max_capacityOption<usize>10,000Maximum stored tasks; oldest terminal tasks are evicted on overflow, then, as a last resort, the oldest working ones (counted: InMemoryTaskStore::live_evictions); a task waiting for input or authorization is not evicted unless parked_task_ttl is set, and a full store of them refuses a new task with 503 (size it above your concurrent in-flight and parked task count)
task_ttlOption<Duration>1 hourTTL for completed/failed tasks
parked_task_ttlOption<Duration>NoneHow long a task may sit waiting for input or authorization before it is evicted like a finished one (with_parked_task_ttl(Duration)). Unset: nothing parked expires. A task that expires is gone, not cancelled (counted: InMemoryTaskStore::parked_evictions); see ADR 0056
eviction_intervalu6464Writes between automatic eviction sweeps
max_page_sizeu321,000Cap a store applies to the page size of a list call. The ListTasks method itself refuses a pageSize outside 1 to 100 (InvalidParams) and lists 50 when none is given, so this matters for direct TaskStore::list callers and when set below 100
max_events_per_taskOption<usize>512Events one task's log keeps for Last-Event-ID resumption; None removes the bound. An attached stream that still owes older events holds them past it (spec §3.5.2)
max_held_events_factorOption<usize>8How many times max_events_per_task a task's log may keep while a stream still owes its oldest events (4,096 at the defaults); past it the stream ends with streamLagged. None is no ceiling; Some(1) holds nothing past the bound
idempotency_key_ttlOption<Duration>24 hoursHow long an idempotency key is honoured, matching the SQL stores' one day; None keeps keys forever
max_idempotency_keysOption<usize>100,000How many keys the index holds at once (per store, so per tenant partition); a send with a new key past it is refused with 503 / RESOURCE_EXHAUSTED and runs nothing, and no held key is evicted; None is no limit

RetentionPolicy

What purge_expired on the SQL stores removes; built with RetentionPolicy::new(terminal_max_age) and the with_* setters. See Retention, Erasure and Audit for why a persistent store deletes nothing unless asked.

FieldTypeDefaultDescription
terminal_max_ageDuration—Terminal tasks whose last update is older than this are deleted; required by new
batch_sizeu321,000Rows per DELETE; zero is taken as one
idempotency_key_max_ageOption<Duration>24 hoursIdempotency keys older than this are deleted, never below terminal_max_age; None keeps them
parked_max_ageOption<Duration>NoneTasks parked in input-required or auth-required whose last update is older than this are deleted, not cancelled, and a task with a live turn claim is skipped; None never deletes one. The idempotency-key age is raised to at least this; see ADR 0056
max_batchesOption<u32>NoneStop a sweep after this many batches; None runs until nothing is left
max_events_per_live_taskOption<u64>NoneCompact each live task's event log to its newest this many events, dropping only events the stored task already reflects; a reader resuming from before the cut is answered with the snapshot. 0 is taken as 1. None lets a live task's log grow for as long as it runs (ADR 0047)

InMemoryPushConfigStore

ConstructorDefaultDescription
::new()100Default max push configs per task
::with_max_configs_per_task(N)—Custom per-task push config limit
.with_max_total_configs(N)100,000Global ceiling across all tasks

DispatchConfig

Shared configuration for JSON-RPC, REST, and Axum dispatchers. Pass to JsonRpcDispatcher::with_config(), RestDispatcher::with_config(), or RestRouter::with_config().

FieldTypeDefaultDescription
max_request_body_sizeusize4 MiBLarger bodies return 413
body_read_timeoutDuration30sSlow loris protection
max_query_string_lengthusize4,096RestDispatcher only (not RestRouter, whose query parsing is Axum's); longer queries return 414
sse_keep_alive_intervalDuration30sPeriodic keep-alive comment interval for SSE streams
sse_channel_capacityusize64SSE response body channel buffer size
max_batch_sizeusize100Maximum requests in a JSON-RPC batch
require_version_headerbooltrueReject a data-plane request with no A2A-Version header as VersionNotSupported (spec §3.6.2: absent means 0.3)
agent_card_max_ageu323600Cache-Control: max-age, in seconds, for the public agent card; set it to how often the card changes (spec §8.6.1)
base_pathOption<String>nonewith_base_path("/agents/billing"): a path prefix a reverse proxy keeps, taken off a request's path before routing (the card is then under the prefix, a tenant segment after it); a request outside it is routed as before

GrpcConfig

Configuration for the gRPC dispatcher (requires grpc feature).

FieldTypeDefaultDescription
max_message_sizeusize4 MiBMaximum inbound/outbound message size
concurrency_limitusize256Max concurrent gRPC requests per connection
stream_channel_capacityusize64Bounded channel for streaming responses
require_version_headerbooltrueReject a call with no a2a-version metadata as VersionNotSupported

PushRetryPolicy

Configurable retry policy for HttpPushSender. Pass via HttpPushSender::with_retry_policy().

FieldTypeDefaultDescription
max_attemptsusize3Maximum delivery attempts
backoffVec<Duration>[1s, 2s]Backoff durations between retries

RateLimitConfig

FieldTypeDefaultDescription
requests_per_windowu64100Max requests per caller per window
window_secsu6460Window duration in seconds; set it with with_window(Duration), which rounds a fraction of a second up (with_window_secs is deprecated since 0.16.0)
trusted_proxy_hopsusize0How many X-Forwarded-For hops to trust (0 = ignore XFF entirely)
trusted_proxiesVec<TrustedProxy>[]Address ranges the proxies connect from; when set, XFF is believed only from a peer in one (no effect while trusted_proxy_hops is 0). RateLimitInterceptor::new logs a warning when hops are set and this is empty
forwarded_headerForwardedHeaderXForwardedForThe header the proxies write the client address into: X-Forwarded-For or RFC 7239 Forwarded (its for= parameter); only that one is read
max_bucketsusize10,000Bound on tracked caller buckets. When full of live buckets, callers without one share a single overflow bucket holding one caller's limit (RateLimitInterceptor::overflowed() counts its requests); they used to be refused outright, which locked every new caller out while max_buckets callers stayed active

ServeConfig

Limits for a Server (Server::bind(addr).await?.with_config(config)). The three shutdown phases run in order — completion_grace, then task_grace, then drain_timeout — and the gRPC and WebSocket dispatchers take the same ServeConfig through with_serve_config (ADR 0052): both apply max_connections, the three shutdown phases, drain_delay and production; the WebSocket dispatcher applies idle_timeout as its idle bound (with a Ping at half); neither applies header_read_timeout or the Host check. Their own with_max_connections, with_completion_grace, with_task_grace and with_drain_timeout are deprecated since 0.16.0.

FieldTypeDefaultDescription
max_connectionsOption<usize>NoneCeiling on connections served at once; None is unbounded
completion_graceDuration5sOn shutdown, how long in-flight tasks get to finish on their own before they are cancelled (DEFAULT_COMPLETION_GRACE)
task_graceDuration10sHow long cancelled tasks get to cancel what they delegated and write a terminal event (DEFAULT_TASK_GRACE)
drain_timeoutDuration15sHow long connections get to finish before they are reported abandoned (DEFAULT_DRAIN_TIMEOUT)
header_read_timeoutOption<Duration>30sHow long a peer may take to send complete request headers; None disables
idle_timeoutOption<Duration>75sHow long a connection may carry no traffic before it is closed; None disables
productionboolfalseServeConfig::production(): the server returns at once, accepting nothing, with ServeReport::refused saying why, when it would serve plaintext beyond loopback (unless tls_terminated_in_front) or a binding the handler's agent card does not declare
tls_terminated_in_frontboolfalseTLS ends before this listener (load balancer, ingress, mesh); silences the plaintext warning and lifts the production refusal for it (with_tls_terminated_in_front())

Other server types

TypeDefaults
CorsConfig::new(origin)allow_methods GET, POST, PUT, DELETE, OPTIONS; allow_headers content-type, authorization, a2a-version, a2a-extensions, last-event-id, x-a2a-notification-token; max_age_secs 86400
TenantStoreConfigmax_tenants 1,000 partitions (each caller's partition counts when tasks are isolated by caller); max_total_tasks none
WebSocketDispatcheron its own listener (serve_with_shutdown), or on the HTTP port through CombinedDispatcher::with_websocket / RestRouter::with_websocket (ADR 0055), where the listener settings (TLS, handshake timeout) are the HTTP server's and its own ServeConfig::max_connections (with_serve_config) caps upgrades; handshake timeout 10s (with_handshake_timeout); write timeout 30s (with_write_timeout: a peer that stops reading is dropped at it, and the connection with it); idle timeout DEFAULT_WS_IDLE_TIMEOUT, 75s, pinging at half (ServeConfig::idle_timeout, or with_idle_timeout, without_idle_timeout; off until 0.16.0); ServeConfig::max_connections unbounded; 64 concurrent requests per connection; 4 MiB messages
GrpcDispatcherHTTP/2 keep-alive: a PING after 60s idle (DEFAULT_GRPC_KEEPALIVE_INTERVAL), closing at 20s unanswered (DEFAULT_GRPC_KEEPALIVE_TIMEOUT; with_http2_keepalive, without_http2_keepalive; off until 0.16.0); ServeConfig::max_connections unbounded (with_serve_config); with_max_connection_age off; under with_rustls a 10s TLS handshake bound
ReloadingCertResolvernothing re-read until reload(), or every interval given to watch(interval)
HttpPushSender10s request timeout (HttpPushSender::with_timeout), 5s DNS lookup bound (with_dns_timeout), PushRetryPolicy above; SSRF guard on unless allow_private_urls()
JwtValidator, JwtAuthInterceptorclock-skew leeway 60s (JwtValidator::with_leeway); a remote JWKS is cached for 3,600s (JwtAuthInterceptor::with_jwks_ttl) and refetched for an unknown key id at most every 10s (with_jwks_refetch_interval)

Internal Limits

LimitValueDescription
Event queue typebroadcastFan-out to multiple subscribers; a reader that falls behind the ring catches up from the task's event log, and when the log cannot supply what it missed it receives a streamLagged error and its stream ends (no silent gap)
Rate limiter cleanup interval256 checksStale buckets (from departed callers) evicted every 256 check() calls
Rate limiter window CASLock-freeWindow transitions use compare_exchange to avoid TOCTOU races
Credential store poisoningFail-fastInMemoryCredentialsStore panics on poisoned locks rather than returning None

Client Configuration

ClientBuilder

OptionTypeDefaultDescription
with_protocol_bindingimpl Into<String>"JSONRPC" (new); the card's first supported interface (from_card); the first ranked one the card offers (from_card_preferring)Transport: "JSONRPC", "HTTP+JSON" (alias "REST"), or "GRPC" — the last needs build_grpc(); build() refuses it
with_timeoutDuration30sPer-request timeout, except a blocking send (below)
with_send_timeoutDuration600sBound on a SendMessage that waits for the turn to end (return_immediately false, not streaming): the agent's work, not a round trip
with_connection_timeoutDuration10sTCP connection timeout
with_stream_connect_timeoutDuration30sEstablishing a stream: until the response headers (gRPC: until the call is accepted)
with_stream_first_event_timeoutDuration5 minWait for a stream's first data (an event or a keep-alive) once established
with_max_event_sizeusize16 MiBLargest single stream event accepted; larger ones are refused and skipped
with_stream_idle_timeoutOption<Duration>5 minLongest an established stream may receive nothing — keep-alive comments count — after its first data; None disables
with_retry_policyRetryPolicyNoneRetry on transient errors with jittered backoff
with_accepted_output_modesVec<String>["text/plain", "application/json"]MIME types accepted
with_history_lengthu32NoneMessages in responses
with_return_immediatelyboolfalseDon't wait for completion
with_tenantimpl Into<String>None (auto from AgentCard)Tenant sent on every request (spec §8.3.2 rule 4); a per-request tenant overrides it
with_grpc_bare_address_schemeGrpcBareAddressSchemeHttpsExceptLoopbackHow build_grpc dials a card's bare host:port gRPC target: TLS except for loopback (default), always TLS, or always plaintext
with_tls_configrustls::ClientConfigMozilla roots plus SSL_CERT_FILE / SSL_CERT_DIRtls-rustls feature: the TLS the JSON-RPC and HTTP+JSON bindings use — a private CA, a pinned self-signed certificate, or a client certificate (tls::tls_config_from_pem builds one from PEM). Proxies come from HTTPS_PROXY / HTTP_PROXY / ALL_PROXY / NO_PROXY, for every binding: WebSocket and gRPC through a CONNECT tunnel
with_grpc_tls_configClientTlsConfigMozilla roots plus SSL_CERT_FILE / SSL_CERT_DIR; one you give is exact (transport::grpc::tls_config_from_pem keeps the defaults)grpc-tls feature: the TLS settings build_grpc uses for an https:// endpoint, explicit or policy-chosen — a private CA, a client certificate, or a server name that differs from the host
with_interceptorimpl CallInterceptorEmpty chainClient middleware
with_max_response_sizeusize32 MiBLargest buffered (non-streaming) response body; JSON-RPC and REST enforce it and gRPC takes it as its max_message_size. Not applied to a transport given to with_custom_transport (WebSocketTransport has its own max_message_size)
with_custom_transportimpl TransportNoneUse this transport instead of the one built from the endpoint and binding
with_trace_propagationbooltrueWhether each call's traceparent names the call's own span (otel)
require_https_webhooks()—OffRefuse a push config whose webhook URL is plain http:// to a non-loopback host (ClientError::InsecureWebhook, spec §13.2)
require_https_credentials()—OffRefuse a call that carries a credential to a non-loopback http:///ws:// endpoint (spec §13.4)
without_tls()—TLS on with tls-rustlsPlain HTTP only; build refuses an https:// endpoint
without_capability_checks()—OffA client built from a card refuses, before sending, a call that needs a capability the card does not declare (ClientError::CapabilityNotDeclared); this sends them anyway
with_extensions / skip_required_extension_check()extension URIsnoneAsk the agent to use these extensions on every request (A2A-Extensions). A client built from a card refuses to build when the card marks an extension required that it did not ask for; skip_required_extension_check() builds anyway

build() returns an error if request_timeout, send_timeout, stream_connect_timeout or connection_timeout is zero.

GrpcTransportConfig

Configuration for the gRPC client transport (requires grpc feature). The struct is #[non_exhaustive]: build it with GrpcTransportConfig::default() and the with_* setters.

FieldTypeDefaultDescription
timeoutDuration30sPer-request timeout, except a blocking send
send_timeoutDuration600sBound on a blocking SendMessage (see with_send_timeout above)
connect_timeoutDuration10sConnection timeout
max_message_sizeusize4 MiBMaximum message size
stream_channel_capacityusize64Streaming response buffer
http2_keep_alive_intervalOption<Duration>None (off)Interval of an HTTP/2 PING on the connection, quiet or not, so a load balancer's idle timeout does not close a long silent stream (with_http2_keep_alive, or ClientBuilder::with_grpc_keep_alive); off because a PING is hop-by-hop and grpc-go refuses a short interval
http2_keep_alive_timeoutDuration20sHow long to wait for the answer to such a PING before the connection is dropped; read only with the interval
bare_address_schemeGrpcBareAddressSchemeHttpsExceptLoopbackScheme used for a bare host:port target (an http:///https:// URL is used as-is)
tls_configOption<ClientTlsConfig>None (bundled Mozilla roots)grpc-tls feature: pin a private CA or present a client certificate for https:// endpoints

RetryPolicy

FieldTypeDefaultDescription
max_retriesu323Maximum retry attempts
initial_backoffDuration500msBackoff before first retry
max_backoffDuration30sCaps exponential growth
backoff_multiplierf642.0Multiplier per retry
budgetOption<RetryBudget>None (off)Retries as a bounded fraction of calls, so retries cannot multiply an overload (with_budget); a retry the budget cannot pay for is not made
max_elapsedOption<Duration>None (off)Longest from a call's first attempt to the start of its last retry, backoffs included (with_max_elapsed)

HttpPool (HttpPool::builder())

One set of HTTP connections that many clients share (ClientBuilder::with_pool; see Sharing connections). Every setting is fixed when build() is called. A zero duration is refused.

SetterTypeDefaultDescription
with_tls_configClientConfigMozilla roots plus SSL_CERT_FILE / SSL_CERT_DIRThe roots every connection of the pool trusts and any client certificate it presents. A client given the pool and its own TLS configuration fails at build().
with_connect_timeoutDuration10sTCP connect timeout. A client given the pool and with_connection_timeout fails at build().
with_idle_timeoutDuration50sHow long an unused connection is kept before it is closed in the background
with_max_idle_per_hostusizeno limitIdle connections kept per host
with_max_connection_lifetimeDurationnot recycledUse new connections once the current ones are this old, spread by up to 10% either way; calls and streams already running are not cut
with_http2_keep_alive(Duration, Duration)no PING(interval, timeout): an HTTP/2 PING every interval, idle or not, and a connection that does not answer within timeout is closed. Applies to connections that speak HTTP/2
with_http2_prior_knowledge—negotiateSpeak HTTP/2 without negotiating it, including over plain http://
with_ejectionEjectionoffA circuit breaker per origin shared by the pool's clients: consecutive_failures failures in a row open it for base, doubling up to max while its probe fails; calls are refused with CircuitOpen while open
with_max_in_flight_per_originusizeno capCalls waiting for a response from one origin across the pool's clients; one more is refused with TooManyPendingRequests. Zero is refused
with_retry_budgetRetryBudgetnoneOne retry budget per origin for every client of the pool, besides each client's own

BalancePolicy (ClientBuilder::with_balancing)

How a client spreads calls over the endpoints of an EndpointSource (see Behind a load balancer).

FieldTypeDefaultDescription
ejectionOption<Ejection>Ejection::default(): 5 failures in a row, 30 s doubling to 300 sWhen an endpoint is taken out of rotation; on a pool, the pool's policy applies and setting this is refused
max_ejected_percentu850The most of the set out of rotation at once, rounded down; 100 lets every endpoint out, and calls then fail with CircuitOpen
hedgeOption<Hedge>None (off)Hedge { delay, budget }: a slow idempotent unary call is copied to a second endpoint after delay, paid from budget (default 5% of calls, reserve 1)

DnsEndpoints resolves its name again every 30 s by default (with_refresh_every).

SSE Parser Limits

LimitValueDescription
Event size16 MiB (ClientBuilder::with_max_event_size)Largest single stream event; larger ones are refused with an error and skipped, and a line that outgrows it is refused as soon as it does (aligned with server)
Stream connect timeout30s (with_stream_connect_timeout)Until the response headers; the first event then has its own 5-minute bound

HTTP Caching (Agent Card)

HeaderDefaultDescription
Cache-Controlpublic, max-age=3600Configurable max-age (default 1 hour)
ETagAuto-computedContent hash
Last-ModifiedStatic handler: the running executable's modification time (replicas of one build agree); with_last_modified sets itNot sent by the dynamic handler, which has no modification date

Feature Flags

a2a-protocol-server

FeatureDefaultDescription
signingOffForwards a2a-protocol-types/signing; the server itself neither signs nor verifies the card it serves
tracingOnStructured logging via tracing crate; default-features = false compiles it out
tls-rustlsOnHTTPS delivery for the bundled push-notification sender, JWKS/OIDC fetches and the model client, Server::with_tls / with_tls_pem (HTTPS on its own listener), and auth::MutualTlsAuthInterceptor; on by default since 0.16.0
sqliteOffSQLite-backed task and push config stores via sqlx
postgresOffPostgreSQL-backed task and push config stores via sqlx
websocketOffWebSocket transport via tokio-tungstenite
grpcOffgRPC transport via tonic (plaintext listener)
grpc-tlsOffTLS on the gRPC listener itself: GrpcDispatcher::with_tls(ServerTlsConfig) with a server identity and, optionally, a client CA for mutual TLS; implies grpc; the TLS types are re-exported from dispatch::grpc
otelOnOtelMetrics and the spans' OpenTelemetry bridge, through the OpenTelemetry API only (implies tracing)
otlpOffTelemetry: OTLP export of traces, metrics and logs (gRPC or HTTP/protobuf), the Langfuse preset, and init_otlp_pipeline (implies otel)
otlp-jsonOffOTLP/HTTP with JSON bodies (OtlpProtocol::HttpJson); off because opentelemetry-otlp's http-json also makes JSON the default of any exporter built without a protocol (implies otlp)
otel-prometheusOffOTEL_METRICS_EXPORTER=prometheus: serve the metrics at /metrics for a Prometheus that scrapes, with no collector in between; off by default because it adds opentelemetry-prometheus and a listener (implies otlp)
conformanceOffA harness that grades an AgentExecutor against the protocol's invariants
axumOffAxum framework integration (RestRouter)
tool-loopOffTool calling inside a task: tool_loop::ToolLoop, ToolLoopExecutor, OpenAiChatModel
skillsOffAgent Skills in the tool loop, scripts never run: skills::SkillCatalog, ToolLoopExecutor::with_skills (ADR 0035; implies tool-loop)
auth-jwtOffJWT bearer-token authentication (JwtAuthInterceptor)
encryptionOffEncryption at rest for task content (EncryptedTaskStore)
auditOffTamper-evident audit trail (RequestHandlerBuilder::with_audit, ADR 0015): calls, runs, task events and cancel requests in a SHA-256 hash chain per tenant, signed checkpoints, legal holds, a six-month retention floor; SQLite/PostgreSQL audit stores with those features

a2a-protocol-client

FeatureDefaultDescription
signingOffForwards a2a-protocol-types/signing; the client itself neither signs nor verifies anything
tracingOnStructured logging via tracing crate, and a CLIENT span per call; default-features = false compiles both out
otelOnEach call's traceparent names the call's own span when a tracing-opentelemetry layer records it (implies tracing)
tls-rustlsOnHTTPS via rustls (no OpenSSL dependency); default-features = false for a plaintext-only build
websocketOffWebSocket transport via tokio-tungstenite
grpcOffgRPC transport via tonic (plaintext; https:// is refused with a message naming grpc-tls)
grpc-tlsOffgRPC over TLS: implies grpc (not tls-rustls), verifies against the bundled Mozilla roots or a supplied ClientTlsConfig (re-exported from transport::grpc)
testingOffA scripted hostile peer (testing::ScriptedPeer) that stalls, cuts off, mis-frames or refuses on each binding, for testing code that calls agents
webhookOnThe push-notification webhook receiver (webhook::WebhookReceiver): token and Authorization checks, task-id check, duplicate suppression, optional rate limit (spec §4.3.3, §13.2)

a2a-protocol-types

FeatureDefaultDescription
signingOffJWS/ES256 agent card signing (RFC 8785 canonicalization)
auditOffAudit record schema, hash chains, ES256/Ed25519-signed checkpoints and chain verification (audit::verify_chain); implies signing
protoOffCanonical protobuf message types and the JSON⇄proto conversions (turned on by grpc)

a2a-protocol-sdk (umbrella)

FeatureDefaultDescription
signingOffEnables signing in all sub-crates
tracingOnEnables tracing in client and server
tls-rustlsOnEnables tls-rustls in client and server
grpcOffEnables grpc in client and server
grpc-tlsOffEnables grpc-tls in the client and the server (and tls-rustls): https:// dialling on one side, GrpcDispatcher::with_tls on the other
websocketOffEnables websocket in client and server
sqliteOffEnables sqlite in the server
postgresOffEnables postgres in the server
otelOnEnables otel in the server and the client
otlpOnEnables the server's otlp (implies otel)
otlp-jsonOffEnables the server's otlp-json (implies otlp)
otel-prometheusOffEnables the server's otel-prometheus: OTEL_METRICS_EXPORTER=prometheus serves /metrics (off by default; implies otlp)
axumOffEnables axum in the server
tool-loopOffEnables tool-loop in the server
skillsOffEnables skills in the server (implies tool-loop)
auth-jwtOffEnables auth-jwt in the server
encryptionOffEnables encryption in the server
auditOffEnables audit in the server and in a2a-protocol-types
webhookOnEnables webhook in the client

Environment Variables

VariableDescription
RUST_LOGLog level filter (when the tracing feature is enabled — the client's, server's and SDK's default — and the application's subscriber reads it)
A2A_PROXY_LOOPBACKRead by the client and the server's outbound HTTP, gRPC and WebSocket paths. Loopback (localhost, 127.0.0.0/8, ::1) is never sent to the proxy named by HTTP_PROXY / HTTPS_PROXY / ALL_PROXY unless this is 1, true, yes or on. NO_PROXY entries are read as Go reads them: *.example.com works, an entry with a port is ignored with a warning.
OTEL_*Read by Telemetry (server otlp feature, on in the SDK) and the OpenTelemetry crates beneath it: OTEL_SDK_DISABLED, OTEL_TRACES_EXPORTER / OTEL_METRICS_EXPORTER / OTEL_LOGS_EXPORTER (a list of otlp, console and, for metrics with the otel-prometheus feature, prometheus; or none), OTEL_EXPORTER_OTLP_ENDPOINT / _PROTOCOL / _HEADERS / _COMPRESSION / _TIMEOUT (10 s) / _CERTIFICATE / _CLIENT_CERTIFICATE / _CLIENT_KEY and their per-signal forms, _INSECURE (only for a scheme-less OTLP/gRPC endpoint), OTEL_EXPORTER_PROMETHEUS_HOST / _PORT, OTEL_PROPAGATORS, OTEL_SERVICE_NAME, OTEL_RESOURCE_ATTRIBUTES; and HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, NO_PROXY for the export; see Observability
LANGFUSE_PUBLIC_KEY, LANGFUSE_SECRET_KEY, LANGFUSE_BASE_URLRead by Langfuse::from_env(); the base URL defaults to http://localhost:3000
PROTOCThe proto/grpc build scripts use a vendored protoc unless this names another
SSL_CERT_FILE, SSL_CERT_DIRA PEM file, and a directory of PEM files, of CA certificates trusted beside the bundled Mozilla roots: by the client (every binding, gRPC included, card discovery, JWKS and the token provider) and by the server's push delivery, JWKS and OIDC discovery and the tool loop's model client (telemetry export takes OTEL_EXPORTER_OTLP_CERTIFICATE instead). Read once per process; a file that cannot be read is reported and skipped, never replacing the bundled roots
HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, NO_PROXY (and lower-case)Not only the telemetry export's: the client's HTTP, gRPC and WebSocket transports, and the server's push delivery, JWKS and OIDC fetches go through them; loopback never does unless A2A_PROXY_LOOPBACK says so
HOSTNAME (COMPUTERNAME on Windows)The replica's name in a turn claim, and the telemetry resource's host.name; Kubernetes sets it to the pod's name
NO_COLORSet, the subscriber Telemetry installs writes no colour
A2A_TEST_POSTGRES_URLTests only: the PostgreSQL the #[ignore]d live tests run against (scripts/run_postgres_suites.py)

What each binary in the repository reads

The SDK's crates read only the variables above. Each example and tool reads its own, and they were named one binary at a time, so the same setting has more than one spelling (ADR 0040 records why none is renamed in 0.16.0, and the rule for new ones: a platform's name where a platform injects it, A2A_ otherwise). Every one of them also reads OTEL_*. Read from each crate's source (std::env::var calls) on 2026-11-04.

SettingVariableRead by
Where to listenPORT (all addresses)deploy-agent
A2A_BIND_ADDR (host:port)echo-agent, genai-agent, rig-agent, mcp-agent, multi-lang-team (each starts its server mode when it is set)
SUT_HOSTtck/sut
none: 127.0.0.1:3000hello-agent
Extra listenersA2A_GRPC_BIND_ADDR, A2A_WS_BIND_ADDRecho-agent
A2A_GRPC_ADDR, A2A_WS_ADDRgenai-agent
SUT_GRPC_HOST, SUT_WS_HOSTtck/sut
The URL on the agent cardAGENT_URLdeploy-agent
A2A_PUBLIC_URLthe five A2A_BIND_ADDR examples; unset, the card names the bound address, or http://localhost:<port> for a bind to every address (0.0.0.0, [::]), which a client elsewhere cannot use
SUT_ADVERTISE_URL, SUT_GRPC_ADVERTISE_URL, SUT_WS_ADVERTISE_URLtck/sut
Another agent to callA2A_AGENT_URL (the remote agent: not the card URL above, despite the name)mcp-bridge
DatabaseA2A_DATABASE_URL, else DATABASE_URL with a warning; DATABASE_POOL_SIZE, DATABASE_PUSH_POOL_SIZE, TASK_RETENTION_HOURSdeploy-agent
A2A_TEST_POSTGRES_URLresilient-agent, incident-response (their PostgreSQL acts)
Shutdown and versionDRAIN_DELAY_SECONDS, AGENT_VERSIONdeploy-agent
Model endpointOPENAI_BASE_URL, OPENAI_API_KEYrig-agent, mcp-agent
TOOL_LOOP_BASE_URL, TOOL_LOOP_API_KEYtool-loop-agent
LIVE_BASE_URLlive-model
SWARM_LLM_URLswarm
Model, thinking, output capGENAI_MODEL, GENAI_THINKING, GENAI_MAX_TOKENSgenai-agent
RIG_MODEL, RIG_THINKING, RIG_MAX_TOKENSrig-agent (mcp-agent reads RIG_MODEL too, with MCP_THINKING, MCP_MAX_TOKENS)
INCIDENT_MODEL, INCIDENT_THINKING, INCIDENT_MAX_TOKENSincident-response
LIVE_MODEL, LIVE_THINKING, LIVE_EXTRA_BODY, LIVE_MODEL_TIMEOUT_SECSlive-model
TOOL_LOOP_MODEL, TOOL_LOOP_THINKING, TOOL_LOOP_EXTRA_BODY, TOOL_LOOP_MODEL_TIMEOUT_SECStool-loop-agent
Authentication and limitsA2A_API_KEY, A2A_BEARER_TOKEN, A2A_JWT_HS256_SECRET, A2A_JWT_ISS, A2A_JWT_AUD, A2A_MAX_CONCURRENT_TASKS, A2A_ALLOW_PRIVATE_WEBHOOKS, A2A_ALLOW_FALLBACKgenai-agent
A2A_INTEROP_API_KEY, A2A_INTEROP_CARDecho-agent (the Go interop legs)
Test-run switchesRESILIENT_REQUIRE_ALL, INCIDENT_REQUIRE_ALL, INCIDENT_EXIT_WHEN_DONE, SWARM_* sizes, SWARM_DEBUG, SUT_PROFILEresilient-agent, incident-response, swarm, tck/sut
OtherMCP_SERVER_BINmcp-agent (the tool server it spawns)
LANGFUSE_*langfuse-agent, through Langfuse::from_env()
none of its owna2a (the CLI is configured by flags; it reads the SDK's variables above)

Examples:

RUST_LOG=info              # Info and above
RUST_LOG=debug             # Debug and above
RUST_LOG=a2a_protocol_server=debug  # Debug for server crate only
RUST_LOG=a2a_protocol_server=trace,a2a_protocol_client=debug  # Per-crate levels

Next Steps