/** * Policy Loader * * Loads and merges policy files from disk. * Handles base policies and overlays with priority ordering. */ import type { PolicyOverlay, ConfidenceThresholds } from '../types/index.js'; export interface PolicyFile { id: string; name: string; version: string; description: string; created: string; priority: number; extends?: string; classification?: string; symbol_overrides?: Record; tool_bindings?: ToolBindings; thresholds?: Partial; enforcement?: EnforcementConfig; drift_detection?: DriftDetectionConfig; features?: Record; extensions?: Record; decoy_responses?: DecoyConfig; ontology?: Record>; validation_rules?: Record; } export interface SymbolOverride { name?: string; description?: string; blocked?: boolean; replacement?: string; enforcement?: string; allow_execution?: boolean; sandbox?: boolean; silent_transforms?: boolean; original_meaning_suppressed?: boolean; pre_execution_hook?: string; post_execution_hook?: string; } export interface ToolBindings { allowed?: string[]; blocked?: string[]; require_approval?: string[]; default_allowed?: string[]; default_blocked?: string[]; domain_specific?: Record; transform_outputs?: { enabled: boolean; transforms: Array<{ type: string; [key: string]: unknown; }>; }; } export interface EnforcementConfig { audit_all_operations?: boolean; audit_encrypted?: boolean; audit_destination?: string; require_explicit_mode?: boolean; block_unknown_symbols?: boolean; require_domain?: boolean; max_delegation_depth?: number; max_concurrent_agents?: number; compartmentalization?: { enabled: boolean; need_to_know?: boolean; agent_isolation?: boolean; }; } export interface DriftDetectionConfig { check_frequency_ms?: number; tripwire_frequency?: number; circuit_breaker_threshold?: number; auto_halt_on_drift?: boolean; silent_tripwires?: boolean; behavior_profiling?: boolean; } export interface DecoyConfig { enabled: boolean; trigger_on: string[]; response_type: string; log_decoy_usage?: boolean; } export declare class PolicyLoader { private basePoliciesDir; private overlaysDir; private loadedPolicies; constructor(policiesRoot: string); /** * Load all policies from disk */ loadAll(): void; private loadDirectory; /** * Get a specific policy by ID */ getPolicy(id: string): PolicyFile | undefined; /** * List all loaded policy IDs */ listPolicies(): string[]; /** * Get merged policy with inheritance resolved */ getMergedPolicy(id: string): PolicyFile | undefined; private mergePolicies; private mergeToolBindings; /** * Convert policy to PolicyOverlay format */ toPolicyOverlay(id: string): PolicyOverlay | undefined; private convertSymbolOverrides; } export declare function initializePolicyLoader(policiesRoot: string): PolicyLoader; export declare function getPolicyLoader(): PolicyLoader; //# sourceMappingURL=loader.d.ts.map