Agent Armor API Reference
    Preparing search index...

    Interface ScanResult

    The result of scanning one piece of content for agent traps.

    interface ScanResult {
        clean: boolean;
        durationMs: number;
        riskLevel: RiskLevel;
        sanitized: string;
        stats: {
            degraded?: boolean;
            detectorsRun: number;
            detectorsSkipped?: { detectorId: string; reason: string }[];
            failedDetectors?: string[];
            highestSeverity: Severity | null;
            threatsFound: number;
        };
        threats: Threat[];
    }
    Index
    clean: boolean

    True only when every detector ran and found nothing. It is false when a threat was found, and also when a detector threw (see stats.degraded).

    durationMs: number

    Time taken in milliseconds

    riskLevel: RiskLevel

    Single roll-up risk assessment derived from the dominant threat. none when no threat was found. Lets integrators decide with one comparison (if (result.riskLevel === 'critical') block()).

    sanitized: string

    Sanitized version of the content with threats neutralized

    stats: {
        degraded?: boolean;
        detectorsRun: number;
        detectorsSkipped?: { detectorId: string; reason: string }[];
        failedDetectors?: string[];
        highestSeverity: Severity | null;
        threatsFound: number;
    }

    Summary stats

    Type Declaration

    • Optionaldegraded?: boolean

      True when at least one detector threw during this scan, so the content was not fully checked. Present only then. clean is false on a degraded scan even when no threat was found, and riskLevel still reflects only the threats that were found.

    • detectorsRun: number
    • OptionaldetectorsSkipped?: { detectorId: string; reason: string }[]

      Detectors that ran but could not judge this input (see DetectorResult.skipped). Present only when at least one did.

    • OptionalfailedDetectors?: string[]

      Ids of the detectors that threw. Present only when degraded is true.

    • highestSeverity: Severity | null
    • threatsFound: number
    threats: Threat[]

    All detected threats, sorted by severity desc