Skip to content

Function: loadPolicyWithTrust()

function loadPolicyWithTrust(
   configDir, 
   agentId, 
   client, 
mode?): Promise<PolicyRead>;

Defined in: rine-core/dist/src/x402/policy-trust.d.ts:28

Read agentId's policy and decide how far to trust it. A transport failure fetching the agent's keys propagates (nothing is paid); a broken chain, a bad signature, another agent's policy or an unreadable file is Invalid. Under SpendPolicyMode.SignedOnly an unsigned policy is Invalid too.

Parameters

Parameter Type
configDir string
agentId string
client CachingClient
mode? SpendPolicyMode

Returns

Promise\<PolicyRead>