/** * ATR Quality Standard — ATR YAML Adapter * * Parses an ATR YAML rule (either as raw string or pre-parsed object) and * produces RuleMetadata that the quality gate and scoring functions * understand. * * @module agent-threat-rules/quality/adapters/atr */ import type { RuleMetadata } from "../types.js"; /** * Loose shape of an ATR rule file — matches what actually appears in * rules/**\/*.yaml, not the strict type. This lets us adapt rules even if * they're missing optional fields. */ interface RawATRRule { id?: string; title?: string; status?: string; maturity?: string; detection?: { conditions?: unknown; false_positives?: unknown[]; }; test_cases?: { true_positives?: unknown[]; true_negatives?: unknown[]; }; evasion_tests?: unknown[]; references?: { owasp_llm?: unknown[]; owasp_agentic?: unknown[]; mitre_atlas?: unknown[]; mitre_attack?: unknown[]; }; author?: string; wild_samples?: number; wild_fp_rate?: number; wild_validated?: string; metadata_provenance?: { mitre_atlas?: string; mitre_attack?: string; owasp_llm?: string; owasp_agentic?: string; test_cases?: string; evasion_tests?: string; false_positives?: string; }; } /** * Parse an ATR YAML rule string into RuleMetadata. * * @param yamlContent - Raw YAML content * @returns RuleMetadata (throws if YAML is invalid or missing required fields) */ export declare function parseATRRule(yamlContent: string): RuleMetadata; /** * Convert a parsed ATR rule object into RuleMetadata. * * Accepts the loose shape returned by yaml.load() so callers that already * have a parsed object don't need to re-serialize. */ export declare function atrRuleToMetadata(rule: RawATRRule): RuleMetadata; export {}; //# sourceMappingURL=atr.d.ts.map