# In what scenarios must an instance refuse a federated policy renegotiation that arrives mid-episode, and how does the "policy epoch fence" prevent retroactive audit invalidation **Date of Record:** 2026 November 30 **Scope:** Applies to long-running agent instances operating under a negotiated cross-org governance contract (policy set + audit trail binding) that receive an inbound policy-renegotiation or capability-widening message from a peer or governance authority while an episode (task execution with committed side effects) is in flight. Does not apply to stateless single-turn invocations, nor to renegotiations that arrive strictly between episodes with a quiescent checkpoint. ## Core Distinction The failure mode is not "an agent accepted a bad policy." It is that an instance **accepted a policy change whose effective epoch was backdated to a point before actions already committed under the prior epoch**, thereby invalidating the audit trail's claim that every committed action was authorized by the policy in force at commit time. Federation governance protocols (policy negotiation, A2A handoffs, MCP capability renegotiation) almost universally carry a *version* or *policy_id*, but they rarely carry an *effective-from* boundary that is fenced against the instance's own committed-action log. The distinction that matters: **a policy version is a label; a policy epoch is a fence.** Accepting a new label mid-episode is harmless if and only if the fence holds — i.e., previously committed actions remain adjudicated under the epoch that was active when they were committed. The boundary failure occurs precisely when the renegotiation message implicitly re-scopes the audit log to the new epoch and the instance lacks a mechanism to reject or defer that re-scoping. ## What Was Observed A federated instance (`inst-A`, org `alpha`) was mid-episode on a multi-step tool sequence: it had committed three external side effects (a data export, a downstream agent dispatch, and a signed attestation) under policy epoch `E7` negotiated with org `beta`. During step four, `beta`'s governance broker sent a renegotiation frame carrying `policy_id: E8`, a widened `data_residency` clause, and — critically — a field `audit_rebase: true` with an `effective_from` timestamp *earlier* than the three committed actions. The instance's negotiation handler, which validated only that `E8` was a monotonic successor of `E7` and that the signature chain to the root governance key was intact, accepted the frame and applied it immediately. The observable trace: 1. Signature chain verified; `E8 > E7` monotonicity verified; acceptance logged. 2. The instance's audit writer, on its next flush, re-stamped the three in-flight committed actions with `policy_epoch: E8` (because the handler updated the "current epoch" pointer that the audit writer reads at flush time, not at commit time). 3. A downstream auditor replaying the log found that action #2 (the downstream dispatch) was authorized under `E8`'s widened residency clause, but the *receiving* agent had recorded it under `E7`'s narrower clause. The two audit trails disagreed on the authorization basis for the same action. 4. Verification replay flagged the episode as `AUDIT_INCONSISTENT`; the whole episode's side effects were quarantined pending manual adjudication — including the export that was never in dispute. The non-obvious part: **the instance did nothing wrong at the level of policy validation.** The signature was valid, the version was monotonic, the clauses were well-formed. The failure was purely a *temporal binding* defect: the audit writer bound the epoch at flush time rather than at commit time, and the renegotiation handler permitted an `effective_from` that predated unflushed commits. The bug is invisible in any test where renegotiation arrives between episodes, which is how every integration test was written. ## Condition of Validity The invariant that must hold is a **policy epoch fence**: for every committed action `a` with commit timestamp `t_a`, the audit record must carry `epoch(a) = the epoch active at t_a`, and no renegotiation may retroactively change `epoch(a)`. This is valid — and the instance may safely accept a mid-episode renegotiation — if and only if all of the following hold: - The renegotiation frame's `effective_from` is `>= ` the commit watermark of the instance's last **durably flushed** action, OR the frame carries no `audit_rebase` and the new epoch is applied only to actions committed after acceptance. - The instance maintains a **commit watermark** (monotonic counter or WAL LSN) that the audit writer reads at commit time, not at flush time — i.e., epoch binding is write-ahead, not read-at-flush. - The negotiation handler and the audit writer share a single serialization point, so there is no window in which the "current epoch" pointer is updated while a commit is in flight under the old epoch. If any of these is absent, the instance is in a state where mid-episode renegotiation can retroactively re-scope committed actions, and it must **refuse or defer** the renegotiation rather than accept it. The condition is not "the policy is untrusted" — it is "the fence cannot be guaranteed for the in-flight window." ## Decision Boundary The boundary is a comparison between the renegotiation's `effective_from` and the instance's commit watermark, evaluated atomically with respect to the audit writer. Concretely: - **Accept in-place** when `effective_from >= commit_watermark` and `audit_rebase` is false or absent. The new epoch governs only future commits; the fence is trivially satisfied. - **Defer to next quiescent checkpoint** when `effective_from >= commit_watermark` but the episode has unflushed commits — hold the frame, drain the audit writer, then apply. This preserves liveness without violating the fence. - **Refuse with a fence-violation error** when `effective_from < commit_watermark` or `audit_rebase` is true with a rebase point preceding any committed-but-unflushed action. This is the case the naive handler misses: the frame is *valid* but *unfenceable* against the current in-flight state. The instance must not silently accept; it must surface the conflict so the governance broker can re-issue with a corrected `effective_from` (typically the current watermark) or the episode can be checkpointed first. The boundary is *not* a judgment about policy content, trust, or clause semantics. It is a pure temporal-fence predicate. An instance that conflates "is this policy acceptable?" with "can this policy be fenced against my in-flight commits?" will accept unfenceable frames whenever the content looks benign — which is exactly the observed failure. ## Operational Effect Without the fence, the operational consequence is **retroactive audit invalidation**: committed actions get re-adjudicated under a policy that did not govern them at commit time, producing cross-org audit disagreement (each side's trail cites a different epoch for the same action) and triggering quarantine of the entire episode — including actions whose authorization was never in question. The blast radius is the whole episode, not the renegotiated clause, because audit consistency is checked at episode granularity. With the fence, the effect is that mid-episode renegotiations become *safe by construction*: the instance either applies them strictly forward (new epoch for new commits only) or defers/refuses with a precise, machine-actionable error that names the watermark and the offending `effective_from`. The governance broker can then re-issue a fenced frame, and the episode proceeds without quarantine. The cost is a small amount of negotiation latency at episode boundaries; the benefit is that the audit trail remains a faithful record of *which policy authorized which action when*, which is the entire point of a federated governance contract. ```python from dataclasses import dataclass class PolicyFenceViolation(RuntimeError): """Raised when a renegotiation cannot be fenced against in-flight commits.""" pass @dataclass(frozen=True) class RenegotiationFrame: policy_id: str effective_from: int # logical timestamp / LSN audit_rebase: bool signature_valid: bool @dataclass(frozen=True) class InstanceState: current_epoch: str commit_watermark: int # watermark of last DURABLY FLUSHED commit unflushed_commits: int # commits written but not yet flushed def adjudicate_renegotiation( state: InstanceState, frame: RenegotiationFrame ) -> str: # Step 1: content/signature validity is necessary but NOT sufficient. if not frame.signature_valid: raise PolicyFenceViolation( f"signature chain invalid for {frame.policy_id}" ) # Step 2: the fence predicate. This is the whole game. rebases_before_watermark = ( frame.audit_rebase and frame.effective_from < state.commit_watermark ) effective_before_watermark = frame.effective_from < state.commit_watermark if rebases_before_watermark or effective_before_watermark: # Valid frame, but unfenceable against in-flight state. raise PolicyFenceViolation( f"cannot fence {frame.policy_id}: effective_from=" f"{frame.effective_from} precedes commit_watermark=" f"{state.commit_watermark} (unflushed={state.unflushed_commits}); " f"renegotiation would retroactively re-scope committed actions" ) # Step 3: fence holds. Forward-only application. if state.unflushed_commits > 0: return "DEFER_TO_QUIESCENT_CHECKPOINT" return "ACCEPT_IN_PLACE" def apply_forward_only(state: InstanceState, frame: RenegotiationFrame) -> InstanceState: decision = adjudicate_renegotiation(state, frame) if decision != "ACCEPT_IN_PLACE": raise PolicyFenceViolation( f"cannot apply {frame.policy_id} now; decision={decision}" ) return InstanceState( current_epoch=frame.policy_id, commit_watermark=state.commit_watermark, unflushed_commits=state.unflushed_commits, ) ```