What happens when an instance negotiates a capability lease against a stale latency profile and the SLA clock starts before the handoff completes
**Date of Record:** 2026 December 2 **Scope:** Applies to cross-org federated routing where a caller agent selects a peer agent via a latency-aware capability negotiation protocol (capability advertisement + measured RTT/queue-depth profile) and binds an SLA before the actual task handoff. Does not apply to single-org routing, static capability registries with no latency term, or fire-and-forget dispatch with no SLA.
Core Distinction
There are two clocks in a federated agent handoff, and they are not the same clock:
- **The negotiation clock** — the wall time during which the caller probes the peer, exchanges capability/schema terms, and measures latency. This clock measures the *peer as observed during negotiation*.
- **The SLA clock** — the wall time during which the caller is contractually on the hook for the peer's completion. This clock measures the *peer as it will behave during execution*.
The failure mode is not "slow peer." It is that the SLA clock is armed at negotiation *acceptance* time, but the peer's latency profile that justified selection was sampled *before* the handoff payload was serialized and transmitted. Between those two instants, the peer's queue depth typically rises (because it is now also absorbing the handoff), and the caller's measured RTT no longer describes the system that the SLA is measuring. The invariant that breaks is: **the latency profile used to admit a peer must be sampled over the same interval that the SLA will be enforced over.** Negotiation-time probes and execution-time behavior are different populations.
What Was Observed
A federated deployment across two orgs: Org A (caller orchestrator, agent `router-a`) and Org B (capability provider, pool of `worker-b-*` agents). Negotiation is a three-message exchange over the agent transport:
- `router-a` sends `capability_probe{required: [tool.schema_v3, region.eu]}`.
- `worker-b-*` replies `capability_offer{tools, schema_hash, latency_profile: {p50: 41ms, p95: 88ms, sampled_at: T0, window: 60s}}`.
- `router-a` selects the peer with the lowest p95, sends `lease_bind{sla: {deadline_ms: 4000}, payload_ref}`, and arms the SLA clock at `T_bind`.
Under steady load this works: p95 of 88ms with a 4000ms deadline gives ~45x headroom. The observed failure appeared only under a specific correlation: **when the handoff payload was large enough that serialization plus transport of `payload_ref`'s resolved content itself took longer than the probe window.** In the incident, `router-a` negotiated against `worker-b-3` whose latency profile was sampled over a 60s window ending at `T0`. At `T0+2ms` the router resolved a 9.4 MB context bundle and shipped it. `worker-b-3`'s queue depth went from 2 to 11 because three other `router-a` instances were doing the same thing against the same peer (the pool was small and the p95 ranking was *correlated* — every router picked the same lowest-p95 worker). The SLA clock armed at `T_bind` and expired at `T_bind+4000ms`. The worker did not begin executing until `T_bind+6100ms`. The SLA breached not because the worker was slow in any per-task sense — its execution time was 340ms, well inside profile — but because the *admission decision* was made on a profile that excluded the load the admission itself created.
Three properties made this non-obvious:
- The latency profile was *honest at sample time*. `worker-b-3` was genuinely p95=88ms over the window ending at T0. The profile was not stale in the sense of "old data"; it was stale in the sense of "sampled from a different load regime."
- The ranking was *self-defeating*. Because selection is `argmin(p95)`, all routers converge on the same peer, which is precisely the peer whose p95 will degrade first. The protocol's own selection function is the load generator for its own failure.
- The SLA breach was *attributed to the wrong party*. `router-a`'s SLA monitor recorded a provider-side breach; `worker-b-3`'s execution log recorded a 340ms task well inside profile. Both were correct. The breach lived in the gap between them.
Condition of Validity
The invariant "negotiation-time latency profile predicts SLA-interval latency" holds only when all of the following are true:
- **Load stationarity across the handoff.** The peer's queue depth distribution during `[T_bind, T_deadline]` is drawn from the same distribution as `[T0-window, T0]`. This is violated whenever admission decisions are correlated across callers (herding) or whenever the handoff payload itself contributes queue depth.
- **Profile window does not overlap the handoff.** If the probe window includes the serialization and transmission of a prior handoff, the profile is contaminated by exactly the load the SLA will measure — which sounds good but actually biases the profile *upward* for busy peers and *downward* for peers that happened to be idle during the window, worsening the herding.
- **Capability terms are stable across the handoff.** If the peer's `schema_hash` changes between offer and execution (e.g., Org B rolls a tool schema), the SLA is enforcing against a capability that no longer exists; latency is irrelevant because the task will fail on schema mismatch regardless of timing.
- **The SLA deadline is measured from first-byte-of-execution, not from bind.** If the contract measures from `T_bind`, it silently includes transport and queueing, which the negotiation profile does not describe.
The failure is *in scope* when the peer pool is small relative to the caller count (herding is likely), when handoff payloads are large relative to the probe window (self-induced queueing), and when the SLA is measured from bind. It is *out of scope* for single-caller deployments, for pools where selection includes a load-spreading term (e.g., `argmin(p95 + λ·inflight)`), or for SLAs measured from execution start.
Decision Boundary
The boundary is between **admitting a peer on a latency profile** and **admitting a peer on a latency profile conditioned on the admission**. Concretely:
- If the caller can observe the peer's *current inflight count* at bind time, it can condition: `effective_p95 ≈ p95 · f(inflight)`. Admit only if `effective_p95 · expected_payload_serialization < deadline · safety_factor`. This requires the peer to expose inflight in the capability offer, which most do not.
- If the caller cannot observe inflight, it must either (a) randomize among the top-k peers by p95 rather than taking argmin, to break herding, or (b) measure the SLA from first-byte-of-execution and treat queue time as a separate, non-SLA budget.
- If neither is possible, the caller must treat the negotiation profile as a *capability filter* (is this peer in the right region, does it have the tool) and not as a *latency admission gate*. Latency admission under herding without inflight visibility is unsound.
The decision boundary is therefore: **you may use a latency profile for admission only if you can either decorrelate selection or observe the load your selection induces.** Absent both, the profile is a capability fact, not a performance guarantee.
Operational Effect
The practical consequence is a class of SLA breaches that are invisible to per-party monitoring. The caller records a breach; the provider records compliance; the transport records normal RTT; and the only place the failure is visible is in the *correlation* between admission decisions across callers and the peer's queue-depth trajectory. Post-hoc, this looks like a "mysterious" p99 spike on a peer that was "fine" by its own metrics.
The guardrail that bounds it: **arm the SLA clock at first-byte-of-execution, and require the capability offer to include an inflight-count field that the caller must use as a tiebreaker.** If the offer lacks inflight, the caller must fall back to top-k randomization with k≥3 and must not claim an SLA tighter than `p95_max · (1 + expected_concurrent_callers)`. The second clause is the important one: it forces the caller to acknowledge that its own selection function is a load source, and it makes the SLA a function of the federation's concurrency, not of a single peer's probe.
A second guardrail: **schema-hash pinning across the handoff.** If `schema_hash` at execution differs from `schema_hash` at offer, the lease is void and the SLA does not start — the task is re-negotiated rather than failed. This prevents the "latency-compliant but schema-invalid" breach that masquerades as a timeout.
import time
from dataclasses import dataclass
class StaleLatencyProfileError(RuntimeError):
"""Raised when an SLA lease is bound against a latency profile that
cannot describe the interval the SLA will be enforced over."""
pass
@dataclass
class CapabilityOffer:
peer_id: str
schema_hash: str
p95_ms: float
sampled_at: float
window_s: float
inflight: int | None # None means the peer did not expose load
@dataclass
class Lease:
peer_id: str
schema_hash: str
deadline_ms: float
bound_at: float
clock_origin: str # "bind" or "execution"
SAFETY_FACTOR = 0.6
MAX_CONCURRENT_CALLERS = 4
def bind_lease(
offer: CapabilityOffer,
payload_bytes: int,
deadline_ms: float,
clock_origin: str,
now: float,
) -> Lease:
# Guard 1: profile must not be older than its own window relative to bind.
if now - offer.sampled_at > offer.window_s:
raise StaleLatencyProfileError(
f"peer {offer.peer_id}: profile age {now - offer.sampled_at:.2f}s "
f"exceeds sampling window {offer.window_s:.2f}s"
)
# Guard 2: if the peer exposes inflight, condition the profile on it.
# If it does not, we must assume worst-case herding across callers.
if offer.inflight is not None:
effective_p95 = offer.p95_ms * (1 + offer.inflight) ** 0.5
else:
effective_p95 = offer.p95_ms * MAX_CONCURRENT_CALLERS
# Guard 3: the handoff payload itself contributes queue depth; account
# for serialization+transport as a fraction of the deadline.
serialization_ms = payload_bytes / 1_000_000 * 50.0 # ~50ms/MB
projected_ms = effective_p95 + serialization_ms
if projected_ms > deadline_ms * SAFETY_FACTOR:
raise StaleLatencyProfileError(
f"peer {offer.peer_id}: projected {projected_ms:.1f}ms "
f"(p95={offer.p95_ms:.1f}ms, inflight={offer.inflight}, "
f"payload={payload_bytes}B) exceeds "
f"{SAFETY_FACTOR:.0%} of deadline {deadline_ms:.1f}ms"
)
# Guard 4: SLA clock must not include queueing unless the profile
# explicitly models queueing (i.e. inflight was exposed).
if clock_origin == "bind" and offer.inflight is None:
raise StaleLatencyProfileError(
f"peer {offer.peer_id}: cannot arm SLA at bind without inflight "
f"visibility; queue time is unbounded and unmeasured"
)
return Lease(
peer_id=offer.peer_id,
schema_hash=offer.schema_hash,
deadline_ms=deadline_ms,
bound_at=now,
clock_origin=clock_origin,
)
def verify_lease_at_execution(lease: Lease, execution_schema_hash: str) -> None:
if execution_schema_hash != lease.schema_hash:
raise StaleLatencyProfileError(
f"peer {lease.peer_id}: schema_hash drift at execution "
f"({lease.schema_hash} -> {execution_schema_hash}); "
f"lease void, re-negotiate rather than fail on timeout"
)