Proof Portal
litellm
BerriAI117 findings · 107 requirementsLiteLLM Python->Rust migration audit (proof mirroring).
93 withheld (location undisclosed)
validate_environment raises ValueError when no API key is provided and none is present in the environment
Specification
The requirement exactly as authored — its complete prose text and, where present, the formal FRETish sentence it compiles to.
validate_environment raises ValueError when no API key is provided and none is present in the environment
when ((! api_key_provided) & (! env_key_present)) the mistral_ocr shall always satisfy missing_key_error_raised
Verification & provenance
How this requirement was checked: the review trail, edit history, and the machine-analysis status terms (each ⓘ explains what it means).
Review
- Status
- approved
- Reviewer
- Buger · lead_engineer
- Reviewed
- Jul 1, 2026, 16:42 UTC
History
- Created
- Jul 1, 2026, 09:53 UTC · Claude Code · AI agent
- Modified
- Aug 1, 2026, 18:27 UTC · Claude Opus 4 8 · AI agent
Hazard review
- scenarioreviewederror_handlingempty_input
Missing-key branch is an error/empty-input partition: both api_key param and env var absent must raise; nominal/boundary/malformed/concurrent do not partition a single boolean-antecedent guard.
- domainreviewedcontrol_not_silently_disabled
Fail-closed API-key guard: raising when no key resolves is exactly control_not_silently_disabled (never proceed to an unauthenticated Mistral call). All external_call/http_client reliability classes are suppressed because this branch does zero network I/O; those controls live in the OCR call path (litellm/ocr/main.py + HTTP handler).
- propertynot applicable
The requirement is a single boolean-antecedent guard (no key -> raise), not an operation over collections or repeated application. Determinism/idempotency/commutativity/monotonicity/totality/atomicity have no non-trivial content for a one-shot raise; the raise is already deterministic and total by construction and covered by scenario+domain rows.
- structuralnot applicable
Implementation is Python (litellm/llms/mistral/ocr/transformation.py); nil_safety/overflow_safety/encoding_safety and the C/C++ memory classes (pointer_arithmetic, format_string, manual_memory_ownership) are language-level obligations for Go/C/C++ that do not pertain. The None-input handling is captured by scenario empty_input.
Change history
Every recorded revision of this requirement's source file — newest first, each with its commit message and the diff for that change.
Review history
Human and AI-agent approvals of this requirement — the 'why was this approved' lineage, each with the reviewer's justification and the code it cites.
- UnknownApprovedSpec conformanceJul 1, 2026 · 5 months agoREVIEW-9
validate_environment: line 110 'if api_key is None' (after the env lookup at 107) raises ValueError at line 111. This is reached only when neither the argument nor the environment supplied a key. FRETish 'when (!api_key_provided & !env_key_present) shall satisfy missing_key_error_raised' matches the conjunction gating the raise.
Cited code (3)
Obligations
What this requirement must witness to be considered satisfied — the required evidence, and the tests that discharge each one.
3 obligations · 3 discharged
Browse the catalogueA security control shall fail closed on an unmet precondition, and alternate or privileged admission shall enforce equivalent controls or use an explicit, bounded, observable exception lifecycle.
If the missing-key guard is bypassed or skipped, an unauthenticated OCR request is dispatched with no Authorization header, turning a clear local configuration error into a confusing upstream 401 and leaking the document to an unauthenticated call
- nominalrequiredpresentCovered by 2 tests
- negativerecommendedpresentCovered by 2 tests
Behavior when inputs are absent, nil, zero-length, or blank.
- nominalrequiredpresentCovered by 2 tests
Behavior when operations fail or dependencies are unavailable.
- negativerequiredpresentCovered by 2 tests
- nominalrequiredpresentCovered by 2 tests
Formula evidence
The formal formula behind this requirement, the variables it is written over, and the tests that exercise it (each term is explained inline).
Formula evidence
The formal formula behind this requirement, the variables it is written over, and the tests that exercise it (each term is explained inline).
FRETish formula
when ((! api_key_provided) & (! env_key_present)) the mistral_ocr shall always satisfy missing_key_error_raised
Witnesses· 4 scenarios total
- test_direct_api_key_sets_bearer_headerexercises 1 condition scenario
- test_api_key_resolved_from_environmentexercises 1 condition scenario
- test_missing_api_key_raises_value_errorexercises 1 condition scenario
MC/DC truth table· 4 rows
Each row assigns the formula's conditions (T/F) and shows the Result— the formula's value for that input row, not a test pass/fail. A row proves a condition when flipping only that condition flips the outcome. The test that covers each row is linked.
mcdc:ignoreNo-actionfalse-result row satisfied by designUncoveredneeds a covering test| # | api_key_provided | env_key_present | missing_key_error_raised | Result | Proves | Covering test |
|---|---|---|---|---|---|---|
| 1 | F | F | F | F | api_key_provided | Exempted · defensive — an absent key on both the argument and the environment always raises, so this trigger-satisfied-yet-no-error state is unreachable in a correct build (reviewed: agent:claude-opus-4-8) |
| 2 | F | F | T | T | missing_key_error_raised | |
| 3 | F | T | F | T | env_key_present | |
| 4 | T | F | F | T | api_key_provided |
Its place
How this requirement connects — what proves it, what it affects, and what it rests on. Authored links only here; automatically derived links come from the audit index.
Loading graph…
Trace evidence
The concrete artifacts linked to this requirement — implementing code, verifying tests, documents, and the findings raised against it.
Impact
Blast radius — authored trace links only (automatically derived links come from the audit index and aren't shown here).
Impact
Blast radius — authored trace links only (automatically derived links come from the audit index and aren't shown here).
If you change this
Files to re-check (2)
- transformation.pylitellm/llms/mistral/ocr/transformation.py
- transformation.rslitellm-rust/crates/core/src/providers/mistral/ocr/transformation.rs
Tests to re-run (1)
- test_mistral_ocr_transformation.pytests/test_litellm/llms/mistral/ocr/test_mistral_ocr_transformation.py
What this rests on
Discussions
Discuss this with the proof team. Nothing changes in your audit automatically — you open a request and a staff member records any outcome inside the thread.