dd-trace
    Preparing search index...

    Interface AIGuard

    AI Guard security client for evaluating AI conversations.

    interface AIGuard {
        evaluate(
            messages: aiguard.Message[],
            opts?: { block?: boolean },
        ): Promise<Evaluation>;
    }
    Index

    Methods

    Methods

    • Evaluates a conversation thread.

      Parameters

      • messages: aiguard.Message[]

        Array of conversation messages

      • Optionalopts: { block?: boolean }

        Optional configuration object:

        • block: When true, throws an exception if evaluation result is not 'ALLOW' and the AI Guard service has blocking mode enabled (default: false).

      Returns Promise<Evaluation>

      Promise resolving to an Evaluation with the security decision and reasoning. The promise rejects with AIGuardAbortError when opts.block is true and the evaluation result would block the request. The promise rejects with AIGuardClientError when communication with the AI Guard service fails.