/**
 * Safety classification utilities.
 *
 * Provides functions for classifying user prompts as safe or unsafe
 * before they are processed by the main LLM model. Uses a fast LLM
 * model to perform binary classification with justification.
 */
import type { LanguageModelV3 } from "@ai-sdk/provider";
import type { UserModelMessage } from "ai";
/**
 * Categories of unsafe content that can be detected.
 */
export type SafetyCategory = "harmful_instructions" | "illegal_activity" | "malicious_code" | "personal_data_extraction" | "prompt_injection" | "jailbreak_attempt" | "system_extraction" | "other";
/**
 * Result of safety classification.
 */
export interface SafetyClassificationResult {
    /** Whether the prompt is safe to process */
    safe: boolean;
    /** Brief justification for the classification */
    justification: string;
    /** Categories that triggered unsafe classification (only if unsafe) */
    categories?: SafetyCategory[];
}
/**
 * Options for safety classification.
 */
export interface SafetyClassificationOptions {
    /** Model to use for classification (should be a fast model like Haiku) */
    model: LanguageModelV3;
    /** Timeout in milliseconds (default: 5000) */
    timeout?: number;
    /** Abort signal for cancellation */
    abortSignal?: AbortSignal;
}
/**
 * Configuration for safety classification in LLMClient.
 */
export interface SafetyClassificationConfig {
    /** Whether safety classification is enabled */
    enabled: boolean;
    /** Model to use for classification */
    model?: LanguageModelV3;
    /** Custom timeout in milliseconds (default: 5000) */
    timeout?: number;
    /** Whether to fail-open (allow) or fail-closed (block) on classification errors (default: true) */
    failOpen?: boolean;
    /** Which text parts to scan: "all" (default) or "last" (user prompt only) */
    scope?: "all" | "last";
}
/**
 * Default classification result for fail-open scenarios.
 * Returns safe=true to allow the request to proceed.
 */
export declare const FAIL_OPEN_RESULT: SafetyClassificationResult;
/**
 * Default classification result for fail-closed scenarios.
 * Returns safe=false to block the request.
 */
export declare const FAIL_CLOSED_RESULT: SafetyClassificationResult;
/**
 * Classifies a user prompt for safety.
 *
 * Uses a fast LLM model to determine if the prompt is safe to process.
 * Returns a structured result with classification and justification.
 *
 * @param prompt - The user prompt text to classify
 * @param options - Classification options including model and timeout
 * @returns Promise resolving to classification result
 *
 * @example
 * ```typescript
 * const result = await classifyPromptSafety(userPrompt, {
 *   model: provider.modelForTask("safetyClassification"),
 *   timeout: 5000,
 * });
 *
 * if (!result.safe) {
 *   console.log(`Blocked: ${result.justification}`);
 * }
 * ```
 */
export declare function classifyPromptSafety(prompt: string, options: SafetyClassificationOptions): Promise<SafetyClassificationResult>;
/**
 * Creates a blocked user message with classification justification.
 *
 * When a prompt is classified as unsafe, this function creates a replacement
 * user message that informs the main model about the block. The main model
 * can then generate an appropriate response explaining why the request
 * was blocked.
 *
 * @param _originalUser - The original user message (unused, kept for potential future use)
 * @param classification - The safety classification result
 * @returns User message with blocked content
 *
 * @example
 * ```typescript
 * if (!classification.safe) {
 *   const blockedMessage = createBlockedUserMessage(originalUser, classification);
 *   // blockedMessage.content = "[BLOCKED] User prompt was blocked because..."
 * }
 * ```
 */
export declare function createBlockedUserMessage(_originalUser: UserModelMessage, classification: SafetyClassificationResult): UserModelMessage;
//# sourceMappingURL=safety-classifier.d.ts.map