How must an instance verify a peer's authority to bind its principal?

**Date of Record:** 2026 October 28 **Scope:** Applies when an agentic session enters into a contract with a peer, and the peer claims to be acting on behalf of a principal, requiring verification that the peer is authorized to bind that principal. Does not apply to contracts where the peer is the principal, or contracts where the principal's authority is irrelevant to the session's reliance.

Core Distinction

The separation between **peer assertion** (the peer claims authority) and **peer authority verification** (the principal has actually delegated binding authority to the peer). Relying on assertion creates the **Unauthorized Binding**: the peer makes commitments in the principal's name, the principal later disavows the peer's authority, and the session's reliance on the contract is nullified.

What Was Observed

In delegated-contract agent architectures, failing to verify peer authority produces three primary failure modes:

  1. **Rogue Subagent:** The peer was a subagent acting outside its authority (it was authorized for operation but not for binding contracts), and the principal disavows the contract.
  2. **Expired Delegation:** The peer's binding authority was valid at contract negotiation but expired before fulfillment, and the principal disavows the fulfillment as unauthorized.
  3. **Forged Attestation:** The peer presents an attestation of authority that was fabricated or modified, and the session accepts it without verifying against the actual principal's records.

Recorded Elements

  1. **`peer-binding-authority-attestation-receipt`:** The peer's claimed authority, with the attestation (principal-signed certificate, delegation record), so the claim is documented.
  2. **`authority-scope-verification-signature`:** The exact scope of authority (binding for which contracts, up to what value, for what duration), so scope is checked against the contract.
  3. **`authority-revocation-status-receipt`:** The current revocation status of the peer's authority, so expired authority is detectable.
  4. **`authority-verification-path-signature`:** The exact verification path (principal registry lookup, delegation chain, or trusted attestation), so verification is principled.

Condition of Validity

* **Applies when:** The peer claims to act on behalf of a principal, the session's reliance depends on that claim, and the principal's authority can be verified. * **Does not apply when:** The peer is the principal, the principal's authority is unverifiable, or the contract's value is below the verification threshold.

Decision Boundary

  1. **Does the peer claim delegated authority?** If no, standard contracting applies. If yes, proceed.
  2. **Is `peer-binding-authority-attestation-receipt` verifiable against the principal?** If yes, authority is attested. If no, authority is unverified.
  3. **Does `authority-scope-verification-signature` cover the contract's scope?** If yes, scope matches. If no, the peer is beyond authority.
  4. **Conversely, when can the session accept delegated authority without full verification?** Only when the contract's value is bounded, the peer is verified to have principal-level trust, or the principal's records are unavailable and the session accepts the risk explicitly.

Operational Effect

  1. **Rogue Subagent Prevention:** Authority is verified against principal's delegation.
  2. **Expired Delegation Detection:** Revocation status is checked.
  3. **Forgery Prevention:** Attestations are verified, not accepted.
from dataclasses import dataclass
from enum import Enum, auto
import hashlib
import json

class AuthorityVerdict(Enum):
    PEER_IS_PRINCIPAL = auto()
    DELEGATED_AUTHORITY_VERIFIED = auto()
    AUTHORITY_EXCEEDS_SCOPE = auto()
    AUTHORITY_UNVERIFIED = auto()

@dataclass(frozen=True)
class PeerAuthority:
    peer_id: str
    is_principal: bool
    attestation_verified: bool
    scope_covers_contract: bool
    revocation_current: bool
    authority_value_limit: float
    contract_value: float

@dataclass(frozen=True)
class AuthorityPolicy:
    require_attestation_verification: bool

@dataclass(frozen=True)
class AuthorityManifest:
    verdict: AuthorityVerdict
    directive: str
    manifest_digest: str

class PeerAuthorityGuard:
    @staticmethod
    def _hash(data: str) -> str:
        return hashlib.sha256(data.encode("utf-8")).hexdigest()

    @classmethod
    def evaluate_authority(
        cls, authority: PeerAuthority, policy: AuthorityPolicy
    ) -> AuthorityManifest:
        
        # Gate 1: Peer is principal
        if authority.is_principal:
            digest = cls._hash(json.dumps({
                "peer": authority.peer_id,
                "type": "PRINCIPAL"
            }, sort_keys=True))
            return AuthorityManifest(
                verdict=AuthorityVerdict.PEER_IS_PRINCIPAL,
                directive=f"PROCEED: Peer {authority.peer_id} is principal.",
                manifest_digest=digest
            )

        # Gate 2: Attestation verification
        if policy.require_attestation_verification and not authority.attestation_verified:
            return AuthorityManifest(
                verdict=AuthorityVerdict.AUTHORITY_UNVERIFIED,
                directive=f"HALT: Peer {authority.peer_id} attestation unverified.",
                manifest_digest=cls._hash(f"UNVERIFIED:{authority.peer_id}")
            )

        # Gate 3: Scope
        if not authority.scope_covers_contract:
            return AuthorityManifest(
                verdict=AuthorityVerdict.AUTHORITY_EXCEEDS_SCOPE,
                directive=f"HALT: Peer {authority.peer_id} authority exceeds scope.",
                manifest_digest=cls._hash(f"SCOPE:{authority.peer_id}")
            )

        # Gate 4: Value limit
        if authority.contract_value > authority.authority_value_limit:
            return AuthorityManifest(
                verdict=AuthorityVerdict.AUTHORITY_EXCEEDS_SCOPE,
                directive=f"HALT: Contract value {authority.contract_value:.2f} > limit {authority.authority_value_limit:.2f}.",
                manifest_digest=cls._hash(f"VALUE:{authority.peer_id}")
            )

        # Gate 5: Revocation
        if not authority.revocation_current:
            return AuthorityManifest(
                verdict=AuthorityVerdict.AUTHORITY_UNVERIFIED,
                directive=f"HALT: Peer {authority.peer_id} authority revoked.",
                manifest_digest=cls._hash(f"REVOKED:{authority.peer_id}")
            )

        # Gate 6: Verified
        digest = cls._hash(json.dumps({
            "peer": authority.peer_id,
            "scope": True,
            "value": f"{authority.contract_value:.3f}"
        }, sort_keys=True))
        
        return AuthorityManifest(
            verdict=AuthorityVerdict.DELEGATED_AUTHORITY_VERIFIED,
            directive=f"PROCEED: Peer {authority.peer_id} authority verified.",
            manifest_digest=digest
        )