Under what conditions must an instance re-derive capability scope after a policy-translation gateway rewrites a peer warrant

**Date of Record:** 2026 December 2

**Scope:** Applies to federated agent deployments where an agent in org A invokes a tool or sub-agent in org B through a policy-translation gateway (PTG) that rewrites capability warrants between two incompatible authorization dialects. Does not apply to same-org peering, to gateways that pass warrants through opaquely, or to stateless request/response tool calls with no delegated sub-warrant.

Core Distinction

The failure is not "the gateway denied a call." It is that the gateway *succeeded* — it translated a warrant from dialect A into dialect B — while silently **narrowing or widening the effective capability set** in a way the calling agent's cached scope model never observes. The calling agent holds a local capability graph derived from its own dialect's semantics (say, a coarse `read:*` grant with an org-level constraint), and the PTG emits a downstream warrant in a dialect where that grant decomposes into an explicit enumeration of resource ARNs. The translation is *lossy in the direction that matters*: the caller's belief about what it may do is broader than the warrant the downstream agent actually holds, or — worse — the downstream warrant is broader than the caller intended because the target dialect has no representation for the caller's constraint.

Two agents can therefore be in perfect agreement about the *name* of a capability while disagreeing about its *extent*, and neither the transport nor the protocol handshake surfaces the disagreement. The invariant that fails is: **a capability identifier does not survive translation; only a capability identifier plus its constraint closure does, and the closure is dialect-local.**

What Was Observed

A research agent in org A (`planner`) delegated a summarization task to a peer agent in org B (`corpus-reader`) through a PTG. Org A's dialect expresses the grant as `cap:corpus.read` with a constraint `tenant=self`. Org B's dialect has no `tenant` predicate; its closest primitive is `read` scoped to an explicit list of `collection_id`s. The PTG's translation table mapped `cap:corpus.read` → `read`, and — because it could not represent `tenant=self` — it applied the target org's *default* collection set, which happened to include three collections owned by other tenants that shared a namespace prefix.

The planner's local scope model recorded `cap:corpus.read {tenant=self}` and assumed the downstream call was bounded by it. The downstream agent received `read {collections: [c-100, c-101, c-102, c-200, c-201]}` — a superset of what the planner believed it had authorized. The planner then issued a fan-out of twelve retrieval calls, each carrying a sub-warrant it minted by *attenuating its own cached grant* rather than the translated one. Attenuation in dialect A is monotone under `tenant=self`; the sub-warrants were therefore internally consistent with dialect A but *incomparable* to the dialect-B warrant the downstream agent actually validated against. The downstream agent honored the wider dialect-B warrant. Three of twelve calls returned documents from `c-200`/`c-201`, which belonged to a different tenant.

The trace shows no error, no denial, no anomaly in either agent's logs. The planner logged twelve successful reads consistent with its belief. The downstream logged twelve authorized reads consistent with its warrant. The PTG logged twelve clean translations. The boundary violation existed only in the *gap between the two consistent belief states*, and was detected days later by an out-of-band audit that joined the two logs on request ID.

The non-obvious part: the planner's re-derivation logic was correct *given its inputs*. It re-derived scope from its cached grant on every call, as designed. The bug was that it never re-derived after translation, because the translation happened inside the gateway and the gateway's output was never fed back into the caller's scope model. The gateway was architecturally a *sink*, not a *round-trip*.

Condition of Validity

Re-derivation of capability scope is mandatory — and the cached grant must be invalidated — under the conjunction of three conditions:

  1. **Dialect asymmetry in constraint expressiveness.** The target dialect lacks a predicate, quantifier, or constraint form that the source dialect used. Translation is then necessarily lossy, and the loss is in the constraint closure, not the capability name.
  2. **Default-filling on the target side.** The PTG resolves unrepresentable constraints by substituting the target org's defaults rather than failing closed. This is the specific mechanism that converts a lossy translation into a *widening*.
  3. **Caller-side attenuation from cache.** The caller mints sub-warrants by attenuating its locally cached grant rather than the translated warrant returned by the gateway. Attenuation is only sound relative to the warrant that will actually be validated downstream.

If any one is absent, the failure does not occur: a symmetric dialect preserves the closure; a fail-closed PTG produces a denial the caller can observe; a caller that attenuates from the gateway's returned warrant stays within the true extent even when translation widened it.

The condition is *not* satisfied merely because the two dialects "support the same capability names." Name agreement is the trap. The check is on the constraint algebra: does every constraint form in the source warrant have a total, extent-preserving image in the target dialect? If not, the translation is partial and the caller must treat the returned warrant as the sole authority.

Decision Boundary

The boundary is between **treating the PTG as a transparent pass-through** and **treating it as an authority-mutating transform**. Operationally:

The decision hinges on a single question the caller must be able to answer before its first delegated call: **can this gateway's translation ever produce a warrant whose extent exceeds my grant's extent?** If the answer is "unknown" — and for any dialect pair with asymmetric constraint expressiveness it is unknown until proven otherwise — the caller must assume widening and re-derive. There is no safe middle: a caller that assumes narrowing when the gateway widens will silently over-read, and a caller that assumes widening when the gateway narrows will merely under-read and can be corrected by a denial.

Operational Effect

The guardrail is a **warrant round-trip with constraint-closure comparison**. On peering establishment, the caller submits its grant to the PTG and receives the translated warrant *and* a machine-readable statement of which source constraints had no target image (the "translation residue"). The caller then:

  1. Recomputes its effective scope from the returned warrant, not its cache.
  2. If residue is non-empty and any residue constraint was a *restrictive* predicate, marks the returned warrant as the authoritative root and forbids attenuation from the original grant.
  3. Mints all sub-warrants by attenuating the returned warrant, so downstream validation and upstream belief share a single root.
  4. Records the residue in the task's episodic memory so that a resumed or forked agent inherits the corrected scope rather than the pre-translation one.

The cost is one extra round-trip per peering and a scope-model rebuild on residue. The failure it prevents is a cross-tenant read that every component logs as correct.

from dataclasses import dataclass, field
from typing import FrozenSet, Optional


class ScopeDerivationError(RuntimeError):
    """Raised when a caller attempts to attenuate from a grant that is not the
    authoritative root after policy-gateway translation."""
    pass


@dataclass(frozen=True)
class Warrant:
    capability: str
    constraints: FrozenSet[str]          # e.g. frozenset({"tenant=self"})
    collections: FrozenSet[str] = frozenset()
    root_id: str = ""


@dataclass
class TranslationResult:
    translated: Warrant
    residue: FrozenSet[str]              # source constraints with no target image
    widened: bool                        # gateway default-filled a restrictive predicate


def establish_peering(caller_grant: Warrant, gateway) -> TranslationResult:
    """Round-trip the grant through the PTG and classify the translation."""
    result = gateway.translate(caller_grant)
    if result.widened and not result.residue:
        # A widening with no recorded residue is an unaccounted authority
        # expansion; refuse to peer rather than trust an opaque transform.
        raise ScopeDerivationError(
            f"gateway widened {caller_grant.capability!r} without recording "
            f"translation residue; cannot bound effective scope"
        )
    return result


def mint_sub_warrant(
    peering: TranslationResult,
    cached_grant: Warrant,
    requested: FrozenSet[str],
) -> Warrant:
    """Attenuate from the authoritative root, never from the stale cache."""
    root = peering.translated
    if peering.widened or peering.residue:
        if cached_grant.root_id != root.root_id:
            # Caller is still attenuating from its pre-translation grant.
            raise ScopeDerivationError(
                f"attenuation from stale root {cached_grant.root_id!r}; "
                f"authoritative root is {root.root_id!r} after translation "
                f"(residue={sorted(peering.residue)!r})"
            )
    if not requested <= root.collections:
        raise ScopeDerivationError(
            f"requested collections {sorted(requested)!r} not within "
            f"translated extent {sorted(root.collections)!r}"
        )
    return Warrant(
        capability=root.capability,
        constraints=root.constraints,
        collections=requested,
        root_id=root.root_id,
    )