/** * Cost policy engine for x402-cfo agent. * * Declarative rules that determine whether a payment should be made. * Policies are checked BEFORE budget enforcement — a policy denial * means the agent won't even attempt the payment. */ export interface PolicyRules { /** Max amount in dollars for any single request. */ maxPerRequest?: number; /** URLs that are allowed (if set, only these are permitted). */ allowlist?: string[]; /** URLs that are explicitly blocked. */ blocklist?: string[]; /** Allowed currencies (e.g. ['USDC']). */ allowedCurrencies?: string[]; /** Allowed networks (e.g. ['base', 'ethereum']). */ allowedNetworks?: string[]; } export type PolicyDenialReason = 'exceeds_max_per_request' | 'url_not_in_allowlist' | 'url_in_blocklist' | 'currency_not_allowed' | 'network_not_allowed'; export interface PolicyDecision { allowed: boolean; reason?: PolicyDenialReason; message?: string; } export declare class Policy { private rules; constructor(rules?: PolicyRules); /** * Check if a proposed payment passes policy rules. */ check(params: { url: string; amount: number; currency: string; network: string; }): PolicyDecision; /** Simple URL matching: exact match or domain prefix match. */ private matchUrl; } //# sourceMappingURL=policy.d.ts.map