Agent Armor API Reference
    Preparing search index...

    Interface Detector

    The interface every detector (pattern-based, ML, or custom) implements.

    interface Detector {
        category: TrapCategory;
        id: string;
        name: string;
        sanitize(content: string, threats: Threat[]): string;
        scan(content: string, options?: DetectorOptions): DetectorResult;
        scanAsync?(
            content: string,
            options?: DetectorOptions,
        ): Promise<DetectorResult>;
    }

    Implemented by

    Index
    category: TrapCategory

    Which trap category this detector addresses

    id: string

    Unique identifier for this detector

    name: string

    Human-readable name

    • Return sanitized content with threats neutralized

      Parameters

      • content: string
      • threats: Threat[]

      Returns string