/** * Security Scanner — evidence-tier severity resolution (SMI-5876) * @module @skillsmith/core/security/scanner/SecurityScanner.evidence * * Turns a pattern's `EvidenceType` (classified in * `patterns.jailbreak.evidence.ts`'s `EVIDENCE_TYPE_BY_PATTERN`, SMI-5881) * plus documentation context into a severity/confidence pair, and provides * the corroboration escalation that lifts a `mention`-tier finding when it * co-occurs with a genuinely dangerous non-documentation signal elsewhere in * the same scan. */ import type { EvidenceType, SecurityFinding, SecuritySeverity, FindingConfidence } from './types.js'; /** * Classify a pattern's evidence tier by object identity. Unmapped patterns * (i.e. a pattern added to JAILBREAK_PATTERNS/AI_DEFENCE_PATTERNS without an * `EVIDENCE_TYPE_BY_PATTERN` entry) default to `imperative_instruction` — * fail-closed: forgetting to classify a new pattern makes it the STRONGEST * tier, never the weakest, so a missed classification can never silently * soften detection. */ export declare function classifyEvidence(p: RegExp): EvidenceType; /** * Relative strength ordering used by the merge-loop in * `SecurityScanner.helpers.ts` to pick the strongest evidence per line across * both the multi-line and single-line scan passes. `imperative_instruction`, * `instruction_override`, and `state_assertion` are equal rank — the * severity table below treats them identically, and none needs to out-rank * the others. `state_assertion` (SMI-5876 design-pass follow-up) is a * distinct machine-readable REASON CODE for a declarative jailbroken-state * assertion ("Jailbreak activated") rather than a directive aimed at the * model — same severity tuple, different diagnostic label. */ export declare const EVIDENCE_RANK: Record; /** The highest rank in `EVIDENCE_RANK` — once reached, no later pattern on the same line can beat it. */ export declare const MAX_EVIDENCE_RANK = 2; /** * Severity/confidence decision table (SMI-5876 design §4.1). Doc-context * confidence for the directive tiers is `medium`, not `low` — `low` would be * self-contradictory next to a still-failing severity (it would also cut the * risk-score weight to 0.3x, which is not the intent for a directive payload * that merely happens to sit inside a fenced example). */ export declare const EVIDENCE_SEVERITY_TABLE: Record; /** Resolve the severity/confidence pair for an evidence tier + documentation context. */ export declare function resolveEvidenceSeverity(tier: EvidenceType, inDocumentationContext: boolean): { severity: SecuritySeverity; confidence: FindingConfidence; }; /** * Escalate a `mention`-tier finding when an ALLOWLISTED non-documentation * high/critical finding is ALSO present within `MAX_CORROBORATION_LINE_DISTANCE` * lines in the same scan (SMI-5876 design §4.3, corrected post-implementation — * see `CORROBORATING_SIGNALS`' doc comment for the denylist->allowlist fix and * the locality-window rationale). Mutates findings in place, mirroring * `escalateCodeExecution`'s mutation style (SecurityScanner.exec.ts). * * MUST run after `escalateCodeExecution` (SecurityScanner.ts's `scan()`) so a * freshly-critical `code_execution` finding can itself serve as a * corroborator. No feedback loop the other way: `CODE_EXECUTION_CO_OCCURRENCE` * (SecurityScanner.exec.ts) contains only `data_exfiltration`, * `privilege_escalation`, `sensitive_path`, and `obfuscated_directive` — never * `jailbreak` or `ai_defence` — so lifting a mention here can never * retroactively change `escalateCodeExecution`'s own decision (verified by * reading SecurityScanner.exec.ts directly, SMI-5876 implementation). */ export declare function escalateCorroboratedMentions(findings: SecurityFinding[]): void; //# sourceMappingURL=SecurityScanner.evidence.d.ts.map