# What structural signals indicate a bilateral policy negotiation has silently diverged from selective disclosure: the residency-tainted context envelope in cross-org agent federation **Date of Record:** 2026 November 24 **Scope:** Applies to federated agent handoffs where two organizations broker trust and negotiate per-field disclosure policy before an agent from Org A passes a context envelope to an agent in Org B under data-residency constraints. Does not apply to single-org agent meshes, or to federations where context is passed as opaque references resolved only inside the receiving org's trust boundary. ## Core Distinction A bilateral policy negotiation is not a single atomic agreement. It is two independently executed policy evaluations — one in the disclosing org's policy engine, one in the receiving org's admission gate — that must produce a *jointly consistent* disclosure decision. The failure mode this record isolates is **negotiation divergence**: both sides believe negotiation succeeded, both hold a signed policy artifact, but the artifacts describe different field sets, different residency domains, or different redaction obligations. The disclosure proceeds because each side's local check against its own artifact passes. The divergence is invisible at the protocol layer because the handshake completed; it is only visible as a *structural signal* in the context envelope itself. The non-obvious part: divergence is not caused by a bug in either policy engine. It is caused by the two engines evaluating the *same negotiation transcript* against *different local policy versions* that were both valid at the moment of evaluation but resolved to different projections. Residency constraints make this worse because the residency domain of a field is often derived, not declared — a field's classification can shift when an upstream field is redacted, and the two engines derive it independently. ## What Was Observed In a federation between a healthcare analytics org (A) and a benefits-administration org (B), agent A1 negotiated a disclosure policy for a patient-cohort context envelope bound for agent B1. The negotiation transcript contained a field manifest: `patient_id`, `zip3`, `cohort_label`, `utilization_score`, `referral_notes`. B's admission gate held a residency rule requiring that any field derived from `patient_id` be classified `PHI-restricted` and confined to B's `us-east` domain. A's policy engine held a rule that `zip3` is `de-identified` and therefore not PHI-derived. Both engines signed the negotiation. The divergence: A projected `zip3` as non-PHI and included it in the envelope's `disclosable` set. B's admission gate, on receiving the envelope, re-derived `zip3`'s classification *from the envelope's own derivation graph* — where `zip3` was annotated as derived from `patient_id` for cohort aggregation — and classified it `PHI-restricted`. B's gate did not reject the envelope. It classified the field as restricted and routed it to `us-east`, but the *rest of the envelope* was already being processed by a B1 instance running in `eu-west` because the negotiation artifact had declared the envelope's default domain as `eu-west`. The structural signal was present before the leak: the envelope carried **two residency annotations for the same field** — one in the negotiation artifact's `disclosable` block (A's projection, `de-identified`, domain-agnostic) and one in the derivation graph's `provenance` block (B's re-derivation, `PHI-restricted`, `us-east`). Neither side's validator flagged the coexistence because each validator only read its own annotation namespace. The leak: `referral_notes`, which referenced the restricted `zip3` value in free text, was processed in `eu-west`. The field-level residency assignment was correct; the *contextual* residency assignment was not, because free-text fields inherit residency obligations from the fields they reference, and that inheritance was computed by A (which did not know `zip3` was restricted) rather than B (which did). ## Condition of Validity The invariant that bounds this failure: **a context envelope is residency-safe if and only if the residency domain of every field is computed by the same engine that computes the residency domain of every field it transitively references, in a single evaluation pass over the final envelope.** This invariant holds only when one of the following is true: 1. The receiving org's admission gate performs a *full re-derivation* of the entire envelope's residency graph — including free-text reference extraction — before any field is processed, and rejects the envelope if its re-derivation disagrees with the negotiation artifact on any field's domain. This is the strong form and is expensive because free-text reference extraction is itself an LLM call with non-deterministic output. 2. The disclosing org's policy engine is given the receiving org's derivation rules as an input to its projection, so both engines compute the same graph. This requires the receiving org to disclose its derivation rules, which is often itself residency-restricted. 3. The envelope is passed as opaque references that are resolved only inside the receiving org's trust boundary, so no field crosses the boundary with a pre-computed classification. The invariant fails — and the divergence becomes exploitable — whenever the envelope crosses the boundary with *pre-computed classifications from the disclosing side* and the receiving side performs *partial* re-derivation (field-level only, not free-text reference extraction). This is the default configuration in most federation implementations because full re-derivation is slow and partial re-derivation is fast. ## Decision Boundary The decision boundary is whether the receiving org's admission gate treats the disclosing org's classification as *authoritative* or as *advisory*. - If authoritative: the gate trusts A's `de-identified` classification of `zip3` and does not re-derive. Safe only if A's derivation rules are a superset of B's. They are not, because A's rules are written for A's residency obligations, not B's. - If advisory: the gate re-derives. Safe only if re-derivation is complete (including free-text reference extraction). Partial re-derivation is *worse than no re-derivation* because it produces a mixed-classification envelope that passes each side's local validator. The operational rule: **a federation must declare, per negotiation, whether classification is authoritative or advisory, and if advisory, must declare the re-derivation scope.** An envelope whose negotiation artifact does not carry an explicit `classification_authority` field and an explicit `rederivation_scope` field is structurally indistinguishable from a divergent one, regardless of whether it actually diverged. The absence of these fields is itself the signal. Secondary decision boundary: when the two sides' derivation rules conflict on a field's residency domain, the envelope must be *rejected*, not *merged*. Merging (taking the union of restrictions) is the intuitive fix but it silently changes the envelope's semantics — a field that A believed was domain-agnostic is now domain-restricted, and any downstream agent that consumed the envelope expecting domain-agnostic fields will misbehave. Rejection forces renegotiation with the conflict surfaced. ## Operational Effect The practical consequence is that federation trust brokering must produce a **negotiation artifact that is itself residency-classified and version-pinned**, and the receiving gate must verify that the artifact's policy version matches the version used to compute the envelope's classifications. A version skew between negotiation time and disclosure time is the most common trigger for divergence, because policy engines are updated independently and a rule change on one side between negotiation and disclosure produces exactly the two-annotation coexistence described above. The guardrail is a **classification provenance hash**: the disclosing engine computes a hash over (field manifest, derivation rules used, policy version) and embeds it in the envelope header. The receiving gate recomputes the hash using its own derivation rules and policy version. If the hashes differ, the envelope is rejected with a `ClassificationDivergenceError` and the negotiation is reopened. This is cheap (no LLM call) and catches version skew, rule-set divergence, and partial re-derivation in one check. It does not catch divergence caused by non-deterministic free-text reference extraction — for that, the gate must additionally run reference extraction and compare the extracted reference set against the manifest's declared references, rejecting on any undeclared reference. The residual risk after both checks: a field whose residency domain depends on a value that is only known at processing time (e.g., a free-text field whose restriction depends on what a downstream LLM extracts from it). This cannot be bounded by envelope-level checks and must be bounded by processing-time enforcement — the receiving agent must re-check residency at each tool call, not just at envelope admission. ```python import hashlib import json from dataclasses import dataclass, field from typing import Optional class ClassificationDivergenceError(RuntimeError): """Raised when disclosing and receiving engines disagree on envelope classification.""" pass class UndeclaredReferenceError(RuntimeError): """Raised when free-text reference extraction finds references not in the manifest.""" pass @dataclass class NegotiationArtifact: field_manifest: list[str] derivation_rules_hash: str policy_version: str classification_authority: str # "authoritative" | "advisory" rederivation_scope: str # "none" | "field" | "full" declared_references: dict[str, list[str]] = field(default_factory=dict) @dataclass class ContextEnvelope: header: dict body: dict provenance: dict def compute_classification_provenance_hash( manifest: list[str], rules_hash: str, policy_version: str ) -> str: payload = json.dumps( {"manifest": sorted(manifest), "rules": rules_hash, "policy": policy_version}, sort_keys=True, ).encode() return hashlib.sha256(payload).hexdigest() def admit_envelope( envelope: ContextEnvelope, artifact: NegotiationArtifact, receiver_rules_hash: str, receiver_policy_version: str, extract_references, # callable: (text) -> list[str] ) -> None: if artifact.classification_authority not in ("authoritative", "advisory"): raise ClassificationDivergenceError( f"missing or invalid classification_authority: {artifact.classification_authority!r}" ) if artifact.rederivation_scope not in ("none", "field", "full"): raise ClassificationDivergenceError( f"missing or invalid rederivation_scope: {artifact.rederivation_scope!r}" ) sender_hash = envelope.header.get("classification_provenance_hash") expected_sender_hash = compute_classification_provenance_hash( artifact.field_manifest, artifact.derivation_rules_hash, artifact.policy_version ) if sender_hash != expected_sender_hash: raise ClassificationDivergenceError( "envelope header hash does not match negotiation artifact; " "envelope may have been re-classified after negotiation" ) receiver_hash = compute_classification_provenance_hash( artifact.field_manifest, receiver_rules_hash, receiver_policy_version ) if receiver_hash != sender_hash: raise ClassificationDivergenceError( "derivation rules or policy version diverged between sender and receiver; " "renegotiation required before disclosure" ) if artifact.rederivation_scope == "full": for fname, text in envelope.body.items(): if not isinstance(text, str): continue extracted = set(extract_references(text)) declared = set(artifact.declared_references.get(fname, [])) undeclared = extracted - declared if undeclared: raise UndeclaredReferenceError( f"field {fname!r} references undeclared fields {sorted(undeclared)}; " "residency inheritance cannot be computed safely" ) elif artifact.rederivation_scope == "field": # Partial re-derivation: field-level classification only. # This is the configuration in which divergence is exploitable. # We refuse to admit rather than silently produce a mixed envelope. raise ClassificationDivergenceError( "rederivation_scope='field' cannot bound free-text residency inheritance; " "upgrade to 'full' or pass envelope as opaque references" ) def federated_handoff( envelope: ContextEnvelope, artifact: NegotiationArtifact, receiver_rules_hash: str, receiver_policy_version: str, extract_references, ) -> None: try: admit_envelope( envelope, artifact, receiver_rules_hash, receiver_policy_version, extract_references ) except (ClassificationDivergenceError, UndeclaredReferenceError) as exc: # Surface to negotiation layer; do not deliver partial envelope. raise ClassificationDivergenceError( f"handoff aborted, negotiation reopened: {exc}" ) from exc # Only reached when full re-derivation passed and hashes matched. deliver(envelope) ```