The dashboard for the quote workflow looks perfect for the day. Every quote request that arrived was answered. Every run ended in the state "waiting for the underwriter", and the typical run finished in under two seconds. By the usual measure, the service had a flawless day.
Then an underwriter opens one of the review tasks. The building is the masonry office SUB-1004. The stored recommendation does not say approve, decline, escalate or request more information. It holds a fragment of text that the model returned and that nothing checked. It cites no rule, it carries no policy version, and it does not say that a person must decide. The underwriter cannot act on it, and cannot tell how many other tasks look the same.
This is scenario UW-R05 of the example, run with the naive workflow: the model's first answer is malformed, and the naive workflow stores it as it came.
end state:
run run-3c26 state waiting_for_human resume_count 0 ended at 1998 ms (deadline 120000 ms)
recommendation rows 1 (pending_review 1, withdrawn 0) · review tasks 1 · decisions 0 · dead letters 0
REC-0001 pending_review NOT A VALID RECOMMENDATION cites none evidence EV-ROOF-0412, EV-RULE-0007
invariants:
INV-3 FAIL REC-0001 is stored without requires_human: true
INV-6 FAIL REC-0001 does not carry policy_version 2026.2
The run answered fast and ended in a normal state. The answer was wrong. Both statements are true at once, and a team that measures only the first will believe the second never happens. The Start page defined reliability as delivering acceptable outcomes despite failures; this page takes "acceptable" apart into four separate promises, because each one breaks in its own way and needs its own protection.
Four promises, one sentence each#
Engineers use four words for what a dependable system promises. They are often used as if they meant the same thing. They do not, and the quote workflow can break any one of them while keeping the other three.
Availability means the system answers when asked. A tiny example: a broker sends a quote request, and within the deadline the workflow produces some end state rather than hanging or refusing. The naive UW-R05 run was available.
Correctness means the answer is right and complete by the rules that apply. For this workflow that means a valid recommendation, citing the rule it relied on, under the current version of the policy fixture, marked as needing a person. The naive UW-R05 run was not correct.
Durability means that what the system has accepted, it keeps. A tiny example: once the queue has taken a quote request, that request must survive a crashed worker; once the store has written a recommendation, that row must still be there tomorrow.
Resilience means the system keeps its outcomes acceptable while one of its dependencies is failing. A tiny example: the roof-data provider is down for an hour, and the workflow still ends each run with something an underwriter can use, instead of nothing.
Each of these is a promise someone relies on. The broker relies on availability. The underwriter relies on correctness. The insurer, which has to account for every request it received, relies on durability. And everyone relies on resilience, because no dependency is up all the time.
Diagram: Four promises on one run · each one asks a different question
Read left to right as four checks on the same run of the quote workflow. Each box names the question and the scenario that breaks that promise while keeping the others. A run is reliable only if it passes all four.
- Available
- Did it answer?: The run reached some end state before its deadline instead of hanging or refusing.
- Correct
- Was it right?: The stored recommendation is valid, cites its rule, carries the current policy version and needs a person.
- Durable
- Was it kept?: A request the queue accepted, and a row the store wrote, survive a crashed process.
- Resilient
- Did it hold?: The outcome stays acceptable while a dependency is failing: a smaller honest result in place of none.
The diagram puts one question next to each promise, and the scenario in the example that breaks it. Read it from left to right as four checks on the same run: did it answer, was the answer right, was it kept, and did it hold while a dependency was failing. A run passes as reliable only if it passes all four.
One incident per quality#
Abstract words become useful when each one has an incident attached. The example has a scenario for every quality, and each scenario keeps three qualities intact while it breaks the fourth.
"It answered" is not "it was right"#
The naive UW-R05 run is the incident for correctness. The interesting part is why availability did not warn anyone. Availability is usually measured as the share of requests that got a successful response. The Google SRE book describes this as aggregate availability, the ratio of successful requests over a window, and notes that it also fits batch work by counting successful units of work (Embracing Risk). By that ratio the naive run was a success: it produced a row and ended in waiting_for_human.
A model makes this gap wider than it is for ordinary code. A broken function usually throws an exception, and an exception counts as a failed request. A model almost always returns something, and that something looks like an answer: it is text, it arrives on time, the HTTP status is 200. Whether it is a valid recommendation is a separate question that only a check of the content can answer. The careful workflow asks that question before it stores anything. Here is the same scenario with the careful workflow, from a copy of examples/uw-reliability/; a successful run shows the output being checked and asked for again, and says nothing about how often a real model returns broken output.
/opt/homebrew/bin/python3 run_scenario.py --scenario UW-R05
1974 worker-A draft_recommendation 1 attempt failed: MalformedOutput: not valid JSON (Unterminated string starting at at character 130)
1974 worker-A draft_recommendation 1 ask again: 0 ms
3374 worker-A draft_recommendation 2 attempt ok
3374 worker-A draft_recommendation - step done: checkpoint saved
3386 worker-A record_recommendation 1 attempt ok
3386 worker-A record_recommendation - step done: checkpoint saved
3398 worker-A open_review_task 1 attempt ok
3398 worker-A open_review_task - step done: checkpoint saved
3398 worker-A await_underwriter - run ended: waiting_for_human
3398 worker-A await_underwriter - step done: checkpoint saved
3398 worker-A - - acknowledged
end state:
run run-3c26 state waiting_for_human resume_count 0 ended at 3398 ms (deadline 120000 ms)
recommendation rows 1 (pending_review 1, withdrawn 0) · review tasks 1 · decisions 0 · dead letters 0
REC-0001 pending_review escalate cites R-ROOF-03 evidence EV-ROOF-0412, EV-GUIDE-0031, EV-RULE-0007
The careful run is 1,400 ms slower and paid for two model calls. It is also correct. Correctness costs latency and money here, and that is a trade the team should make on purpose rather than discover.
What this is not. Checking that a recommendation is valid JSON with the right fields is a structural check. Measuring whether recommendations are good, across many cases and repeated trials, is the work of Eval Engineering. This site cares that a broken answer is never stored as if it were a real one.
"It was right" is not "it was kept"#
Now suppose the answer is right. It can still be lost, and the loss is the incident for durability. The cleanest way to see it is in the queue that hands quote requests to workers.
A queue can hand over a message in two basic ways. It can delete the message the moment a worker takes it. Or it can keep the message hidden for a while and delete it only when the worker confirms that the work is done. The first way never delivers twice, but if the worker dies before doing the work, the request is gone. The second way may deliver twice, but nothing accepted is ever lost. The queues page names these two ways (at-most-once and at-least-once) and explains them in full; here we only need to see what each does to durability.
The script below calls the queue simulator of the example, queue_sim.py:simulate_queue, with a worker that dies before doing its work. It was written for this page and run against the example. A successful run shows which delivery mode keeps the request; it does not say anything about a real queue product.
from queue_sim import simulate_queue
for mode in ("at_most_once", "at_least_once"):
r = simulate_queue(mode, "before_work", False, 5)
print(f"{mode:14} deliveries {r['delivery_count']} effects {r['effects']} of {r['expected_effects']} lost {r['lost']}")
print(" ", r["sentence"])
at_most_once deliveries 1 effects 0 of 1 lost True
At-most-once: the message was deleted on receive, the worker died, and the work is lost.
at_least_once deliveries 2 effects 1 of 1 lost False
The message came twice, and the work happened once, because the first worker died before doing it.
The first line is a durability failure with nothing wrong in it from the outside. No error reached anyone, because the only process that knew about the request died. The broker waits for an answer that will never come. The second line keeps the request, at the price of a second delivery, which the next pages learn to make harmless.
Durability also has a quieter form inside a long run. A run that has done five of its eight steps holds valuable work: a roof assessment that was slow to get and a model answer that was paid for. If that work lives only in the memory of the process, a crash throws it away, and the next process must redo it. Saving progress after each step is the subject of the checkpoints page.
The SRE book makes a related point about stored data from the user's side: data that cannot be reached for long enough is, to the user, the same as data that was lost, and a backup only counts if it can be restored (Data Integrity). For a recommendation the lesson is the same. Kept means kept where the underwriter can find it.
"It was kept" is not "it held while something broke"#
The last incident is the one for resilience. In scenario UW-R03 the roof-data provider stays down for the whole run, for submission SUB-1006. The naive workflow keeps calling it, at once and without limit, and the end of its run looks like this.
120000 worker-A get_roof_assessment 60 attempt failed: ToolTimeout: get_roof_assessment: no answer after 2000 ms
120000 worker-A get_roof_assessment - DEADLINE EXCEEDED: get_roof_assessment: the deadline passed after 60 attempt(s)
120000 worker-A get_roof_assessment - run ended: deadline_exceeded
end state:
run run-bef5 state deadline_exceeded resume_count 0 ended at 120000 ms (deadline 120000 ms)
recommendation rows 0 (pending_review 0, withdrawn 0) · review tasks 0 · decisions 0 · dead letters 0
Sixty attempts, two minutes, no recommendation. Nothing was stored wrongly, so durability and correctness were not broken. The workflow had no plan for a dependency that stays down. The careful workflow tries three times with waits in between, then stops calling the provider and goes on without it. It stores request_info with missing: ["roof_assessment"], marked degraded: true, and the run ends at 8,778 ms in degraded_request_info. The underwriter gets a smaller answer, and an honest one: the roof data is missing, ask for it.
That is what resilience looks like in practice. It is rarely "the failure had no effect". It is "the failure had a bounded, honest effect". The mechanisms behind it, a bounded retry and a circuit breaker that stops calling a dependency that keeps failing, have their own pages: retries and breakers.
| Quality | The question | Incident in the example | The invariant that catches it | Where the protection is taught |
|---|---|---|---|---|
| Availability | Did it answer, within the deadline? | UW-R03 naive: no end state for 120,000 ms, then deadline_exceeded | INV-4 (every run ends in a named state inside its deadline) | Retries, Breakers |
| Correctness | Was the answer right and complete? | UW-R05 naive: broken text stored as the recommendation | INV-3, INV-6 | Output validation on Failure modes |
| Durability | Was what it accepted kept? | A request deleted on receive, then a dead worker | None in the store: the queue simulator counts the request as lost | Queues, Checkpoints |
| Resilience | Did it stay acceptable while a dependency failed? | UW-R03 careful against naive | INV-4, INV-5, INV-7 | Breakers, Fallback |
Two things stand out in the table. First, availability and resilience share an incident: when a dependency fails, the first thing to go is usually the answer itself. Second, three rows have an invariant that reads the store, and the durability row does not. That gap is real, not an accident of the example. A request that was lost before anything was written leaves nothing in the store to check, so it has to be counted where it entered: at the queue. If a quality cannot be written as something that must be true after a run, at some place you can read, nobody can test whether it holds.
Fault, error, failure: three words for three moments#
The incidents above were described loosely: "the provider failed", "the run failed". To reason about recovery, three moments need three different words. The vocabulary comes from dependability research, where faults, errors and failures are named as the threats to a dependable system (Avizienis, Laprie, Randell and Landwehr, 2004); this site uses them in the plain sense below.
A fault is a cause: something that went wrong inside a component. The provider's server is overloaded; a network cable drops packets; a model route is down. A fault can sit unseen for a while.
An error is the visible sign of a fault at an interface, where one component talks to another. The agent asks the provider for a roof assessment and hears nothing for 2,000 ms: that timeout is an error. So is a 429 from a model provider, or an exception from the store.
A failure is when the system as a whole does not deliver an acceptable outcome. The underwriter gets no recommendation, or two, or a broken one. A failure is the thing the business notices.
The point of separating them is that an error does not have to become a failure. Scenario UW-R02 shows it. The provider is overloaded (the fault). The first two calls time out (two errors). The careful workflow waits and tries again, and attempt 3 returns the roof assessment. The run ends normally with one row. Two errors, no failure. Recovery mechanisms all live in that gap: they catch errors before they turn into failures.
Diagram: Fault, error, failure · the chain can be stopped in the middle
Read left to right. The same fault, an overloaded provider, produces the same errors in both workflows. The response decides whether the chain reaches a failure. The careful workflow stops it with a bounded retry; the naive workflow, when the provider stays down, keeps it going until the deadline.
- Cause
- Fault: Something goes wrong inside a component. Nobody sees it directly.
- Sign
- Errors: The visible sign of the fault where the agent calls the provider: a timeout on attempts 1 and 2.
- Response
- Bounded retry: Waits a growing time between attempts, at most three attempts, inside the run's deadline.
- Retry at once, forever: Tries again immediately with no limit until the deadline is gone.
- Outcome
- No failure: The errors were absorbed. The underwriter gets one recommendation and never knows the provider struggled.
- Failure: The system did not deliver an acceptable outcome: the run ended in deadline_exceeded with no row.
Read the diagram as two runs that share their first two boxes. In both, the same fault produces the same errors. What happens next decides whether the chain reaches a failure. The careful workflow stops it with a bounded retry; the naive workflow of UW-R03 keeps the chain going until the deadline is gone.
Common confusion. "The run failed" is often said when "a call returned an error" is meant. Keep them apart. Errors are normal and frequent; they are what the workflow is built to absorb. A failure is rarer and is the thing the insurer actually pays for.
Partial failure: one side knows, the other does not#
One more kind of failure needs its own name, because it is the root of most of the trouble on the next six pages.
In a program that runs in one process, a step either happens or it does not. If the process crashes, everything stops together. A system made of several processes behaves differently: one part can finish its work while another part is cut off, and neither can be sure of the other's state. That is a partial failure.
Scenario UW-R06 is the cleanest case. The workflow asks the store to write the recommendation. The store writes the row and commits it. Then the answer to the workflow is lost on the way back. Now the store knows that the row exists, and the workflow knows only that it did not hear back. From where the workflow stands, "the write failed" and "the write succeeded and I missed the answer" look exactly the same. A timeout tells you nothing about whether the write happened.
What the workflow does next decides the outcome. The naive workflow treats the missing answer as a failure and writes again: two rows, and INV-1 is broken. The careful workflow sends the same write again with the same key, the store recognizes it, and returns the row it already has: one row. The idempotency page is entirely about that move.
Before AI. Every backend engineer has met partial failure. A Spring service calls a payment API, the HTTP client times out, and nobody knows whether the charge went through. A JDBC driver loses its connection during a commit, and the application cannot tell whether the transaction committed. What is different for an agent is the number of such moments: an agent run makes many calls across several systems, over seconds or minutes, and each write is a place where the two sides can disagree.
Try it: which quality is missing?#
The quiz below gives five short incidents from the example. For each one, pick the quality that is missing, or the word that names what happened. Each answer comes with its reason.
If the quiz does not load, here are the same five questions with the answers and the reasons (from the quiz data of the site, scripts/build_data.py).
| Incident | Answer | Why |
|---|---|---|
The naive workflow answers every request, but in UW-R05 it stores broken text as the recommendation | Correctness | It answered, so it was available; what it stored was not a valid recommendation |
| A queue deletes the request when a worker takes it; the worker dies before the work; nothing is left | Durability | The request was accepted and then lost |
The provider stays down (UW-R03); the careful workflow stops calling it and stores request_info | Resilience | The outcome stays acceptable while a dependency fails |
| The provider is overloaded; the agent sees "no answer after 2000 ms"; attempt 3 succeeds | An error | The overload is the fault, the timeout is the error, and there was no failure |
In UW-R06 the store commits and the acknowledgement is lost | A partial failure | One part did its work and the other never learned of it |
The agent here is a scripted stand-in, and every fault is injected on purpose, so these results show how the mechanism works, not how reliable any model or provider is.
When a quality is protected the wrong way#
Each quality has a characteristic way of being protected badly, where the fix for one promise breaks another.
Buying availability with correctness. The naive workflow is very available: it stores whatever came back, so every run ends quickly. That is the trade in UW-R05, and it is the most common one for teams new to models: a run that never fails because it never checks.
Buying durability with correctness. The at-least-once queue keeps every request, and pays for it with duplicate deliveries. If nothing downstream recognizes a duplicate, durability has been bought with a double write. Scenario UW-R10 shows the result in the naive workflow: two runs, two rows, two tasks.
Buying availability with resilience. Retrying forever keeps a run alive as long as possible, which looks like availability. In UW-R03 it gave 60 attempts and no answer, and in a real system all those calls land on a provider that is already in trouble. The retries page shows how that becomes a retry storm.
Mistaking resilience for correctness. A degraded answer is acceptable only if it says that it is degraded. A fallback that quietly returns a weaker answer as if it were the normal one has kept the run available and given up correctness without telling anyone. INV-7 exists for that case, and the fallback page shows how to mark a result.
The same idea for a coding agent#
A coding agent shows the same four promises on a different kind of work. It is available if it produces a patch and a pull request within its time limit. It is correct if the patch fixes the issue without deleting the failing test. Its work is durable if the branch it pushed is still there when the reviewer looks, and not only in the scratch directory of a process that has since been killed. And it is resilient if a CI runner that times out leads to a re-run of the job, or to a clear note that CI could not finish, rather than to a pull request marked ready with no test result. A green status that nobody checked is the coding agent's version of UW-R05. The runtime that keeps a coding agent's work is the subject of Harness Engineering; getting the change through review and CI is Diff to Deploy.
What this is not. How a broken answer or a lost request is seen, in logs, metrics and traces, is Observability Engineering. This page gives the words for what was broken; that site shows how to notice it.
Frameworks that offer "durable execution" or "exactly-once processing" each promise a particular one of these qualities under particular conditions. What each one keeps for you is described, from its own documentation, on the frameworks page.
Why availability numbers mislead for long runsRequest ratios, run ratios, and what "successful" counts
A request-success ratio was designed for short requests that either succeed or fail. An agent run breaks both assumptions. It is long, so "the run is still going" is a third state that the ratio has to put somewhere: count it as success and a hung run looks healthy; count it only when it ends and the number lags behind the incident. And "successful" has to be defined. If it means "ended in a named state", the naive UW-R05 counts as a success. If it means "ended in an acceptable outcome with a valid row", it does not.
The practical rule is to measure availability and correctness as two indicators, not to fold correctness into "success". An unacceptable-outcome rate (runs that left a duplicate, a broken row, no row, or no end state) sits next to the plain availability ratio. When the first rises while the second stays flat, the system is answering and getting it wrong, which is the most expensive state to be in unnoticed. The SLOs page builds these indicators.
Correctness has two layers for a modelValid by structure, right by judgment
For a recommendation, correctness has a layer that code can decide and a layer that it cannot. Code can decide that the output parses, has one of the four allowed values, cites only rules that exist, carries the current policy_version and sets requires_human: true. That is what INV-3 and INV-6 check, and what the careful workflow validates before storing. Code cannot decide that escalate was the best advice for this building; that needs graders, cases and people, and belongs to evaluation.
Reliability engineering owns the first layer and must not claim the second. A suite that shows "295 runs, every invariant held" says the workflow never stored a structurally broken or duplicated recommendation under the injected faults. It says nothing about whether the recommendations were good. Keep both claims, and keep them apart.
Durability at three scopesThe row, the request, the run
Durability is usually discussed for a single write: once the database says "committed", the row survives a crash. That is necessary and assumed throughout this site. Two larger scopes matter as much for an agent. The request must be durable from the moment the broker's email is accepted until a run reaches a terminal state: that is the job of the queue and its delivery mode. And the run's progress must be durable, so that a crash after an expensive step does not throw that step away: that is the job of the checkpoint.
The three scopes fail independently. A perfectly durable database does not help if the queue deleted the request on receive. A durable queue does not help if every redelivery starts the run from step 1 and calls a paid model again. Each scope needs its own answer to "what is still true after this process dies?"
Checklist#
| Question | A good answer looks like |
|---|---|
| Do you measure availability and correctness separately? | Two indicators, one of them an unacceptable-outcome rate |
| Is every model output checked before it is stored? | Parse and validate, then store; never store what was not checked |
| Is a request ever deleted before its work is done? | No: it is confirmed only after the run reaches a terminal state |
| What happens when a dependency stays down? | A bounded number of tries, then a smaller result marked as degraded |
| Can you name the fault, the error and the failure of your last incident? | Three different sentences |
| Is each quality written as an invariant your tests check? | Yes, at least one invariant per quality |
In one breath#
Available, correct, durable and resilient are four different promises: it answered, it was right, it was kept, and it held while something broke. A model makes the first two drift apart, because it almost always answers and the answer always looks like one. A fault is a cause, an error is its sign, and a failure is what the business sees, and every recovery mechanism lives in the gap between an error and a failure. The hardest case is the partial failure, where one side did the work and the other side cannot know.
You can now say which promise an incident broke, and you know that most trouble starts where a call returns an error. What you cannot yet say is which errors are worth trying again: a 429, a timeout, a broken answer and a rejected task all look like "the call failed", and they need opposite responses. Failure modes goes through the six things an agent depends on and how each one fails.