Proof Portal

Project overview

litellm

BerriAI117 findings · 107 requirements

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

93 withheld (location undisclosed)

All requirements
RequirementSW-REQ-260730-1NADSoftwareReview

the AnthropicMessagesRequestOptionalParams key allowlist is resolved from the TypedDict hints exactly once per process (lru_cache) and every call returns the same stable frozenset identity

All automated checks pass and 3/3 obligations are satisfied. Human review is still pending.
PriorityshallTypeguaranteeCategoryfunctionalComponentanthropic_messagesAssuranceEFindingsnone open

Specification

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

Description

the AnthropicMessagesRequestOptionalParams key allowlist is resolved from the TypedDict hints exactly once per process (lru_cache) and every call returns the same stable frozenset identity

FRETish formula
the anthropic_messages shall always satisfy allowlist_keys_resolved_once_stable
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
pending

History

Created
Jul 30, 2026, 20:39 UTC · Claude Code · AI agent
Modified
Aug 1, 2026, 18:42 UTC · Claude Opus 4 8 · AI agent

Hazard review

Reviewed Aug 1, 2026, 18:42 UTCby agent:claude-opus-4-8catalog v1.9.1
  • scenarioreviewednominal

    nominal is the resolved-allowlist happy path (the frozenset contains the expected keys and drives the filter); there is no malformed/empty partition for a static hint resolution

  • propertyreviewedpure_function_property_testeddeterminism

    The lru_cache-memoized allowlist is a pure nullary function; single-resolution (cache misses==1) and stable frozenset identity across calls are its determinism/purity properties

  • structuralnot applicable

    Garbage-collected Python returning an immutable frozenset; no manual memory, pointer arithmetic, overflow, or format string

  • domainnot applicable

    Pure in-process TypedDict-hint resolution with no network/filesystem/IPC call

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. Claude Code · AI agentApprovedSpec conformanceJul 30, 2026 · 4 months agoREVIEW-13

    _anthropic_messages_optional_param_keys line 11 is decorated @lru_cache(maxsize=1) and returns frozenset(get_type_hints(...).keys()); the static TypedDict hints are resolved exactly once per process and the same frozenset identity is returned on every call. Matches the allowlist_keys_resolved_once_stable guarantee.

    Cited code (2)

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

Happy-path behavior with valid inputs.

If it were violatedMedium

If the allowlist resolved to the wrong or an empty key set, every /v1/messages request would silently strip all optional params when empty, or forward unsupported ones when over-broad, corrupting every downstream request.

Discharging evidence1/1 required witnessed
  • nominalrequiredpresent
    Covered by 1 test
Discharged

A function declared pure (no I/O, no global state, output is f(input) only) shall carry property-based tests that exercise its declared algebraic properties (determinism, totality, commutativity, monotonicity, idempotency — whichever apply); example-based tests alone shall not be sufficient evidence for a pure-function obligation.

If it were violatedLow

If the memoized resolver were impure it could observe different TypedDict hints across calls, so its single-resolution and stable-identity properties would not be property-testable.

Discharging evidence1/1 required witnessed
  • nominalrequiredpresent
    Covered by 1 test
Discharged

Output identical regardless of collection ordering or runtime conditions.

If it were violatedLow

If the lru_cache memoization were defeated and the frozenset recomputed per call, the fixed get_type_hints cost would return to the per-request hot path, regressing /v1/messages parse latency.

Discharging evidence1/1 required witnessed
  • nominalrequiredpresent
    Covered by 1 test

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 anthropic_messages shall always satisfy allowlist_keys_resolved_once_stable

Witnesses· 1 scenario total

  • test_valid_keys_resolved_once_and_stable
    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
#allowlist_keys_resolved_once_stableResultProvesCovering test
1FFallowlist_keys_resolved_once_stableExempted · defensive — the lru_cache resolves the static TypedDict hints exactly once and returns the same frozenset identity forever; an unstable/recomputed allowlist is unreachable in a correct build (reviewed: agent:claude-opus-4-8)
2TTallowlist_keys_resolved_once_stable

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.

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.

  • Anthropic /v1/messages: Python -> RustMIR-002
    DiffersPython → Rust
    View in Mirrors

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
1
Tests
1
At-risk contracts
0

Files to re-check (1)

  • utils.pylitellm/llms/anthropic/experimental_pass_through/messages/utils.py

Tests to re-run (1)

  • test_request_optional_param_utils.pytests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_request_optional_param_utils.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