Agent Armor API Reference
    Preparing search index...

    Interface AuditRecord

    A durable, structured record of one scan decision — the substrate for SOC2/ISO27001-style audit trails (#38). decision is Agent Armor's own classification derived from riskLevel, NOT a guarantee of what your application actually did with the ScanResult — that decision happens in your code, after the scan call returns, where the SDK can't observe it.

    interface AuditRecord {
        batchId?: string;
        categories: TrapCategory[];
        decision: "allow" | "sanitize" | "block" | "exception";
        durationMs: number;
        exception?: { actor: string; reason: string };
        index?: number;
        mlModelVersion?: string;
        patternDbVersion: string;
        scanId: string;
        schemaVersion: "audit-record.v1";
        source:
            | "scanSync"
            | "scan"
            | "scanRAGChunks"
            | "scanOutput"
            | "scanSession";
        strictness: Strictness;
        threats: AuditThreatSummary[];
        timestamp: string;
    }
    Index
    batchId?: string

    Shared across every record from the same top-level call (e.g. all chunks in one scanRAGChunks call). Undefined for single-content calls.

    categories: TrapCategory[]

    Unique categories among detected threats.

    decision: "allow" | "sanitize" | "block" | "exception"

    Agent Armor's classification of this scan — see the interface doc comment above.

    durationMs: number

    Scan duration in ms.

    exception?: { actor: string; reason: string }

    Populated only when decision === 'exception' — both fields required (cannot omit reason or actor).

    index?: number

    Chunk index (scanRAGChunks) or turn index (scanSession). Undefined for single-content calls.

    mlModelVersion?: string

    ML model version, present only when the ML classifier ran for this scan.

    patternDbVersion: string

    Pattern database version that produced this decision.

    scanId: string

    Unique id for this specific decision (one per chunk/turn, not per API call).

    schemaVersion: "audit-record.v1"

    Record format version, for forward compatibility.

    source: "scanSync" | "scan" | "scanRAGChunks" | "scanOutput" | "scanSession"

    Which SDK entry point produced this record.

    strictness: Strictness

    Confidence-threshold preset active for this scan.

    Per-threat summaries — see AuditThreatSummary.

    timestamp: string

    ISO 8601 timestamp of when this scan decision completed.