AuthorityPolicy
@totemsdk/agent-policy / AuthorityPolicy
Class: AuthorityPolicy
AuthorityPolicy — bridges PolicyMiddleware evaluation with mandate-based authority verification.
Corrected bridge:
- uses the authenticated
proposal.principal(neveragentIdas principal); - preserves the real action namespace (no synthesized
payment:*); - returns the full
AuthorityDecision+ usage delta, not a boolean; - binds the decision to the proposal id as the intent nonce.
Insert this layer into a ComposablePolicy pipeline to ensure every proposal is backed by a valid mandate before it is approved.
Implements
Constructors
Constructor
new AuthorityPolicy(
evaluator,extractAction?,options?):AuthorityPolicy
Parameters
evaluator
extractAction?
(proposal) => AuthorityActionIntent
options?
Returns
AuthorityPolicy
Methods
evaluate()
evaluate(
proposal,now?):Promise<PolicyEvalResult>
Evaluate a proposal. Called in sequence by ComposablePolicy.
Parameters
proposal
now?
number = ...
Returns
Promise<PolicyEvalResult>