Deployment architecture
Prerequisites
Before starting the gateway, generate a persistent ECDSA P-256 signing key and expose it asQWED_A2A_SIGNING_KEY_PEM. Attestation JWTs are signed with this key; without it the gateway fails closed (HTTP 503) on every request.
FastAPI application
Create your production entrypoint:Docker
Available endpoints
Gateway authentication
POST /a2a/intercept requires a per-agent API key in the X-API-Key header. Keys are configured through QWED_A2A_API_KEYS, a JSON object mapping each API key to the agent ID it authenticates:
- A missing or unknown
X-API-Keyreturns401 Invalid or missing API key. - If
QWED_A2A_API_KEYSis unset, malformed, or contains no usable entries, every request returns401 API authentication is not configured for this service.A deployment without configured keys denies all traffic. - Agent IDs in the map are normalized to the
AgentMessagecontract (trimmed, max 256 characters, no control characters). Entries that violate it are dropped and their keys denied.
sender_agent_id names a different agent, the gateway logs a warning and overrides it with the authenticated identity.
Key rotation. The gateway reads QWED_A2A_API_KEYS fresh on every request, so rotating keys takes effect without a restart. Update the environment variable (for example through your secrets manager) and old keys stop matching immediately.
Health check response
Metrics response
JWKS endpoint
GET /.well-known/jwks.json returns the current signing public key so downstream services can verify attestation JWTs without an out-of-band key exchange.
kid is derived from a SHA-256 fingerprint of the public key, so it remains stable across restarts as long as QWED_A2A_SIGNING_KEY_PEM is unchanged. When the PEM is missing or invalid, the endpoint responds with HTTP 503 Signing key unavailable — use this as a readiness signal for orchestrators and load balancers.
See Crypto attestations for the full JWT structure and verification flow.
Environment variables
Monitoring
Sentry integration
QWED A2A includes built-in Sentry integration for error tracking:Structured logging
All intercepts are logged with structured fields:CI/CD integration
GitHub Actions
Mergify auto-merge
Integration with QWED ecosystem
QWED Core
A2A uses the same verification principles as the core QWED engine — deterministic, symbolic, and provable.
QWED MCP
MCP provides tool-level verification. A2A provides agent-to-agent communication verification. They complement each other.
QWED Finance
The A2A finance guard uses the same Decimal arithmetic patterns as QWED Finance, adapted for inter-agent payloads.
Agent Specification
The QWED-Agent spec defines trust levels and budget enforcement. A2A implements the verification gateway described in the spec.