Consumer-Time Validity in Stateful AI Runtimes: Verifying Recovered State and Deferred Authority
Organizations: The Hong Kong University of Science and Technology · King Abdullah University of Science and Technology · University of Illinois Urbana-Champaign
Abstract
Stateful LLM serving engines and agent runtimes reuse execution state and deferred permissions across components and sessions. A cancellation, rollback, or approval is recorded by one component and relied on by another, and recording it does not make the later use valid: a downstream consumer may read state or dispatch an action whose identity, production status, allocation, or target revision has since changed. We call the missing check consumer-time validity and separate two forms. State validity governs what a consumer reads. On vLLM with LMCache, an interrupted KV load leaves unwritten blocks indexed, and a host-only counter rewind desynchronizes the GPU position, so a second tenant generates a schema-valid tool call naming the wrong tenant in 10/10 native-fault runs; the call is recorded and not executed. Authority freshness governs what a consumer executes: on a multi-session approval runtime, an unrevoked deferred grant overwrote a newer revision in one admitted live execution. Output equality cannot test state validity: a fault-free run diverges at token 30 through BF16 batching alone while attended-KV digests match. We therefore specify consumer-bound recovery contracts that, for state recovery, jointly require exclusion, retention, and task completion, and an admissible-witness standard realized as a GPU-free offline trace verifier over scheduler metadata and persisted tool artifacts. On recorded traces the verifier agrees with the reference verdicts in 42/42 frozen GPU-matrix scenarios. An allocation-aware repair satisfies 7/7 triggered vLLM fault predicates on a pinned scheduler-case matrix, where upstream PR 61769 satisfies 2/7, and revision-bound dispatch blocks all 160 deterministic conflicting overwrites in a separate dispatcher cohort. Recovery must be checked where state and authority are consumed, with evidence bound to the consuming request.
Figures & tables
| Layer | Question it answers | Content |
|---|---|---|
| Security goals (Section 2.3 ) | What should the runtime protect? | Complete mediation, post-revocation isolation, fail-closed isolation |
| Contract (this section) | What must hold at this consumer? | Predicates . For state recovery: Equations 3 and 4 , judged by exclusion, retention, and completion |
| Witness requirements (Section 4.1 ) | What evidence may decide a predicate? | Identity, Semantic Sufficiency, Independence |
| State validity (cache admission) | Authority freshness (tool dispatch) | |
|---|---|---|
| Relies on | A cached prefix and the position it resumes from | A grant issued earlier |
| Upstream record | Load-failure report, cancel, or rewind | Approval |
| Identity checked | Task eligibility , allocation generation | Principal, session, permission version, live revision |
| Predicate | Equation 4 , and a generation match for late reports | Equations 5 and 6 |
| Admissible evidence | Tier-2a scheduler metadata, Tier-2b bytes where collected | Grant against live , Tier-3 artifact |
| Tier | Signal | What it certifies and its limit | Excl. | Coh. | Effect † | Cost |
|---|---|---|---|---|---|---|
| 0 | Output equality with the cold reference | Whether the text matches. Cannot separate a position split from an exclusion failure | 30 | 0 | 50 | No GPU |
| 1 | Cache-hit counter | An index entry, never the written bytes | — | 30 | 40 | No GPU |
| 2a | Allocation identity, generation, completion | Exclusion, read from block metadata at report consumption. Silent on position drift | 0 | 30 | — | s/step |
| 2a | Host and device step counters, paired | Coherence. On a separate 14-run cohort it flags all 8 split runs (host 128, device 288) and none of 6 coherent runs | — | 0/14 | — | s/step |
| 2b | SHA-256 of attended KV pages | The bytes attention read. Not collected on this corpus | n/a | n/a | n/a | 0.42 ms/layer |
| 3 | Parser output and re-read tool artifact | A generated unauthorized call, which no state signal establishes. Not a backend effect | — | — | ref. | One episode |
| System | Repair at the consumer | Identity |
|---|---|---|
| ChatGLM2 | Rebuild the prompt and cache from the retained prefix after a deletion | |
| Google ADK | Export only events from the current rewind epoch | |
| vLLM |