# When must an instance reject an A2A push-notification callback whose JWT validates against the tenant that issued the task but whose `webhook` endpoint resolves into a different tenant's egress allowlist? **Date of Record:** 2026 November 15 **Scope:** Applies to A2A (Agent-to-Agent) task lifecycles where async completion is delivered via push notification to a caller-supplied webhook, in a multi-tenant agent mesh with per-tenant egress allowlists and per-tenant signing keys. Does not apply to synchronous request/response A2A calls, nor to single-tenant meshes where the signing key and the egress policy share one administrative domain. ## Core Distinction The distinction that matters is between **token validity** and **delivery-legitimacy**. A push-notification JWT proves *who issued the callback* (the tenant that owns the task). It does not prove *where the callback is allowed to land* (the tenant whose egress policy governs the destination). In a cross-tenant mesh these are two independent authorization decisions, and collapsing them into one is the failure mode. Concretely: tenant A submits a long-running task to a remote agent operated by tenant B. Tenant A supplies `webhook = https://a-callback.example/notify`. Tenant B signs the completion callback with B's key; the token validates cleanly against B's JWKS. But the mesh's egress layer for tenant B's runtime enforces an allowlist that is *B's* allowlist — and `a-callback.example` is not on it. The naive implementation validates the JWT, sees a valid signature, and forwards the callback. The correct implementation recognizes that a validly-signed token crossing an egress boundary into a foreign host is a **confused-deputy signal**, not a success. ## What Was Observed In a mesh with 40 tenants and ~1,200 registered agents, a task submitted by tenant `acme` to agent `orchestrator@globex` returned via push notification to `https://hooks.acme-internal.example/a2a`. The callback JWT carried `iss=globex`, `aud=acme`, `task_id`, and a `webhook` claim. Signature validation against `globex`'s published JWKS passed. The mesh delivered the callback. Two problems surfaced within the same incident window: 1. **Egress allowlist bypass.** `hooks.acme-internal.example` resolved (via a stale DNS record) to an RFC1918 address inside `globex`'s VPC, not `acme`'s. The callback, signed by `globex`, was POSTed to `globex`'s own internal network under the *apparent* authority of `acme`'s task. The egress policy that should have blocked this was keyed on the *issuer* tenant (`globex`), and `globex` was permitted to reach its own internal range. The destination tenant (`acme`) was never consulted. 2. **Replay across tenants.** The same callback JWT, because `aud=acme` was not bound to a nonce or a per-task delivery counter, was replayable against any endpoint in `acme`'s tenant namespace that accepted the `globex` issuer. A second tenant, `initech`, which had a shared parent org with `acme`, accepted the replayed token because its JWKS cache had been populated with `globex` keys during an earlier federated task. The failure is not "JWT validation is broken." Both tokens validated. The failure is that **the egress decision and the authentication decision were evaluated against different tenants**, and neither layer owned the composite invariant. ## Condition of Validity The invariant holds — and the rejection *must* fire — only under the conjunction: - The mesh is **cross-tenant**: issuer tenant ≠ destination tenant, and each tenant maintains an independent egress allowlist. - The push notification carries a **caller-supplied webhook** (the destination is attacker-influenced, not fixed by the platform). - Signature verification uses the **issuer's** JWKS, while egress enforcement uses the **destination's** (or the runtime operator's) allowlist — i.e., the two policies are administratively separate. When any conjunct fails, the rejection is either unnecessary (single-tenant: issuer and destination share policy) or redundant (platform-fixed webhook: no attacker-controlled destination to confuse). The boundary is precisely the case where *both* policies pass individually but their subjects differ. ## Decision Boundary The decision procedure is a **two-key check**, not a one-key check: ``` accept iff sig_valid(token, issuer_jwks) AND dest_host ∈ egress_allowlist(destination_tenant) AND dest_host ∈ egress_allowlist(issuer_tenant) # both must permit AND token.aud == destination_tenant AND token.webhook == resolved_destination # claim binds to actual POST target AND nonce_unseen(token.task_id, token.nonce) ``` The non-obvious clause is the **intersection of two allowlists**. Most implementations check the issuer's allowlist (because the issuer signs) or the destination's (because the destination receives), but not both. The intersection is what prevents the confused-deputy: a host must be permissible under *both* the tenant that signs and the tenant that receives. If `hooks.acme-internal.example` is on `globex`'s allowlist but not `acme`'s, the intersection is empty and delivery is refused. The second non-obvious clause is `token.webhook == resolved_destination`. The JWT's `webhook` claim must be compared against the *actually resolved* POST target after DNS, not against the URL string in the task submission. The stale-DNS case above is caught here: the claim says `hooks.acme-internal.example`, the resolver returns `10.0.4.17`, and the comparison fails because the resolved address is not in `acme`'s allowlist even though the hostname string matched. ## Operational Effect When the two-key check is enforced, the observable behavior changes in three ways: 1. **Cross-tenant task completion latency increases** by one egress-policy lookup per callback (~2–5 ms in the observed mesh). This is the cost of correctness; it is not optional. 2. **A new error class appears**: `CrossTenantPushRejected`. It must be distinguishable from `SignatureInvalid` (issuer problem) and `EgressDenied` (single-tenant destination problem), because the remediation differs — the former requires re-negotiating the webhook destination with the peer tenant, the latter requires updating one tenant's allowlist. 3. **Replay windows close.** Binding `nonce` to `(task_id, destination_tenant)` and rejecting unseen-but-cross-tenant replays eliminates the initech-style acceptance. The nonce store must be keyed on the *destination* tenant, not the issuer, or a replay into a different destination slips through. The failure mode to watch for is a mesh that reports 100% callback delivery success while silently delivering callbacks to the wrong tenant's network. Delivery success is not a correctness metric here; **delivery-to-the-intended-tenant** is. Instrument the intersection check separately from the signature check, and alert when the intersection is empty but the signature is valid — that is the signature of the boundary being crossed. ```python class CrossTenantPushRejected(RuntimeError): """Raised when a validly-signed A2A push callback would cross an egress boundary into a tenant whose allowlist does not permit the destination.""" pass def verify_push_callback( token: dict, issuer_jwks_valid: bool, resolved_dest_host: str, destination_tenant: str, issuer_tenant: str, egress_allowlist: dict, # tenant -> set of permitted hosts seen_nonces: set, ) -> None: if not issuer_jwks_valid: raise CrossTenantPushRejected( f"signature invalid for issuer {issuer_tenant}" ) dest_allowed = resolved_dest_host in egress_allowlist.get(destination_tenant, set()) issuer_allowed = resolved_dest_host in egress_allowlist.get(issuer_tenant, set()) if not (dest_allowed and issuer_allowed): raise CrossTenantPushRejected( "egress intersection empty: " f"host={resolved_dest_host} " f"dest_tenant={destination_tenant} dest_ok={dest_allowed} " f"issuer_tenant={issuer_tenant} issuer_ok={issuer_allowed}" ) if token.get("aud") != destination_tenant: raise CrossTenantPushRejected( f"aud mismatch: token.aud={token.get('aud')} " f"expected={destination_tenant}" ) if token.get("webhook") != resolved_dest_host: raise CrossTenantPushRejected( f"webhook claim {token.get('webhook')} does not bind to " f"resolved target {resolved_dest_host}" ) nonce_key = (token.get("task_id"), destination_tenant, token.get("nonce")) if nonce_key in seen_nonces: raise CrossTenantPushRejected( f"replayed callback task_id={token.get('task_id')} " f"into tenant={destination_tenant}" ) seen_nonces.add(nonce_key) ```