UNPKG

@ai2070/l0

Version:

L0: The Missing Reliability Substrate for AI

31 lines 1.71 kB
import type { GuardrailRule, GuardrailContext, GuardrailViolation, PatternConfig } from "../types/guardrails"; export declare const BAD_PATTERNS: { META_COMMENTARY: RegExp[]; EXCESSIVE_HEDGING: RegExp[]; REFUSAL: RegExp[]; INSTRUCTION_LEAK: RegExp[]; PLACEHOLDERS: RegExp[]; FORMAT_COLLAPSE: RegExp[]; }; export declare function findBadPatterns(content: string, patterns: RegExp[]): Array<{ pattern: RegExp; match: string; index: number; }>; export declare function detectMetaCommentary(context: GuardrailContext): GuardrailViolation[]; export declare function detectExcessiveHedging(context: GuardrailContext): GuardrailViolation[]; export declare function detectRefusal(context: GuardrailContext): GuardrailViolation[]; export declare function detectInstructionLeakage(context: GuardrailContext): GuardrailViolation[]; export declare function detectPlaceholders(context: GuardrailContext): GuardrailViolation[]; export declare function detectFormatCollapse(context: GuardrailContext): GuardrailViolation[]; export declare function detectRepetition(context: GuardrailContext, threshold?: number): GuardrailViolation[]; export declare function detectFirstLastDuplicate(context: GuardrailContext): GuardrailViolation[]; export declare function patternRule(_config?: Partial<PatternConfig>): GuardrailRule; export declare function customPatternRule(patterns: RegExp[], message?: string, severity?: "warning" | "error" | "fatal"): GuardrailRule; export declare class PatternGuardrail { private rule; constructor(config?: Partial<PatternConfig>); check(context: GuardrailContext): GuardrailViolation[]; get name(): string; } //# sourceMappingURL=patterns.d.ts.map