import { type RiskTier, type IntentCategory } from './patterns.js';
/**
 * Input for risk assessment - matches intent submission shape
 */
export interface CreateIntent {
    /** Action to be performed (e.g., 'data:read', 'model:train') */
    action: string;
    /** Resource being accessed */
    resource: string;
    /** Action-specific parameters */
    parameters?: Record<string, unknown>;
    /** Existing risk score if provided externally */
    riskScore?: number;
}
/**
 * Risk factor that contributed to the assessment
 */
export interface RiskFactor {
    /** Factor identifier */
    name: string;
    /** Points added or subtracted */
    points: number;
    /** Description of why this factor applies */
    reason: string;
}
/**
 * Required approvals based on risk assessment
 */
export interface RequiredApprovals {
    /** Whether human review is required */
    humanReview: boolean;
    /** Whether manager/supervisor approval is needed */
    managerApproval: boolean;
    /** Whether security team review is needed */
    securityReview: boolean;
    /** Minimum trust level required to execute */
    minTrustLevel: number;
}
/**
 * Complete risk assessment result
 */
export interface RiskAssessment {
    /** Final risk score (0-100) */
    riskScore: number;
    /** Risk tier classification */
    riskTier: RiskTier;
    /** Factors that contributed to the score */
    factors: RiskFactor[];
    /** Category of the intent */
    category: IntentCategory;
    /** Required approvals based on risk level */
    requiredApprovals: RequiredApprovals;
    /** Assessment timestamp */
    assessedAt: string;
}
/**
 * Historical pattern information for risk adjustment
 */
export interface HistoricalPattern {
    /** Total number of similar intents processed */
    totalCount: number;
    /** Number of successful completions */
    successCount: number;
    /** Number of failures */
    failureCount: number;
    /** Whether this is a first-time action/resource combination */
    isFirstTime: boolean;
    /** Average processing time in milliseconds */
    avgProcessingTimeMs?: number;
}
/**
 * Configuration for risk assessment
 */
export interface RiskAssessorConfig {
    /** Default risk score for unknown actions (default: 40) */
    defaultRiskScore: number;
    /** Enable historical pattern analysis (default: true) */
    useHistoricalPatterns: boolean;
    /** Provider for historical patterns (optional) */
    historicalPatternProvider?: (intent: CreateIntent) => Promise<HistoricalPattern | null>;
}
/**
 * RiskAssessor class for evaluating intent risk
 *
 * Provides rule-based risk assessment without external ML dependencies.
 * Risk scores are calculated based on:
 * - Action type and its inherent risk
 * - Resource sensitivity (PII, financial, credentials, etc.)
 * - Historical patterns (optional)
 * - Parameter-based modifiers
 */
export declare class RiskAssessor {
    private config;
    constructor(config?: Partial<RiskAssessorConfig>);
    /**
     * Assess the risk of an intent
     *
     * @param intent - The intent to assess
     * @param historicalPattern - Optional historical pattern data
     * @returns Complete risk assessment
     */
    assessRisk(intent: CreateIntent, historicalPattern?: HistoricalPattern | null): Promise<RiskAssessment>;
    /**
     * Perform the actual risk assessment
     */
    private performAssessment;
    /**
     * Calculate risk adjustments based on historical patterns
     *
     * Adjustment Rules:
     * - High failure rate (>30%): +15 points (indicates problematic pattern)
     * - First-time action: +10 points (unknown behavior)
     * - Frequent success (>10 with >90% success): -5 points (established safe pattern)
     */
    private calculateHistoricalAdjustments;
    /**
     * Calculate risk adjustments based on intent parameters
     *
     * Parameter Flags:
     * - bulk: true -> +20 points (bulk operations have wider impact)
     * - crossTenant: true -> +25 points (cross-tenant requires extra scrutiny)
     * - elevated: true -> +15 points (elevated privilege request)
     * - dryRun: true -> -10 points (dry run is safer)
     */
    private calculateParameterAdjustments;
    /**
     * Calculate required approvals based on risk assessment
     *
     * Approval Thresholds:
     * - low (0-25): No special approvals, minTrustLevel 1
     * - medium (26-50): Human review recommended, minTrustLevel 2
     * - high (51-75): Human review + manager approval, minTrustLevel 3
     * - critical (76-100): Human review + manager + security review, minTrustLevel 4
     *
     * Additional rules for specific categories:
     * - system-config always requires manager approval if score > 40
     * - external-integration with payments requires security review
     */
    private calculateRequiredApprovals;
}
/**
 * Create a new RiskAssessor instance with optional configuration
 */
export declare function createRiskAssessor(config?: Partial<RiskAssessorConfig>): RiskAssessor;
export type { RiskTier, IntentCategory } from './patterns.js';
//# sourceMappingURL=risk.d.ts.map