Documentation
How to run an audit, what Veritas changes about each question, and how to read the verdicts it reports.
Overview
Veritas checks whether a model's benchmark performance survives changes that should not matter: moving the answer options, renaming their labels, rewriting the prompt template. It records every prompt and response, scores each item against its own variants, and writes a signed evidence package in JSON, Markdown, and HTML.
Models are reached through four adapters: openai_compatible for any OpenAI-style HTTP endpoint, vllm for local servers, huggingface_local for direct Transformers inference with token log-probabilities, and replay for recorded responses. Responses can be cached so interrupted runs resume without paying twice.
Install
python -m pip install "veritas-leakage[cli]" # local Transformers inference and the named benchmark catalog python -m pip install "veritas-leakage[cli,local-model,benchmarks]" # from a checkout uv sync --extra cli
Other extras: mcp exposes the tools to MCP clients, and yaml accepts YAML audit specs. List the built-in benchmarks with veritas benchmarks.
Run an audit
An audit spec names a benchmark, a model, the transformations to apply, and the detectors to run. inspect validates it and estimates requests and tokens before anything is sent.
{
"benchmark": { "adapter": "catalog", "name": "mmlu", "limit": 100 },
"model": {
"id": "gpt-4o-mini",
"adapter": "openai_compatible",
"endpoint": "https://api.openai.com/v1",
"generation": { "temperature": 0, "max_tokens": 16 }
},
"transformations": [
{ "type": "choice_permutation" },
{ "type": "choice_label_remap" },
{ "type": "formatting" }
],
"detectors": [
{ "type": "perturbation" },
{ "type": "option_order" },
{ "type": "template_dependence" }
]
}export MODEL_API_KEY=... veritas inspect --config audit.json veritas audit --config audit.json --out audit-run/
The same spec works for any OpenAI-compatible endpoint: change model.id and model.endpoint. Requests run 4 at a time by default (set generation.extra.concurrency), rate limits are retried using the provider's Retry-After, and with runtime.cache_dir set an interrupted run resumes without paying twice. Reasoning models need max_tokens of 1024 or more; if most answers are unreadable, the verdict is inconclusive, never "robust".
Catalog benchmarks download from Hugging Face and need the benchmarks extra. For your own data, use {"adapter": "jsonl", "path": "items.jsonl"} with one item per line.
The run prints the scores and each verdict, and writes report.json, report.md, and report.html. Open report.json in the report viewer to see every item, response, and variant.
Browser runner
The browser runner audits up to 50 items from eight public multiple-choice benchmarks against OpenAI, Anthropic, Google Gemini, xAI, Mistral, DeepSeek, Together, Fireworks, Groq, OpenRouter, or Hugging Face. Each item is asked three ways: as published, with the options moved, and in a different template. Your key is sent once over HTTPS, used in server memory for that run, and never stored or written into the report. Reasoning models need a larger output budget, which the runner sets automatically.
What gets changed
Every variant keeps the meaning of the question and records its lineage: parent item, seed, parameters, and the answer key it is scored against. Variants that would not change anything are skipped.
| Transformation | What changes | Status |
|---|---|---|
| choice_permutation | Option texts move under the same labels, so the correct answer changes letter. | valid |
| choice_label_remap | Labels become a fresh scheme (a, b, c → 1, 2, 3 or unused letters). | valid |
| formatting | The prompt template and whitespace change; question and options do not. | valid |
| identifier | Placeholder names are renamed consistently (x → beta, y → gamma). | uncertain |
Only valid variants count toward the robust score. Uncertain ones are reported separately, because a rule cannot prove that x is a variable rather than a multiplication sign.
How verdicts are decided
Each paired detector compares an item's original correctness with its accuracy across valid variants, then reports the gap, a bootstrap 95% interval, a sign-flip permutation p-value, and that p-value corrected for multiple tests (Benjamini–Hochberg).
- Dependence detected when the gap is positive, its interval is above zero, and the corrected p-value is at most 0.05.
- Robust when the interval's upper end is below 5 points: any drop is smaller than that.
- Inconclusive otherwise, and always with fewer than 10 paired items.
Failed or missing responses are excluded, never counted as wrong. Tests whose inputs are missing, such as token likelihood without log-probabilities, are reported as not run. Thresholds can be set per detector, for example {"type": "option_order", "config": {"min_parent_items": 20}}.
Verify and gate
The audit hash covers the whole report. verify recomputes it and exits non-zero if anything changed after the run; the viewer runs the same check in your browser. gate fails a CI job when the robustness gap exceeds a threshold, or when no paired comparison exists.
veritas verify --report audit-run/report.json veritas gate --report audit-run/report.json --max-delta 0.05
Private benchmarks
Mark a benchmark "visibility": "private" and Veritas refuses to send it to an external endpoint unless you pass --acknowledge-external-transfer. API keys are read from the environment and never written to reports or cache keys. Use a local adapter when a benchmark's terms forbid disclosure.
Interpretation
“Benchmark maxxing” is useful shorthand, not a finding. A large drop under a valid transformation shows that a score depends on presentation; it does not show that the benchmark was in the training data. Claims of contamination need calibrated detectors, matched controls, and evidence that rules out the alternatives each finding lists.
Legacy biology
The sequence-based leakage auditor is still supported. Its reports open in the legacy viewer, and its commands are documented in the reference docs.