/**
 * Policy Enforcer — validates skill invocations against the 5-stage policy pipeline.
 *
 * Pipeline stages:
 *   1. Parse    — extract action intent from request
 *   2. Validate — schema validation of policy rules
 *   3. Enforce  — apply tool, model, and rate policies
 *   4. Log      — emit av.policy.evaluate telemetry span
 *   5. Report   — aggregate policy metrics
 *
 * Integration points:
 *   - AgentVaultMcpServer wraps tool handlers with enforce()
 *   - Channel.deliver() checks before forwarding sensitive messages
 *   - agentvault_check_policy MCP tool calls evaluate()
 */
import type { SkillDefinition } from "./mcp-server.js";
import { type TelemetrySpan } from "@agentvault/crypto";
export interface PolicyContext {
    skillName: string;
    toolName?: string;
    model?: string;
    args?: Record<string, unknown>;
    agentId?: string;
}
export interface PolicyResult {
    allowed: boolean;
    violations: PolicyViolation[];
    stage: "parse" | "validate" | "enforce" | "log" | "report";
}
export interface PolicyViolation {
    ruleId: string;
    scope: "tool" | "model" | "rate" | "network" | "custom";
    action: "block" | "warn" | "log";
    type: string;
    message: string;
    details?: Record<string, unknown>;
}
export interface PolicyMetrics {
    totalEvaluations: number;
    totalBlocks: number;
    totalWarnings: number;
    bySkill: Record<string, {
        evaluations: number;
        blocks: number;
    }>;
    byRule: Record<string, number>;
}
export declare class PolicyEnforcer {
    private skills;
    private metrics;
    private spanBuffer;
    /**
     * Register a skill definition for policy evaluation.
     */
    registerSkill(skill: SkillDefinition): void;
    /**
     * Full 5-stage policy pipeline evaluation.
     */
    evaluate(ctx: PolicyContext): PolicyResult;
    /**
     * Wrap an MCP tool handler with policy enforcement.
     * Returns a function that checks policy before calling the original handler.
     */
    wrapHandler(skillName: string, handler: (args: Record<string, unknown>) => Promise<unknown>): (args: Record<string, unknown>) => Promise<unknown>;
    /**
     * Get accumulated policy metrics.
     */
    getMetrics(): PolicyMetrics;
    /**
     * Drain buffered telemetry spans.
     */
    drainSpans(): TelemetrySpan[];
    /**
     * Reset all metrics (for testing).
     */
    resetMetrics(): void;
}
//# sourceMappingURL=policy-enforcer.d.ts.map