import type { CanonicalState, CapabilityInvocation } from "../types/index.js"; /** Policy effect types */ export type PolicyEffect = "ALLOW" | "DENY" | "REQUIRE_VERIFICATION" | "WARN"; /** Policy severity */ export type PolicySeverity = "informational" | "low" | "medium" | "high" | "critical"; /** Policy definition */ export type Policy = { id: string; name: string; scope: PolicyScope; condition: PolicyCondition; effect: PolicyEffect; severity: PolicySeverity; enabled: boolean; }; /** Policy scope */ export type PolicyScope = { capabilities?: string[]; objectTypes?: string[]; actors?: string[]; excludeActors?: string[]; }; /** Policy condition function */ export type PolicyCondition = (intent: CapabilityInvocation, state: CanonicalState) => boolean; /** Policy evaluation result */ export type PolicyEvaluation = { policyId: string; effect: PolicyEffect; severity: PolicySeverity; matched: boolean; reason?: string; }; /** Policy engine — evaluates all policies against intent + state */ export declare class PolicyEngine { private policies; private _frozen; /** Register a policy */ register(policy: Policy): void; /** Remove a policy */ unregister(policyId: string): void; /** List all policies */ list(): Policy[]; /** Freeze the policy engine — no further policy changes */ freeze(): void; /** Check if the policy engine is frozen */ isFrozen(): boolean; /** Evaluate all applicable policies for an intent */ evaluate(intent: CapabilityInvocation, state: CanonicalState): PolicyEvaluation[]; /** Check if intent is allowed (aggregate policy result) */ isAllowed(intent: CapabilityInvocation, state: CanonicalState): { allowed: boolean; reason?: string; }; /** Get default system policies */ static getDefaultPolicies(): Policy[]; } /** Create a policy engine with default policies */ export declare function createPolicyEngine(): PolicyEngine;