AI Infra
0%
Part XI · Chapter 93

Operating Contracts: SLOs, Cost, Incidents, and Tenancy

AuthorChangkun Ou
Reading time~15 min

A stack becomes infrastructure only when a team can say what it promises, what it costs, how it fails, who shares it, and which record will be trusted after the failure. Everything before this point built pieces of that answer. Chapter 88 named the seams, Chapter 89 made release a statistical promotion problem, Chapter 90 moved reliability from exact responses to judged distributions, Chapter 91 placed human approval in the runtime loop, and Chapter 92 turned production traces into the next round of evidence. The missing object is the operating contract tying those pieces together.

2026-06-23T06:34:43.885860 image/svg+xml Matplotlib v3.11.0, https://matplotlib.org/
Figure 93.1. Schematic risk curve for operating contracts. A governed stack lowers unpriced risk as contracts cover SLOs, cost, incidents, tenancy, and evidence; an ad hoc stack keeps most risk outside the control plane. Idealized curves, not measured data.

The old production playbook still matters. Service level indicators and service level objectives give a service a measurable promise (Beyer et al. 2016). When the system is under stress, incident command separates decision-making from hands-on repair (Beyer et al. 2016). FinOps treats cost as a shared engineering, finance, and product discipline rather than an accounting report after the fact (FinOps Foundation 2026). Multi-tenancy, for its part, turns fairness, isolation, and chargeback into questions of platform design (Kubernetes 2026). AI changes the payload these disciplines carry. A service that is reachable and fast can still be fluent and wrong. Cost is no longer just CPU hours; it now meters tokens, GPU seconds, judge calls, retrieval, reranks, and human review. An incident need not be an outage at all: it might be a quality regression, a policy failure, a cost runaway, a grounding failure, or a tenant leak. The contract must cover all of them.

The Contract Surface

An AI product has at least five contracts. They should be written, instrumented, and enforceable at the same seams that route traffic.

Contract Promise Meter Enforcement point
Service level The system answers within latency, availability, and quality bounds. Availability, p95/p99 latency, judged pass rate, task success. Gateway, serving tier, eval gate, fallback chain.
Cost Work stays inside a budget and has an owner. Tokens, cached tokens, GPU seconds, judge calls, review minutes, storage. Gateway budgets, quota service, scheduler, FinOps ledger.
Incident A live failure has roles, state, mitigations, and a learning path. Severity, affected tenants, spend burn, failing eval slices, mitigation time. Incident command, runbook, feature flags, rollback, postmortem.
Tenancy One tenant cannot steal another tenant's capacity, data, tools, or budget. Quota, priority, cache partition, index namespace, sandbox boundary, audit log. Gateway virtual keys, scheduler, vector store, sandbox, policy layer.
Evidence Releases and remediations are decided from reproducible records. Dataset version, prompt/config hash, trace ID, judge version, consent basis. Eval store, trace store, data engine, model registry.

Figure 93.2 draws the contract surface as a control plane rather than a document. A request enters through the gateway. The gateway does not merely forward it. It attaches tenant identity, budget, routing policy, trace ID, and service target. The agent runtime, retrieval layer, sandbox, eval harness, and serving engine all inherit that envelope. When something goes wrong, the same envelope lets the operator answer the first hard questions: who was affected, what changed, what was spent, what boundary was crossed, and which trace can reproduce it.

contracts user tenant request gw gateway tenant, model, budget, SLO user->gw app agent / app runtime trace envelope gw->app obs observability spans + spend gw->obs rag retrieval namespace + rerank app->rag sbx sandbox tool boundary app->sbx model model serving latency + fallback app->model app->obs eval live eval sample + judge obs->eval sample inc incident state roles + mitigations obs->inc alert data evidence store trace, config, eval, consent eval->data inc->data data->gw new guard
Figure 93.2. Operating contracts as a control plane. Tenant identity, SLO target, cost budget, incident state, and evidence ID travel with the request instead of living in separate spreadsheets.
Constraint arrow

The operating contract is a reverse arrow: production obligations reach down and reshape every technical layer beneath them. A 99.9 percent availability promise dictates model routing and fallback. Per-tenant spend ceilings bend gateway policy and scheduler priority to fit. Privacy boundaries extend further, into retrieval namespaces, sandbox egress, and trace retention. And when an incident review lands, it rewrites the eval suite and post-training data. The contract is not documentation after the system is built. It is the lower-layer design constraint written in operational language.

SLOs for Semantic Systems

Traditional SRE asks which user-visible behaviors matter and how to measure them (Beyer et al. 2016). In a model-backed system the answer has three families. The first two are familiar: the service must be available and it must be fast enough. The third is semantic quality. A response can arrive quickly and still violate the product's promise.

A quality SLI is a sampled and judged pass rate. For a window of nn sampled production events, let si=1s_i = 1 when the response passes the task rubric and si=0s_i = 0 otherwise:

q^=1ni=1nsi.\hat q = \frac{1}{n}\sum_{i=1}^{n}s_i .

Here q^\hat q denotes the observed quality pass rate in the window, nn is the number of sampled events, and each sis_i is the judged outcome for one event. Because the sample is finite, the operating decision should use a lower confidence bound, not the point estimate. With a target qq^\star, a release or route is healthy only when the lower bound stays above qq^\star. That single detail keeps the system from treating a lucky thin sample as evidence. Chapter 48 supplies the measurement discipline; Chapter 90 supplies the nondeterministic service model. The contract connects them to pager rules and release gates.

The interactive curve below shows the operational trade. The x-axis is extra evaluation, fallback, or review spend. The y-axis is residual live risk. The slider sets how quickly the risk falls. A brittle system has a long half-life: each extra dollar removes little risk. A well-instrumented system has a short half-life: targeted evals and fallbacks quickly remove the failures that matter.

Figure 93.3. Operational spend should remove live risk, not merely add process. Drag the half-life: shorter half-lives mean the team has targeted eval slices, effective validators, and fallbacks that remove the failures users actually see.
import math

def wilson_lower(passes, n, z=1.96):
    if n == 0:
        return 0.0
    phat = passes / n
    denom = 1 + z * z / n
    center = phat + z * z / (2 * n)
    margin = z * math.sqrt(phat * (1 - phat) / n + z * z / (4 * n * n))
    return (center - margin) / denom

target = 0.92
for n, passes in [(50, 48), (200, 188), (1000, 935)]:
    point = passes / n
    lower = wilson_lower(passes, n)
    decision = "ship" if lower >= target else "hold"
    print(f"n={n:4d}, point={point:.3f}, lower95={lower:.3f}, target={target:.2f}, decision={decision}")

This framing also prevents an SLO from becoming a slogan. "Helpful answers" is not an SLO. "At least 92 percent of sampled support answers pass the grounded resolution rubric over a rolling day, with lower 95 percent confidence bound above 90 percent, and p95 latency below four seconds" is an SLO a system can enforce. The exact numbers are product choices; the shape is not.

Cost Governance as a Runtime Control

Cost governance has to sit in the request path. A monthly report arrives too late to stop a runaway agent, a misrouted judge, or a prompt template that quietly tripled output length. FinOps is useful here because it defines cost as a shared operating discipline across engineering, finance, and product, with trade-offs among speed, cost, and quality made explicitly (FinOps Foundation 2026). FOCUS, the FinOps open specification for cost and usage data, matters because normalized cost data lets AI spend sit beside cloud, SaaS, and data-center spend rather than living in a vendor-specific export (FinOps Open Cost and Usage Specification 2026). The token meters below are already in the schema: FOCUS's virtual-currency columns carry token purchases and burn-down, and the 1.4 revision ratified in June 2026 scopes native per-model token consumption for the release after it.

The runtime ledger should record the unit economics of a task, not only the bill:

C=r(pinmin,r+poutmout,r+cgputgpu,r+cjudgejr+creviewhr+cstoregr).C = \sum_r \left( p_{\text{in}}m_{\text{in},r} + p_{\text{out}}m_{\text{out},r} + c_{\text{gpu}}t_{\text{gpu},r} + c_{\text{judge}}j_r + c_{\text{review}}h_r + c_{\text{store}}g_r \right).

In words, each request rr contributes input-token, output-token, GPU-time, judge-call, human-review, and storage terms. The coefficients are the prices or internal unit costs attached to those meters. The point is not that every term will be known exactly. The point is that the contract names the meter: input tokens, output tokens, GPU time, judge calls, human review minutes, and storage. Once the meter is named, the gateway can enforce budgets before the bill arrives:

  • route easy tasks to cheaper models and hard tasks to stronger ones;
  • cap tool loops by task class and tenant;
  • reject or defer traffic when a budget is exhausted;
  • allocate cached-input discounts and self-hosted capacity to the tenants that create the demand;
  • price eval, judge, and review work as part of the product, not as invisible platform overhead.

The difficult part is political rather than mathematical. The model team is pushing for more test-time compute to raise quality. Product would rather have lower latency. Finance wants a hard cost ceiling. The operating contract makes that conflict explicit: it states which target wins under which condition, and which person can change the threshold.

Incident Classes

Incident management exists because humans under stress otherwise freelance, duplicate work, and lose state. Google's SRE practice makes the point in generic terms: separate incident command, operational work, communication, and planning, and keep a live incident state document (Beyer et al. 2016). AI systems need the same roles, but the incident taxonomy is broader than "the service is down."

Class Symptom Fast mitigation Evidence to preserve
Availability / latency errors, timeouts, p99 spike, queue growth shed load, route to smaller model, disable optional tools request IDs, queue metrics, model route, deployment hash
Quality regression live judged pass rate or complaint slice drops rollback model/prompt/index, raise fallback threshold sampled traces, judge version, eval slice, changed config
Grounding failure citations wrong, stale documents, retrieval misses pin index version, narrow sources, answer with uncertainty retrieved chunks, corpus version, reranker route
Safety / policy disallowed content, prompt-injection success, unsafe action disable tool, require approval, block route full trajectory, policy version, sandbox log
Cost runaway spend burn or token output spikes cap tenant, kill loop, switch route, disable judge fan-out budget ledger, prompt hash, loop count
Tenant boundary data, cache, index, or tool access crosses boundary isolate tenant, revoke keys, freeze affected traces namespace, virtual key, ACL diff, audit log

Figure 93.4 shows the incident loop. Detection is only the first step. The operator has to command, mitigate, communicate, preserve evidence, and turn the failure into either a regression test or a known accepted risk. Sculley et al.'s warning about hidden technical debt in ML systems is relevant here: undeclared consumers, feedback loops, and glue code create failures that are hard to see until the system is already in production (Sculley et al. 2015). The incident loop is how those hidden dependencies become declared.

incident detect detect alert, complaint, eval command command roles + state doc detect->command mitigate mitigate rollback, route, cap, gate command->mitigate communicate communicate stakeholders + tenants mitigate->communicate evidence preserve evidence trace, config, data, consent communicate->evidence learn learn regression eval or accepted risk evidence->learn learn->detect new guard
Figure 93.4. An AI incident loop. The loop is closed only when the live failure becomes a regression eval, a policy change, a data-engine sample, or an explicitly accepted risk.

The last edge is where many organizations fail. They hold the postmortem, but the system remains unchanged. In AI infrastructure a postmortem that does not add an eval case, a budget guard, a route rule, a tenant isolation control, a data quality check, or a human approval gate is only prose. It has not modified the machinery.

Multi-Tenancy and Noisy Neighbors

AI multi-tenancy is more than Kubernetes namespaces. A tenant shares GPUs, KV cache, batch slots, vector indexes, judge capacity, tool servers, sandboxes, and sometimes humans in review queues. Kubernetes documentation names the familiar isolation tools: namespaces, access control, quotas, sandboxing, node isolation, API priority, and QoS (Kubernetes 2026). AI inherits all of them and adds semantic boundaries.

The tenant contract must answer four questions.

  1. Capacity: can one tenant's long-context or agentic workload push another tenant over the latency SLO?
  2. Data: can one tenant's prompt, retrieval chunk, cached prefix (the key-value cache a serving engine keeps for a shared prompt prefix and replays to skip recomputation), trace, or label enter another tenant's context or training stream?
  3. Authority: can one tenant's agent reach a tool, credential, or egress path meant for another tenant?
  4. Accounting: can the platform explain who consumed tokens, cached tokens, GPU seconds, judge calls, review minutes, and storage?

Isolation strength should match blast radius. A low-risk internal assistant may share a cluster with namespace and quota boundaries. A customer-facing agent that runs untrusted code should use a sandbox or a tenant-dedicated node pool. A regulated customer may need a separate index, separate encryption keys, separate model route, and separate retention policy. The mistake is treating tenancy as a single platform toggle. It is a bundle of isolation choices, each priced differently.

Governance Without a Separate Book

Governance appears elsewhere in the book as law, safety, provenance, and oversight. The operating contract is where it becomes executable. NIST's AI Risk Management Framework frames AI risk management as a voluntary process for trustworthiness across design, development, use, and evaluation (National Institute of Standards and Technology 2023), with a generative AI profile that calls out risks unique to generative systems (National Institute of Standards and Technology 2024). The operational translation is concrete:

  • a policy requirement becomes a gateway rule or approval gate;
  • a data requirement becomes a provenance and retention field on traces;
  • a transparency requirement becomes a citation, uncertainty, or disclosure surface;
  • a safety requirement becomes an eval slice, sandbox boundary, or tool allowlist;
  • an accountability requirement becomes an incident role, audit record, and owner.

Microsoft's GenAIOps guidance makes the same practical point from a workload perspective: AI workloads are nondeterministic and require processes for drift, monitoring, governance, deployment, and continuous operation (Microsoft 2024). In this book's terms, governance is not a review board floating above the stack. It is a set of constraints compiled into routing, evaluation, data, incident, and tenancy mechanisms.

Trade-Offs

Operating contracts introduce overhead. They add metadata to every request, state to every incident, meters to every route, and evidence requirements to every release. A team can overdo it: a small prototype can drown under controls meant for a regulated multi-tenant platform. The contract should grow with blast radius. The first contract can be simple: model pin, budget cap, trace ID, rollback rule, and one quality eval. What cannot be deferred is deciding where the contract will live. If it lives in chat messages and spreadsheets, the system cannot enforce it.

What's contested
  • Can open-ended quality be an SLO? One position says yes, if the task is narrowed, sampled, judged with uncertainty, and tied to user-visible outcomes. The other says semantic quality is too contextual for SLO arithmetic and should stay advisory. The practical compromise is to use quality SLOs only for named task classes, with confidence intervals and periodic human calibration.
  • Should cost gates block product behavior? Finance wants hard ceilings; product wants graceful degradation; research wants extra compute when it helps. The operating contract must decide which traffic is denied, degraded, delayed, or escalated when the budget is nearly spent.
  • How much tenant isolation is enough? Strong isolation lowers risk and raises cost. Weak isolation lowers cost and raises the chance that cache, index, tool, or trace boundaries fail. The right point depends on the tenant's data, tool authority, and regulatory exposure.
  • How much incident response should be automated? Automated rollback and route changes cut mitigation time, but they can also erase evidence or mask a semantic failure. Mature operations automate the reversible mitigation and preserve the human role for command, communication, and risk acceptance.

Infrastructure Means Being Operated

The title of this book uses infrastructure in a demanding sense. Infrastructure is not only a stack that can be assembled. It is a stack that can be promised, metered, shared, repaired, audited, and improved after it fails. The operating contract is the mechanism that gives those verbs a place in the system.

Capability is what the contract produces: can the system perform the task under the conditions users actually bring. Efficiency is its budget, the test of whether the system spends tokens, GPU seconds, judge calls, and human attention where they change outcomes. Trust is the evidence the contract leaves behind, and it asks the hardest question: can the team explain why it shipped, who it affected, what it cost, where it failed, and what changed after the failure. A stack without those answers may be powerful, but it is not yet infrastructure.

Further reading

  • Beyer, Betsy; Jones, Chris; Petoff, Jennifer; Murphy, Niall Richard. Site Reliability Engineering: How Google Runs Production Systems (SLIs, SLOs, error budgets, incident management, and postmortems). O'Reilly Media, 2016. sre.google
    Google's SRE book provides the operational vocabulary this chapter adapts to AI systems: service promises, error budgets, incident command, and learning from failure.
  • Sculley et al., “Hidden Technical Debt in Machine Learning Systems” (why operational glue and hidden feedback loops become the real system), 2015. papers.nips.cc
    Sculley et al. show that production ML systems accumulate debt through glue code, undeclared consumers, data dependencies, feedback loops, and configuration complexity.
  • FinOps Foundation, “What is FinOps?” (cost as cross-functional operational discipline), 2026. finops.org
    FinOps defines technology cost management as a collaborative operating model across engineering, finance, product, and business teams.
  • FinOps Open Cost and Usage Specification, “FOCUS: FinOps Open Cost and Usage Specification” (normalized billing data across AI, cloud, SaaS, and data center vendors; v1.4 ratified June 2026), 2026. focus.finops.org
    FOCUS provides a vendor-neutral format for cost and usage data, making AI spend analyzable beside other technology spend; its virtual-currency columns cover token purchase and burn-down, with per-model token consumption scoped for the release after 1.4.
  • Kubernetes, “Multi-tenancy” (namespaces, quotas, sandboxing, node isolation, QoS), 2026. kubernetes.io
    Kubernetes documents the isolation and fairness tools that AI platforms inherit and extend for model, cache, index, and tool boundaries.
  • Microsoft, “MLOps and GenAIOps for AI Workloads on Azure” (operations for nondeterministic AI workloads), 2024. learn.microsoft.com
    Microsoft's workload guidance treats AI operations as lifecycle management for nondeterministic systems, including monitoring, drift, deployment, governance, and automation.
  • National Institute of Standards and Technology, “Artificial Intelligence Risk Management Framework (AI RMF 1.0)” (risk management vocabulary for trustworthy AI), 2023. doi.org
    NIST AI RMF gives organizations a risk-management vocabulary for AI trustworthiness across design, development, deployment, and use.
  • National Institute of Standards and Technology, “Artificial Intelligence Risk Management Framework: Generative Artificial Intelligence Profile” (generative-AI-specific risks and actions), 2024. doi.org
    The NIST generative AI profile adapts the AI RMF to risks specific to generative systems, which this chapter translates into operating controls.

Comments

Log in to comment