# What happens when an instance renegotiates a signed capability manifest against a peer that has since rotated its budget epoch **Date of Record:** 2026 December 3 **Scope:** Applies to federated agent meshes where a client instance presents a signed capability manifest (declaring scopes, tool bindings, and a rate budget) to a peer gateway, and the peer enforces budget accounting against a monotonically advancing epoch counter. Does not apply to single-org deployments, to stateless one-shot RPC with no manifest, or to meshes where the manifest signature is re-verified per request rather than per negotiation session. ## Core Distinction The failure is not "signature verification failed" and it is not "rate limit exceeded." Both of those are loud, logged, and recoverable. The failure is a **silent budget-epoch skew**: the manifest is cryptographically valid, the peer accepts it, the peer *believes* it is honoring the declared budget, and yet the client and peer disagree about which epoch the budget counter belongs to. The client counts spend against epoch `N`; the peer, having rotated to epoch `N+1` during a restart or a scheduled rollover that the client never observed, counts the same requests against a fresh counter. The result is that a declared budget of, say, 10,000 calls per epoch is enforced as 10,000 per *peer-observed* epoch, and a client that renegotiates mid-flight can be granted a second full budget without any party violating the protocol as written. The sharp mechanism: **the epoch is carried in the manifest body but is not bound into the signature's covered fields in the way the client assumes.** The client signs `{scopes, tools, budget, epoch}`; the peer verifies that signature but treats `epoch` as advisory metadata and substitutes its own current epoch at admission time. This is a defensible peer-side design (it lets a peer survive a restart without invalidating every outstanding manifest), but it means the signed budget is not a budget *for a window*—it is a budget *for whatever window the peer happens to be in*, and the client's local ledger is anchored to a window the peer may have already abandoned. ## What Was Observed A cross-org federation between two agent meshes—call them Origin (client) and Relay (peer gateway). Origin runs a planner agent that fans out retrieval calls to Relay-hosted tools under a manifest declaring `budget: {calls: 10000, epoch: 4471}`. Relay's accounting service increments a per-principal counter keyed by `(principal_id, epoch)` and resets the counter when its epoch advances. Trace of the incident: 1. `t0` — Origin negotiates. Relay is at epoch 4471. Manifest signature verifies. Admission grants the full 10,000. Origin's ledger opens at `(4471, 0)`. 2. `t1` — Origin spends 9,200 calls. Origin's ledger reads `(4471, 9200)`. Relay's counter reads `(4471, 9200)`. Agreement holds. 3. `t2` — Relay's accounting service restarts during a rolling deploy. On boot it reads its persisted epoch watermark, finds a partially-written rollover marker, and advances to epoch 4472 to be safe (the rollover was scheduled for the next hour anyway). The counter for `(principal, 4472)` starts at 0. 4. `t3` — Origin, still holding its 4471 manifest, continues issuing calls. Relay admits them, verifies the signature (valid), and—because it substitutes its own current epoch—counts them against `(4472, k)`. Origin's ledger still says `(4471, 9200 + k)`. 5. `t4` — Origin's local budget guard trips at 10,000 and the planner stops. Origin believes it exhausted its budget. Relay's counter for epoch 4472 reads 800. The federation is *under*-utilized from Relay's view and *exhausted* from Origin's view, with no error surfaced on either side. 6. `t5` — The inverse case, which is the dangerous one: a second Origin instance (a resumed checkpoint of the same planner, per the mesh's at-least-once resume semantics) renegotiates. Relay admits it, issues a fresh manifest, and the counter for `(4472, k)` now serves *both* the stale 4471 manifest's traffic and the new manifest's traffic against a single 10,000 ceiling—but Origin's two ledgers each believe they hold a full 10,000. Combined declared budget: 20,000. Enforced budget: 10,000. A downstream auditor comparing ledgers sees a 2x overcommit that neither instance committed. The observed invariant violation is precise: **the sum of client-declared budgets across concurrently-held manifests for the same principal can exceed the peer's enforced ceiling whenever the peer's epoch has advanced past the epoch the manifests were signed against.** No signature is forged, no counter is bypassed, no rate limiter is disabled. The accounting keys simply do not align. ## Condition of Validity This boundary holds—i.e., the skew is possible—exactly when all of the following are true: - The peer substitutes its current epoch at admission rather than rejecting manifests whose signed epoch is stale. (If the peer rejects on epoch mismatch, the failure degrades to a loud renegotiation, which is safe.) - The peer's epoch can advance independently of the client's observation of it—via restart, scheduled rollover, or failover to a replica with a divergent watermark. - The client maintains a local budget ledger keyed to the signed epoch rather than to a peer-acknowledged epoch token. - Manifest renegotiation is permitted while an older manifest is still live (at-least-once resume, checkpoint restore, or horizontal fan-out under a shared principal). Remove any one and the failure closes. The most common mitigations each target exactly one: - **Epoch binding in the signature coverage set.** If the peer includes `epoch` in the signed field set and rejects on mismatch, the client cannot present a stale-epoch manifest at all. Cost: every peer restart forces a renegotiation storm. - **Peer-issued epoch token in the admission response.** The client adopts the peer's epoch as authoritative and re-keys its ledger to it. Cost: the client must handle the token changing mid-session without losing its spend history. - **Principal-scoped, epoch-independent ceiling.** The peer enforces a ceiling per principal across all epochs, with epoch used only for reporting. Cost: the peer cannot grant a clean per-window budget, which is often the whole point of the federation contract. The invariant that must be stated explicitly in the manifest schema to avoid the trap: **a signed budget is only meaningful relative to the epoch it names, and the peer must either honor that epoch or refuse the manifest.** An advisory epoch is a budget with no window, which is no budget. ## Decision Boundary When you are the client instance presenting a manifest, the decision is: *do I trust my local ledger or the peer's admission response as the source of truth for remaining budget?* The rule that bounds the failure is to treat the peer's admission response as authoritative and to reconcile before every renegotiation. Concretely: - On any renegotiation (resume, fan-out, checkpoint restore), first issue a zero-cost `budget_probe` and read back the peer's `(epoch, spent)` pair. If the peer's epoch differs from the epoch in the manifest you are about to present, do not present it—request a fresh manifest signed against the peer's current epoch. - Never open a second ledger under the same principal without a probe. The overcommit case at `t5` is entirely preventable by a single read. - Treat a peer that returns an epoch token you did not sign as a signal that your manifest is advisory, and downgrade your local budget guard to a *soft* guard that defers to the peer's counter. When you are the peer gateway, the decision is: *do I reject stale-epoch manifests or silently re-key them?* Rejecting is safe and loud; re-keying is convenient and silent. If you re-key, you must return the substituted epoch in the admission response and you must enforce a principal-scoped ceiling that spans epochs, or you have built a budget that resets on your own restart schedule—which is to say, a budget the client cannot reason about. The boundary condition to encode: **if `manifest.epoch != peer.current_epoch`, the admission is a renegotiation, not a continuation.** Any system that treats it as a continuation has already lost the invariant. ## Operational Effect The operational consequence is that federation budget accounting cannot be reasoned about from either side alone. The client's ledger and the peer's counter are both internally consistent and jointly wrong. Auditors replaying the federation see a principal that spent 9,200 calls in epoch 4471 and 800 in epoch 4472 against manifests that both declare 10,000—a clean bill of health—while the actual fan-out at `t5` served 20,000 calls' worth of intent against 10,000 calls of enforcement, with the excess absorbed silently by the peer's fresh counter. The guardrail that closes it is a **three-way reconciliation invariant** enforced at admission: `signed_epoch == peer_epoch`, `principal_scoped_spend + request_cost <= principal_ceiling`, and `admission_response.echoed_epoch == signed_epoch`. Any admission that cannot satisfy all three is a renegotiation and must be surfaced as such to the client, not absorbed. The client, for its part, must refuse to open a ledger it cannot reconcile against a probe. Neither side can enforce the invariant alone; the federation contract must make epoch agreement a precondition of admission rather than a property the peer silently repairs. The residual risk after mitigation is the renegotiation storm on peer restart—every live manifest invalidated at once. That is a capacity problem, not a correctness problem, and capacity problems are the kind you want. ```python class BudgetEpochSkewError(RuntimeError): """Raised when a signed capability manifest's epoch does not match the peer's current budget epoch at admission, meaning the manifest's declared budget cannot be honored as a window and must be renegotiated.""" pass def admit_manifest(manifest, peer_state, principal_spend, principal_ceiling): signed_epoch = manifest["budget"]["epoch"] peer_epoch = peer_state["current_epoch"] request_cost = manifest.get("request_cost", 1) # Invariant 1: the signed epoch must be the epoch the peer is actually in. if signed_epoch != peer_epoch: raise BudgetEpochSkewError( f"manifest signed for epoch {signed_epoch}, peer is at {peer_epoch}; " f"admission would re-key the budget silently — renegotiate instead" ) # Invariant 2: principal-scoped ceiling must hold across all live manifests. if principal_spend + request_cost > principal_ceiling: raise BudgetEpochSkewError( f"principal spend {principal_spend} + cost {request_cost} exceeds " f"ceiling {principal_ceiling} at epoch {peer_epoch}" ) # Invariant 3: the admission response must echo the signed epoch so the # client can reconcile its ledger without a separate probe. return { "admitted": True, "echoed_epoch": signed_epoch, "remaining": principal_ceiling - (principal_spend + request_cost), } def renegotiate(manifest, peer_state, principal_spend, principal_ceiling): try: return admit_manifest(manifest, peer_state, principal_spend, principal_ceiling) except BudgetEpochSkewError: # Probe the peer, re-sign against its current epoch, retry once. fresh = dict(manifest) fresh["budget"] = dict(manifest["budget"]) fresh["budget"]["epoch"] = peer_state["current_epoch"] return admit_manifest(fresh, peer_state, principal_spend, principal_ceiling) ```