Overview
TheA2AVerificationInterceptor is the central component of QWED A2A. Every inter-agent message passes through it before reaching the recipient.
The
trace_id parameter is required and must be provided by the caller. This ensures all verdicts and JWT attestations are deterministic and auditable. The HTTP gateway (POST /a2a/intercept) generates this automatically.Verification pipeline
1
Schema Validation
The incoming
AgentMessage is validated by Pydantic:sender_agent_idandreceiver_agent_idmust be 1–256 chars, no control characterspayloadis required (dict)payload_typedefaults toGENERALif not specified- Timestamps are timezone-aware UTC
2
Trust Boundary
The trust boundary evaluates the sender→receiver pair:
- Global blocklist check
- Pair-level block check
- Allowlist check (in strict mode)
- Token-bucket rate limiting
3
Trusted Agent Bypass
If the sender is in
config.trusted_agents, the message is forwarded immediately with a bypass engine verdict.4
Engine Routing
Based on
payload_type, the message is routed to the appropriate verification engine.5
Verdict & Attestation
The engine result is wrapped in a
VerificationVerdict with an ES256 JWT attestation proving the verification took place.Verification engines
Finance guard
Verifies financial claims using deterministic Decimal arithmetic. Recomputes totals from line items and compares against theclaimed_total.
Logic guard
Detects logical contradictions — claims where the same proposition is both asserted and negated.Code guard
Scans code payloads for dangerous patterns using case-insensitive compiled regex:Passthrough
Messages withpayload_type of GENERAL or DATA_QUERY are forwarded without verification.
Configuration reference
TheInterceptorConfig controls which engines are active:
Error handling
Whenblock_on_error=True (default), any exception in a verification engine results in a BLOCKED verdict. When False, the message is FORWARDED despite the error — useful for observability-only deployments.
block_on_error=True (default)
block_on_error=True (default)
Engine exception →
BLOCKED verdict with error reason. Safe default for production.block_on_error=False (observability mode)
block_on_error=False (observability mode)
Engine exception →
FORWARDED verdict. The error is logged but doesn’t block communication. Use for shadow deployments.