Agent Armor API Reference
    Preparing search index...

    Interface MLConfig

    ML classifier configuration, passed as config.ml to AgentArmor.create.

    interface MLConfig {
        apiKey?: string;
        detector?: Detector;
        download?: MLDownloadConfig;
        enabled?: boolean;
        modelChecksums?: {
            "label_map.json": string;
            "model_quantized.onnx": string;
            "tokenizer.json": string;
        };
        modelDir?: string;
        modelUrl?: string;
        onUnavailable?: "throw"
        | "warn-and-skip"
        | "silent-skip";
    }
    Index
    apiKey?: string

    API key for Pro tier pattern/model updates (future)

    detector?: Detector

    Inject a custom Detector (skips model download, useful for testing)

    download?: MLDownloadConfig

    Download configuration

    enabled?: boolean

    Enable ML classifier (downloads model on first use)

    modelChecksums?: {
        "label_map.json": string;
        "model_quantized.onnx": string;
        "tokenizer.json": string;
    }

    SHA-256 checksums for custom model artifacts. Supply all three entries when using a model that differs from this package's pinned release.

    modelDir?: string

    Local directory containing ONNX model + tokenizer files

    modelUrl?: string

    Custom model download URL (future)

    onUnavailable?: "throw" | "warn-and-skip" | "silent-skip"

    Behavior when ML model is unavailable