agent-fabric
Treasury
Policy Pack

Treasury Policy Pack

The pack pre-composes the rules every treasury agent needs. You configure thresholds; the rules wire themselves to the kit's primitives.

import { treasuryPolicyPack } from '@veridex/agents-treasury';
 
const policies = treasuryPolicyPack({
  sanctions: compositeScreener,
  ceilings:  ceilingStore,
  timeLock:  timeLockManager,
  reputation: sbtProvider,                          // optional
  dualApprovalAbove: { amountUsdMicro: 10_000_000_000n },
  routeAllowlist: ['usdc', 'wire-domestic'],
  counterpartyAllowlist: { mode: 'pin', list: ['acme.com', 'partner.io'] },
});

Rules in the pack (priority order)

PriRuleVerdict
1sanctions-blockDeny if counterparty/address sanctioned
3counterparty-allowlistDeny if not on allowlist (when mode: 'pin')
5route-allowlistDeny if route not configured
8chain-allowlistDeny non-allowlisted chains
10per-transfer-ceilingDeny if amount > per-transfer cap
12velocity-ceiling-dayDeny if window utilisation exceeded
15velocity-ceiling-monthDeny if monthly cap exceeded
18dual-approval-thresholdEscalate dual_approval above threshold
20single-approval-defaultEscalate human_required for any financial write
25time-lock-triggerInject time-lock for high-value/unusual
30reputation-floorDeny if counterparty SBT reputation below floor
50idempotency-guardDeny if a contradicting idempotency record exists

Overriding

treasuryPolicyPack({
  /* ... */,
  overrides: {
    'per-transfer-ceiling': { priority: 10, params: { usdMicro: 20_000_000_000n } },
    'reputation-floor':     { disabled: true },
  },
});

Composing with other packs

import { policyComposition } from '@veridex/agents';
import { secretDetectionPack } from '@veridex/agent-security';
 
const policies = policyComposition([
  secretDetectionPack(),
  treasuryPolicyPack({ /* ... */ }),
]);

policyComposition flattens packs while preserving priority — secretDetectionPack rules fire before sanctions-block only if both target the same proposal; mismatched targets pass through.