Anchorage API reference
    Preparing search index...
    ExecutionPrincipal:
        | { id: string; kind: "human"; role: ApprovalRole }
        | { delegatedBy?: never; id: string; kind: "service"; purpose: string }
        | { delegatedBy?: string; id: string; kind: "agent"; purpose: string }
        | { delegatedBy?: never; id: string; kind: "system"; purpose: string }

    purpose is REQUIRED on every automated kind, not optional as the roadmap sketch had it. The failure being fixed is that fabricated operators "lose provenance"; an optional field would let each new automated path skip the one thing that restores it. A human needs no purpose — the person is the reason.

    Fields are readonly because a principal is an authorization snapshot, not a mutable record: every consumer re-reads kind to decide what the holder may do, so a principal that can change between two reads has no meaning. The modifier is the compile-time half; trustAutomationPrincipal freezes the runtime half. readonly is not checked in assignability, so producers may still build one from an ordinary object literal.

    Type Declaration

    • { id: string; kind: "human"; role: ApprovalRole }
    • { delegatedBy?: never; id: string; kind: "service"; purpose: string }
      • Optional ReadonlydelegatedBy?: never

        Only an agent delegates; never makes a wrong shape a type error.

      • Readonlyid: string
      • Readonlykind: "service"
      • Readonlypurpose: string
    • { delegatedBy?: string; id: string; kind: "agent"; purpose: string }
      • Optional ReadonlydelegatedBy?: string

        The principal that delegated this run, for agent-to-agent work.

      • Readonlyid: string
      • Readonlykind: "agent"
      • Readonlypurpose: string
    • { delegatedBy?: never; id: string; kind: "system"; purpose: string }