arXiv:2610.22781cs.GTOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.22781

Anytime Contracts for AI Services

Boris Velasevic, Eden Saig, Eric Mazumdar

Abstract

AI services are prone to moral hazard, as model providers can silently route requests to cheaper, lower-quality models, and the inherent stochasticity of model outputs makes this degradation hard to detect. Contract theory addresses moral hazard by designing payment rules that reward high-quality outputs and prevent strategic overcharging. However, existing frameworks assume interactions of fixed duration, whereas AI services are typically consumed through subscriptions and pay-as-you-go APIs that users can terminate at any time based on observed performance. We show that this flexibility can break standard contracts, opening them up to abuse by either the providers or users. To address this, we extend contract theory to account for unknown exit rules. We formalize the problem as a Principal-Agent game, and show that budget-optimal contracts in this setting are proportional to anytime-valid hypothesis tests based on likelihood-ratio e-values. We give an efficient algorithm for computing anytime contracts and show how betting e-processes can be used to approximate them when the models are unknown. Finally, we evaluate our findings on synthetic data and data from deployed LLMs.

1 INTRODUCTION

AI systems are becoming ubiquitous and increasingly embedded in high-stakes decision-making across domains. Such decisions often require the intricate reasoning abilities of high-quality models, which most organizations cannot train and operate in-house, leading them to delegate AI tasks to external service providers. Due to their generality, AI systems are increasingly viewed as tools, used for indefinite durations within organizational processes. Accordingly, payment for such services typically takes the form of auto-renewing contracts or pay-as-you-go APIs, which are arrangements without a predetermined end.

Together with growing demand, the increasing costs of high-quality models create economic risks. Both model inference and the evaluation of generative-model outputs are inherently noisy, while the process by which providers route queries to different models is typically opaque. This creates information asymmetry between AI service providers and their users wherein an end-user cannot tell whether a low quality outcome is the result of randomness or deliberate degradation from the service provider. Since higher-quality models are generally more costly to operate, profit-maximizing providers can benefit from routing requests to cheaper, lower-quality models. This gives rise to moral hazard [24, 3, 27]. We note that incidents of quality degradation are well-documented in practice [4, 11], and it's not hard to believe that fully strategic providers will leverage such gaps to their advantage.

Moral hazard is a classic problem in economics, commonly addressed by designing pay-for-performance payment rules, encoded as contracts, which reward the agent for quality signals that indicate effort [15, 12, 7]. Recent work has started applying these ideas in settings native to machine learning [24, 25], designing payment schemes that implicitly assume fixed-duration interactions. However, when AI services are used on an ongoing basis, contractual interactions become inherently dynamic. Payment schemes used in practice either have an indefinite duration by design (e.g., APIs) or contain an exit clause that can be triggered at any time by either party, potentially mandated by regulators [8]. For example, one may want to cancel a subscription or switch to a different provider. In such settings, routing decisions interact with concerns about contract duration, an interplay which may cause fixed-duration contracts to achieve an opposite goal from the one they target.

  • Equal contribution.

To illustrate this, consider a setting in which, at each step, a strategic provider receives a task from a client organization and routes it to either a costly high-quality model or a cheaper low-quality one, then each task either succeeds or fails. In the fixed-duration setting, the optimal contract incentivizing high effort for the minimal expected pay is the one that pays a large amount only if all tasks are successful (e.g., [6, 2]). Such contracts fail to incentivize high effort in our setting: if the client terminates after the first failure, payment is always zero at termination, so a provider anticipating such behavior has no incentive to bear the cost of the higher-quality model and therefore only offers lower-quality outputs.

Alternatively, another common approach is to pay per successful task. However, if the client only cares about completing a task and terminates once it succeeds—for example, when trying to prove a major mathematical theorem—the provider receives exactly one payment regardless of duration. Hence, when a substantially cheaper model has some chance of success, the provider may therefore prefer to route prompts to it instead.

Both examples show that exit clauses can create economic failures under different stopping criteria. Since the rules governing whether interaction continues or terminates are varied and typically unknown in advance, there is a need for tools that explicitly account for these dynamics and their uncertainty.

Contributions: In this work, we develop a theory of contract design for AI services that explicitly accounts for the dynamic nature of the problem and—crucially—the exit clauses that are key features of AI services. Our contributions are as follows.

• Contracts under stopping time uncertainty: We formalize the interaction as a Principal-Agent game in which the provider deploys a potentially adaptive model-routing policy, quality is measured at each step, and the user may choose to terminate the contract according to any—possibly data-dependent—stopping rule in a prescribed class T. We show that accounting for exit clauses can cause existing contract-theory approaches to fail, motivating the need for contracts that explicitly deal with stopping time uncertainty. In the resulting formulation, we require that the provider prefers providing the high-quality policy over their alternative uniformly over all stopping rules a user could choose. This reflects the fact that a user's stopping rule is typically private and could be arbitrary. The resulting formulation is a strict generalization of existing fixed-duration contract design problems in machine learning which implicitly consider the case where the class of admissible stopping rules is a singleton.

• Anytime contracts: Our central result characterizes minimum-budget contracts robust to stopping-time uncertainty. The optimal contract takes the form of a scaled sequential likelihood-ratio test on the sequence of observed quality signals, with the required budget increasing when the target policy is more costly or harder to distinguish statistically. The resulting likelihood-ratio processes are also log-optimal e-processes [13, 21], extending the connection between statistical testing and contract design [23, 24] to anytime-valid inference [26, 22]. For bounded stopping time families, we also show that these contracts can be computed efficiently by reducing to an optimal stopping problem.

• Audits with partial information. Implementing the optimal anytime contract requires knowledge of the output distributions induced by the provider's routing policies. Using a standard e-value construction [28], we develop an approximation to the optimal contract that can be implemented from observed signals alone, provides anytime service-level guarantees, and can sometimes recover the optimal anytime contract exactly.

• Empirical validation under realistic conditions: We present empirical validation of our theory both in a simple synthetic environment and with real data from closed-source LLMs. Synthetic experiments illustrate how stopping-time uncertainty changes optimal payments and worst-case stopping behavior. Experiments using the Holistic Agent Leaderboard [18] examine robustness costs, partial distributional information, and demonstrate how contracts can deter multiple alternative policies.