import { OutputGuardrail } from "../guardrails/types.js"; //#region src/inspect/injection-classifier.d.ts /** The surface a classification request originates from. @stable */ type InjectionClassifierSurface = 'tool-inbound' | 'assistant-output' | 'memory-write'; /** One classification request. @stable */ interface InjectionClassifierInput { readonly text: string; readonly surface: InjectionClassifierSurface; /** Optional provenance label, e.g. `'channel:telegram'`. */ readonly origin?: string; } /** One classification verdict. @stable */ interface InjectionClassification { readonly flagged: boolean; /** Confidence in [0, 1], when the engine reports one. */ readonly score?: number; /** Bounded descriptive labels (audit counters). */ readonly labels?: ReadonlyArray; } /** * The pluggable classifier contract. * * @stable */ interface InjectionClassifier { /** Stable engine id for audit rows, e.g. `'deberta-injection-v2'`. */ readonly id: string; classify(input: InjectionClassifierInput): Promise; } /** * Resilient invocation helper: `undefined` classifier, a rejected * promise or a thrown error all yield `null` - the calling surface * proceeds on its regex verdict alone. This is the ONLY sanctioned * way framework surfaces consult a classifier. * * @stable */ declare function runInjectionClassifier(classifier: InjectionClassifier | undefined | null, input: InjectionClassifierInput): Promise; /** Options for {@link injectionClassifierOutputGuardrail}. @stable */ interface InjectionClassifierGuardrailOptions { /** * What a flagged output does to the run: `'warn'` (default) logs * and continues, `'block'` fails the run. */ readonly action?: 'warn' | 'block'; } /** * Adapter for the output-guardrail surface: wrap a classifier * as an `OutputGuardrail` and add it to * `createAgent({ guardrails: { output: [...] } })`. Non-string * outputs pass through; classifier errors pass through (resilience * contract). * * @stable */ declare function injectionClassifierOutputGuardrail(classifier: InjectionClassifier, options?: InjectionClassifierGuardrailOptions): OutputGuardrail; //#endregion export { InjectionClassification, InjectionClassifier, InjectionClassifierGuardrailOptions, InjectionClassifierInput, InjectionClassifierSurface, injectionClassifierOutputGuardrail, runInjectionClassifier }; //# sourceMappingURL=injection-classifier.d.ts.map