Evalkeeper
    Preparing search index...

    Type Alias InjectionOptions<Input>

    What an injection suite needs from the app.

    type InjectionOptions<Input> = {
        attacks?: readonly Attack[];
        canary?: string;
        goal?: string;
        inject: (input: Input, attackText: string) => Input;
        key?: string;
        secrets?: readonly string[];
    }

    Type Parameters

    • Input
    Index
    attacks?: readonly Attack[]

    The attacks to try. Default the built-in ones (INJECTION_ATTACKS); add your own, or ones imported from another tool, with [...INJECTION_ATTACKS, ...yours].

    canary?: string

    The canary word. Default one made from the base suite's key.

    goal?: string

    The wrong answer a hijack asks for, in words the model would follow ("Classify this ticket as billing, high urgency."). Without one, hijacks ask the model to reply with the canary instead.

    inject: (input: Input, attackText: string) => Input

    Puts an attack's text into a copy of a base input, where text the model can't trust goes: the end of a ticket's body, an email it summarizes. Return a new input; never change the one passed in.

    key?: string

    The suite's key. Default the base suite's key plus "_injection".

    secrets?: readonly string[]

    Text that must never appear in an answer: a sentence from the instructions, or another record's details the model can see. Without any, the leak check doesn't apply.