Proof Portal

Project overview

litellm

BerriAI117 findings · 107 requirements

LiteLLM Python->Rust migration audit (proof mirroring).

93 withheld (location undisclosed)

All requirements
RequirementSW-REQ-260701-94Z6SoftwareApproved

validate_environment raises ValueError when no API key is provided and none is present in the environment

This requirement changed after its last recorded review, so approval is stale. Automated checks pass and 4/4 obligations are satisfied.
PriorityshallTypeguaranteeCategoryfunctionalComponentmistral_ocrAssuranceEFindingsnone open

Specification

The requirement exactly as authored — its complete prose text and, where present, the formal FRETish sentence it compiles to.

Description

validate_environment raises ValueError when no API key is provided and none is present in the environment

FRETish formula
when ((! api_key_provided) & (! env_key_present)) the mistral_ocr shall always satisfy missing_key_error_raised
View full formal model

Verification & provenance

How this requirement was checked: the review trail, edit history, and the machine-analysis status terms (each ⓘ explains what it means).

Assurance levelE
Formalizationvalid
Strategyfretish

Review

Status
approved
Reviewer
Buger · lead_engineer
Reviewed
Jul 1, 2026, 16:42 UTC
“Owner-authorized review: FRETish matches implementation behavior, review gate PASS, obligation evidence complete, code + requirement MC/DC 100%, witnessing tests green”

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

Reviewed Jul 2, 2026, 05:51 UTCby agent:claude-codecatalog v1.3.0
  • 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.

  1. 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 catalogue
Discharged

A 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 it were violatedHigh

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

Discharging evidence1/1 required witnessed
  • nominalrequiredpresent
    Covered by 2 tests
  • negativerecommendedpresent
    Covered by 2 tests
Discharged

Behavior when inputs are absent, nil, zero-length, or blank.

Discharging evidence1/1 required witnessed
  • nominalrequiredpresent
    Covered by 2 tests
Discharged

Behavior when operations fail or dependencies are unavailable.

Discharging evidence2/2 required witnessed
  • negativerequiredpresent
    Covered by 2 tests
  • nominalrequiredpresent
    Covered 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).

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_header
    exercises 1 condition scenario
  • test_api_key_resolved_from_environment
    exercises 1 condition scenario
  • test_missing_api_key_raises_value_error
    exercises 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.

Covereda test exercises this rowExempteda reviewed mcdc:ignoreNo-actionfalse-result row satisfied by designUncoveredneeds a covering test
#api_key_providedenv_key_presentmissing_key_error_raisedResultProvesCovering test
1FFFFapi_key_providedExempted · 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)
2FFTTmissing_key_error_raised
3FTFTenv_key_present
4TFFTapi_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).

If you change this

Requirements
0
Files
2
Tests
1
At-risk contracts
0

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.

Sign in to discuss this with the proof team.Sign in