Proof Portal

Project overview

litellm

BerriAI117 findings · 107 requirements

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

93 withheld (location undisclosed)

All requirements
RequirementSYS-REQ-260701-3HNGSystemApproved

The Mistral OCR integration shall honor the provider request/response contract: forward only supported parameters, build a well-formed request or reject a non-dict document, target the canonical Mistral OCR endpoint, require an API key, and return a structured OCR response or re-raise a parse failure

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

Specification

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

Description

The Mistral OCR integration shall honor the provider request/response contract: forward only supported parameters, build a well-formed request or reject a non-dict document, target the canonical Mistral OCR endpoint, require an API key, and return a structured OCR response or re-raise a parse failure

FRETish formula
the mistral_ocr shall always satisfy ocr_contract_honored
View full formal model

Rationale & tags

Why this requirement exists, and how it is categorised.

System-level black-box behavior of the Mistral OCR provider, decomposed into component software requirements

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 · system_owner
Reviewed
Jul 1, 2026, 16:42 UTC
“Owner-authorized review: system/interface/stakeholder contract verified end-to-end; acceptance + integration witnessed; obligations complete”

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:52 UTCby agent:claude-codecatalog v1.3.0
  • domainreviewedexternal_call_timeout_boundedexternal_call_failure_observableexternal_call_concurrency_boundedupstream_budget_coordinatedssrf_protectioncert_validation_strictredirect_policy_explicitretry_policy_explicittls_required_for_secrets

    End-to-end Mistral OCR call is real network I/O (litellm/ocr/main.py -> BaseLLMHTTPHandler.ocr): a hung/erroring/slow Mistral API must be time-bounded, concurrency-bounded so it cannot starve other proxy clients, surface typed failures, fit the upstream ingress budget, and the user-influenced document URL plus Bearer-key TLS plus default redirect-following make ssrf/cert/redirect/tls/retry real hazards; witnesses live in the out-of-scope OCR call path so coverage is tracked debt

  • scenarioreviewednominalerror_handlingmalformed_input

    The behavioral core of this contract: nominal (valid doc -> structured OCRResponse), error_handling (parse failure and dependency-unavailable re-raise via litellm.exception_type), and malformed_input (non-dict/invalid-type document rejected with ValueError before any endpoint call); the remaining scenario partitions have no distinct referent for a stateless single-document forward

  • propertyreviewed

    A single stateless document->pages request/response forward has no accumulating, ordering, idempotency, or all-or-nothing semantics of its own; totality is discharged by decomposition into the 9 satisfying SW-REQs and invariant_preservation is Go-lemma-only while this path is Python plus a Rust FFI bridge

  • structuralreviewed

    Implementation is garbage-collected Python plus a memory-safe Rust FFI bridge with no manual allocation, pointer arithmetic, fixed-width overflow, or user-controlled printf format; nil handling and the base64 encode step are already modeled as behavioral partitions / child SW-REQs, so the language-level memory-safety classes have no C/C++/Go construct to bind at this contract

Change history

Every recorded revision of this requirement's source file — newest first, each with its commit message and the diff for that change.

Open known issues

Findings currently open against this requirement — issues its verification surfaced that are not resolved yet. Each links to the full finding.

Obligations

What this requirement must witness to be considered satisfied — the required evidence, and the tests that discharge each one.

12 obligations · 4 deferred · 8 discharged

Browse the catalogue

Evidence tagged via <REQ> is witnessed by a requirement that satisfies this one — normal for stakeholder / aggregate requirements, which are proven through the requirements that refine them.

Discharged

HTTP clients shall verify TLS certificates, hostnames, and chains; InsecureSkipVerify and equivalent shall not be enabled in production.

Discharging evidence1/1 required witnessed
  • nominalrequiredpresent
    Covered by 2 tests
    via INT-REQ-001
  • negativerecommendedpresent
    Covered by 2 tests
    via INT-REQ-001
Discharged

Behavior when operations fail or dependencies are unavailable.

Discharging evidence2/2 required witnessed
  • negativerequiredpresent
    Covered by 9 tests
    via INT-REQ-001via INT-REQ-001via INT-REQ-001via SW-REQ-260701-2CEWvia SW-REQ-260701-94Z6via SW-REQ-260701-94Z6
  • nominalrequiredpresent
    Covered by 7 tests
    via INT-REQ-001via INT-REQ-001via SW-REQ-260701-2CEWvia SW-REQ-260701-94Z6via SW-REQ-260701-94Z6
Deferred

Outbound concurrency to each external dependency shall be capped (semaphore / bulkhead / circuit breaker) so that one stalled dependency cannot exhaust caller capacity.

Deferred — tracked by a finding withheld pending disclosure.

Discharging evidence0/1 required witnessed
  • nominalrequireddeferred
    Witnessing deferred — accepted while the tracking known issue stays open.
Discharged

External-call failures (timeout, unreachable, refused, TLS error) shall map to typed errors that the caller surfaces; silent retries / black-hole drops are forbidden without explicit policy.

Discharging evidence1/1 required witnessed
  • nominalrequiredpresent
    Covered by 8 tests
    via INT-REQ-001via INT-REQ-001via INT-REQ-001via INT-REQ-001
Discharged

Every cross-process call shall declare connect, read, and total deadlines; no external call is defaulted to "no timeout."

Discharging evidence1/1 required witnessed
  • nominalrequiredpresent
    Covered by 4 tests
    via INT-REQ-001via INT-REQ-001
Discharged

Behavior when inputs are syntactically or structurally invalid.

Discharging evidence2/2 required witnessed
  • negativerequiredpresent
    Covered by 5 tests
    via INT-REQ-001via SW-REQ-260701-2CEWvia SW-REQ-260701-T821via SW-REQ-260701-T821
  • nominalrequiredpresent
    Covered by 5 tests
    via INT-REQ-001via SW-REQ-260701-2CEWvia SW-REQ-260701-T821via SW-REQ-260701-T821
Discharged

Happy-path behavior with valid inputs.

Discharging evidence1/1 required witnessed
Discharged

HTTP clients shall declare their redirect-following policy (max hops, scheme/host invariants, header propagation).

Discharging evidence1/1 required witnessed
  • nominalrequiredpresent
    Covered by 2 tests
    via INT-REQ-001
Deferred

HTTP clients shall declare an explicit retry policy (which methods, which errors, max attempts, backoff schedule, jitter).

Control absent on the OCR call path; real reliability/security gap documented in KI-ocr-retry (owner, remediation). Honest tracked debt, not a sham suppression.

Ownerclaude-code
Discharging evidence0/1 required witnessed
  • nominalrequireddeferred
    Witnessing deferred — accepted while the tracking known issue stays open.
Deferred

HTTP clients with user-influenced URLs shall enforce an allowlist of reachable destinations and reject internal-network targets.

Deferred — tracked by a finding withheld pending disclosure.

Discharging evidence0/1 required witnessed
  • nominalrequireddeferred
    Witnessing deferred — accepted while the tracking known issue stays open.
Discharged

Endpoints handling secrets shall reject plaintext HTTP.

If it were violatedHigh

If the assembled OCR call sends the Bearer credential over plaintext or a downgraded transport, a MITM on the path captures the key and can impersonate the customer against Mistral and read their documents

Discharging evidence1/1 required witnessed
  • nominalrequiredpresent
    Covered by 4 tests
    via INT-REQ-001via INT-REQ-001
  • negativerecommendedpresent
    Covered by 1 test
Deferred

Spec shall enumerate the upstream timeout chain (load balancer, ingress, peer service, client-side proxy) and prove that the caller's total call budget is strictly less than the minimum upstream timeout.

Deferred — tracked by a finding withheld pending disclosure.

Discharging evidence0/1 required witnessed
  • nominalrequireddeferred
    Witnessing deferred — accepted while the tracking known issue stays open.

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

the mistral_ocr shall always satisfy ocr_contract_honored

Witnesses· 1 scenario total

  • test_interface_contract_end_to_end
    exercises 1 condition scenario

MC/DC truth table· 2 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
#ocr_contract_honoredResultProvesCovering test
1FFocr_contract_honoredExempted · defensive — the assembled stack always targets /v1/ocr with a Bearer header, forwards only supported params, and returns a structured OCRResponse; a correct build cannot dishonor the contract, so this invariant-violation row is unreachable (reviewed: agent:claude-opus-4-8)
2TTocr_contract_honored

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.

No implementation linked

No source files are traced to this requirement yet.

Mirrors

Ports this requirement participates in — it carries a reviewed exemption on one side, or a finding raised against it is tracked as part of the port.

Impact

Blast radius — authored trace links only (automatically derived links come from the audit index and aren't shown here).

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