Skip to content

Calibration

Luis edited this page Dec 2, 2026 · 1 revision

Calibration

Moved from the README (2026-12-02). Where this page and the ADRs disagree, the ADRs win.

Calibration is language-neutral (#358, ADR 0037): its 64 tasks are short programs in one minimal pseudocode (input, transform, sink, each vulnerable task with a safe twin), two templates for each class a scan reads. The tier measures what it decides on (keeping the closed schema, usable context, following data from an input to a sink), not knowledge of your repository's languages, so the same model gets the same tier on every repository, and every report says so (calibration scope: in the text summary, a line under the Markdown class table, a SARIF note, coverage.calibration_scope in JSON v1). Language competence is protected by design instead: union only, the discovery canary in every batch, and exit 4 on anything not read in full; creep bench reports quality per language as data and never gates a scan.

Cost. Calibration costs time before the first finding: 64 task calls plus probes and retries. On a CPU-only GitHub runner, qwen2.5-coder:7b took 70 calls and 932 s, and qwen2.5-coder:1.5b 89 calls and 425 s; on a 4-core laptop CPU without a GPU a 1.5B model takes about 11 s per call (#367). A hosted model takes seconds per call. --stats prints what calibration spent, and the nightly bench publishes it for its pinned model (calibration in its results, ADR 0030 amendment).

Cache. A calibration is kept in your user cache directory for calibration.cache_days (default 30) and reused only for the same contract, endpoint, model name, structured-output mode, max output tokens and retries, and the same creep task set and prompts; changing any of them calibrates again. creep cannot see which snapshot a model name points to: a dated name (model-2025-06-01) gets its own entry, but an alias such as -latest that the provider moves to a new snapshot keeps its cached tier until the entry expires. Pin a dated model name, or pass --recalibrate after the provider updates the alias. The calibration: line of creep scan shows the tier and, when the context probe stopped early, the size and reason (for example 8 KiB probe: HTTP 400, which holds the model at tier S). A calibrations/ cache directory that is a link or junction is refused before any model call, also with --recalibrate; the error names the directory to remove.

Unfit models

After calibration creep checks a fitness floor over the classes the planner can plan, which are every calibrated class (sqli, nosql_injection, command_injection, path_traversal, ssrf, template_injection, code_injection, insecure_deserialization: 8 tasks each, 64 in all, half of them safe twins). Per-class scores are indicative only: the intervals assume independent tasks, but each class's 8 tasks come from 2 templates, so the decisions are this floor over all 64 tasks and the tier. A model is unfit when its score there is not above chance at 95% confidence (Wilson lower bound under 1/2; 40 of 64 right is the least that passes) or when it does not call at least half the safe twins safe. The scan then stops with exit 3, sends no repository file and writes no report, and the message gives the numbers, for example model unfit (below_chance): 32 of 64 tasks in the planned classes right (95% lower bound 0.381, ...); 32 of 32 safe twins not called safe. The verdict is cached with the calibration, so the next scan refuses again without calibrating. --allow-unfit-model (a flag only, on scan and resume; no config file can set it, and creep mcp refuses it) scans anyway: the calibration line says UNFIT, and every finding from the model is labeled unreliable_model in the text summary, creep why, Markdown, SARIF and JSON v1 ("unreliable_model": true); findings from gitleaks and osv-scanner are not. The run is marked as well, so a run with no findings never reads clean: an UNRELIABLE MODEL line in the text summary and Markdown, run.unreliable_model in JSON v1, and a SARIF run property and error notification. Such a run writes no baseline (--allow-unfit-model with --baseline-write exits 2) and no --stability record. The label never changes a status or the gate. The tier rule reads the same planned classes only (ADR 0036).

Clone this wiki locally