Say your service hands a judgment to an external model: is this blog comment spam, is this support ticket a refund request, does this conversation carry a risk signal. Sooner or later that call fails — a timeout, a provider outage, exhausted credits, an empty response. And the code usually says: "If it fails, store the safe value and move on."
What should you store when an external judgment fails?
When a judgment fails, don't invent a judgment value and store it. Store "failed" as its own state, or store nothing and return a retryable error. An invented value lands in the same column, in the same shape, as a real judgment — and from that moment the failure disappears from your records. A failure that disappears is never counted, and a failure that is never counted is never fixed.

How does an invented default hide the problem?
We hit this three times, in the same shape, in one conversational service.
- All that remained was a slow, bland result. The call that summarizes a finished conversation took 16 seconds and always returned the same fixed sentence. With extended thinking on, thinking tokens are spent inside
max_tokens(official docs); the cap was a small 700, so the model ran out while still thinking and the structured output came back empty. The code covered the empty output with a prepared fallback sentence. No error ever surfaced. A background summary sharing the same settings was empty too. - The "safe" value nearly froze the whole service. When the risk classifier failed, the code stored the most conservative level. It looks safe — but that level changed the conversation flow. One provider outage or credit exhaustion and every user's conversation would stall on a warning every turn. Worse, the conservative level was also the trigger for another behavior (exempting the conversation from a paywall), so an outage became an exemption.
- When the value's meaning changed, the safety guarantee quietly vanished. Later the policy changed so that the "caution" level no longer showed a support notice. "Caution" was exactly the value invented on classifier failure. Overnight, failed judgments turned into "no notice," and it only came out in code review.
Why isn't a "safe" default good enough?
The problem with a default isn't the value — it's that the distinction is lost. A value that is "safe" today means something else tomorrow, once its UI behavior or its role as a condition elsewhere changes. By then the failed judgments are mixed in with the real ones and can't be picked out. An invented value freezes today's policy into your data, and policy always changes.
How do you record a failure?
- Mark failure separately, not as one more value. Add a distinct state such as
errorto the judgment field, or leave the judgment empty and recordfailed_atplus the failure kind (timeout, empty response, balance). - If you can't store a real result, don't store one. Returning "try again shortly" costs less than keeping an invented value forever.
- Except when the input alone decides. Only cases that need no model — a banned keyword appearing verbatim, say — get judged by code, and those results record their source as
rule. - Count the failure rate. Count empty outputs and fallback uses per day. If the rate isn't zero, look at the settings underneath (max length, timeout, balance).
- Keep the failure state from triggering anything. Explicitly exclude it from the conditions for exemptions, blocks, and alerts. If you re-check conservatively, cap how many times.
- Ask when policy changes. Add one line to your change checklist: "Can this value also be produced by failure handling?"
What instruction should you give your agent?
Give your coding agent this, verbatim:
When writing code that stores the result of an external call (model, classifier, API):
- Never store a failure or empty response as a default value or fixed sentence.
- Store failure as a distinct state (error + kind), or store nothing and return
a retryable error.
- The only exception is a result decided by the input alone; record its source (rule).
- Never use the failure state as a condition for other features (exemptions,
blocks, alerts).
- Add a metric that counts how often the fallback path was taken.
A blog-comment example
Picture a blog that, when its spam model fails, marks the comment "not spam" and publishes it. Every spam comment that arrives during an hour-long outage becomes, permanently, a comment judged "not spam." Evaluate the model on those records later and its accuracy looks worse than it is; try to re-filter and you can't tell which judgments were real. Had the failures been stored as pending, you would simply re-judge those comments and be done.