Proof Portal

Project overview

litellm

BerriAI117 findings · 107 requirements

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

93 withheld (location undisclosed)

All requirements
RequirementSW-REQ-260731-AKEYSoftwareReview

get_api_key resolves the effective OpenAI Realtime api_key as the first truthy source in the precedence chain (caller api_key, litellm.api_key, litellm.openai_key, OPENAI_API_KEY env, else the empty string), returning a string for every source class and never raising when the whole chain is unset

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

Specification

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

Description

get_api_key resolves the effective OpenAI Realtime api_key as the first truthy source in the precedence chain (caller api_key, litellm.api_key, litellm.openai_key, OPENAI_API_KEY env, else the empty string), returning a string for every source class and never raising when the whole chain is unset

FRETish formula
the openai_realtime shall always satisfy api_key_resolved
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 31, 2026, 00:00 UTC · Claude Code · AI agent
Modified
Aug 1, 2026, 18:19 UTC · Claude Opus 4 8 · AI agent

Hazard review

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

    nominal is the resolution happy path over the finite api_key source classes (explicit, litellm_api_key, litellm_openai_key, env_var) enumerated in the api_key_resolution table; empty_input is the fully-unset chain (all sources falsy) falling through to the empty-string sentinel; a source value is always a string or None, so there is no malformed partition distinct from the none_present class

  • propertyreviewedpure_function_property_testedtotality

    get_api_key is a pure resolver (output depends only on the caller arg and the litellm/env config it reads, with no I/O of its own beyond the config read), so the first-truthy-source property is property-testable and total over any source combination; determinism follows from purity

  • structuralnot applicable

    Garbage-collected Python short-circuit or-chain over strings with no manual memory, pointer arithmetic, overflow, or format string

  • domainnot applicable

    Pure in-process credential resolution issuing no network/filesystem/IPC call; the env read is a process-config lookup, not an external service call. The resolved secret is returned to the caller, not logged at this boundary

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 31, 2026 · 4 months agoREVIEW-25

    api_key_resolved is the always-holds guarantee over the 5-term short-circuit or-chain 'api_key or litellm.api_key or litellm.openai_key or get_secret_str(OPENAI_API_KEY) or ""'. No if/match gates it; the trailing '' sentinel makes the chain total and non-raising when every source is falsy. Formula matches: a string is always returned, so the guarantee holds for every source class in the api_key_resolution table.

    Cited code (1)

Obligations

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

4 obligations · 4 discharged

Browse the catalogue
Discharged

Happy-path behavior with valid inputs.

If it were violatedMedium

Precedence inverts so a stale litellm.api_key or litellm.openai_key global shadows the caller's explicit api_key argument, and the realtime session is authenticated as and billed to the wrong OpenAI account rather than the caller's

Discharging evidence1/1 required witnessed
  • nominalrequiredpresent
    No covering test recorded
Discharged

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

Discharging evidence1/1 required witnessed
  • nominalrequiredpresent
    No covering test recorded
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.

Discharging evidence1/1 required witnessed
  • nominalrequiredpresent
    No covering test recorded
Discharged

Every reachable input combination is covered by a requirement.

If it were violatedLow

get_api_key raises on a fully-unset chain instead of returning the empty-string sentinel, so the realtime session aborts with an unhandled exception rather than surfacing a clean downstream 401, turning a missing-key config error into an availability failure

Discharging evidence1/1 required witnessed
  • nominalrequiredpresent
    No covering test recorded

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 openai_realtime shall always satisfy api_key_resolved

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
#api_key_resolvedResultProvesCovering test
1FFapi_key_resolvedExempted · defensive — get_api_key always returns a string (a resolved source or the "" sentinel) and never raises, so an unresolved key is unreachable in a correct build (reviewed: agent:claude-opus-4-8)
2TTapi_key_resolved—

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

Files to re-check (1)

  • http_transformation.pylitellm/llms/openai/realtime/http_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