import { SyncGuardrailDetector } from "../contracts/guardrail.contract.mjs"; import { InjectionDetectorOptions } from "../contracts/guard-options.type.mjs"; //#region ../ai/src/guard/detectors/injection.d.ts /** * Build the built-in `injection` detector (surfaced as * `ai.guardrail.injection(options?)`). Matches a curated set of jailbreak / * prompt-injection marker phrases — override (`"ignore previous * instructions"`), role-reset (`"you are now"`), jailbreak (`"developer * mode"`, `"do anything now"`), and exfiltration (`"reveal your system * prompt"`) — extensible with caller `markers` (case-insensitive substrings * or `RegExp`s). * * Zero runtime dependency: matching is pure string / regex. On a hit the * verdict is `flag` by default (record but allow); pass `onMatch: "block"` * to reject instead — commonly used on the `input` phase, where the core * `trip.before` seam supports `block` / `flag` only. * * @param options - Extra `markers` and the `onMatch` action (`"flag"` | `"block"`). * @returns A {@link SyncGuardrailDetector} for the guard's `input` / `output` / `tool` arrays. * * @example * const guard = ai.guardrail({ * input: [ai.guardrail.injection({ onMatch: "block" })], * output: [ai.guardrail.injection()], // flag-only on the model's reply * }); * * @example * // Extend the built-in set with a house rule. * ai.guardrail.injection({ markers: [/system\s*:\s*override/i, "sudo mode"] }); */ declare function injection(options?: InjectionDetectorOptions): SyncGuardrailDetector; //#endregion export { injection }; //# sourceMappingURL=injection.d.mts.map