Somewhere in your service there's an HTTP call to a partner API, written months ago, and nobody set a timeout on it. It never mattered, because the partner always answered in 80 milliseconds. Then one afternoon the partner slows down. Requests don't fail. They wait. Worker threads fill up one by one, and soon your own users can't log in, even though login has nothing to do with that partner. Nobody chose "wait forever." It was simply the default.
That's a real trap, by the way. The docs for Python's popular Requests library say it plainly: "Nearly all production code should use this parameter in nearly all requests. Failure to do so can cause your program to hang indefinitely" (Requests quickstart, Timeouts). The safe behavior is there, but you have to ask for it.
Defaults are architecture
A default decides what happens when nobody makes a decision. The user skips the settings page. An operator forgets an environment variable. The flag service times out. A rollout reaches a case nobody tested. In each of these moments, the system does whatever the default says, for everyone, at once.
That's why a default deserves more attention than its size suggests. It's a one-line choice with a blast radius as big as your user base.
"Safe" depends on what you're protecting
The classic version of this idea is from 1975. In their paper on protecting information in computer systems, Jerome Saltzer and Michael Schroeder listed "fail-safe defaults" as a design principle: "Base access decisions on permission rather than exclusion." Their reasoning still holds. A mistake in a system that grants access explicitly tends to fail by refusing access, which people notice fast. A mistake in a system that blocks access explicitly tends to fail by letting someone in, which can go unnoticed for a long time (Saltzer and Schroeder, Basic Principles of Information Protection).
For access control, then, safe means closed. For other things, safe can mean open or degraded. If the recommendations service is down, the safe default is to hide the "you might also like" row and keep checkout working. Blocking the purchase to protect a widget gets the priorities backwards. So start every default by naming what you're protecting: data, money, access or availability.
| Situation | Safer default | Why |
|---|---|---|
| Permission check throws an error | Deny, and log it | A wrong "no" gets reported fast. A wrong "yes" can leak data for a long time. |
| Feature flag can't be evaluated | Off, so the old path runs | The old path is the one you've already seen working in production. |
| Outbound HTTP call | An explicit timeout | Waiting forever turns one slow partner into your outage. |
| Bulk delete or migration script | Dry run unless a flag says otherwise | Irreversible writes should need a deliberate extra step. |
| Required config value is missing | Refuse to start, with a clear message | A crash at deploy time is cheaper than a guessed value in production. |
| Optional dependency is down | Hide that feature, keep the core flow | Users can finish what they came to do. |
Name the failure mode on purpose
A dangerous default is one that assumes everything around it is healthy: the provider is up, the cache is warm, the permission is correct, the record is scoped to the right tenant, the flag will always resolve. Those assumptions are fine on a laptop and fragile in production.
Designing a default means asking a short list of "what if" questions and writing the answers down:
- If this dependency is down or slow, what does the user see?
- If the account is anonymous or the tenant is missing, what data comes back?
- If the flag can't be evaluated, which path runs?
- If the payload is incomplete, do we reject it, or fill gaps with guesses?
Each answer should be a decision someone made, with a reason. Otherwise the system inherits whatever the code happened to do first.
Feature flags make this concrete
Flags are a good place to practice, because every flag evaluation already takes a default. The OpenFeature specification requires that flag evaluation calls "must always return the default value in the event of abnormal execution" and must not throw (OpenFeature, Flag Evaluation). So the second argument you pass is your fail-safe behavior. Make it the boring, known path, and make the fallback visible:
import { OpenFeature } from "@openfeature/server-sdk";
const client = OpenFeature.getClient();
// If the flag service is unreachable, this resolves to false: the old, known flow.
const details = await client.getBooleanDetails("new-refund-flow", false);
if (details.errorCode) {
// The fallback happened. Make it visible (metrics is your own metrics client).
metrics.increment("flag.fallback", { flag: details.flagKey, code: details.errorCode });
}
const useNewRefundFlow = details.value;
This is how risky changes ship on the Zalo PC team I lead: default off, behind kill switches and remote config, so switching a change off doesn't need a new release. For the rollout side of this, see Feature Flags for Safer Deployments.
A fallback nobody sees is a bug in waiting
Safe defaults need a signal. A fallback nobody notices can protect users for an hour and hide a broken path for weeks.
Jacob Gabrielson's article in the Amazon Builders' Library tells a sharp story about this. Around 2001, Amazon's retail site cached shipping speed data and fell back to querying the database directly when the cache failed. Months later the caches failed together, every web server hit the database at once, and the database locked up. The fallback turned a partial failure into a site-wide outage (Avoiding fallback in distributed systems). His advice: fallback paths are hard to test, so prefer making the primary path more reliable, and if you keep a second path, "exercise it as often as possible in production."
So the pattern has two halves. Graceful behavior for the user. A clear signal for the team: a metric, a log line with the reason, an alert when the fallback rate climbs. Without the second half, the first half only buys you time before a much bigger surprise.
The one-hour test
Here's a quick check for any default: would you be comfortable if this default applied to every user for a full hour while the team investigates something else? If the honest answer is no, the default carries too much risk. Pick a more conservative one, or make the risky path opt-in.
Good defaults don't remove the need for judgment. They give judgment a safer place to start, and they cut down the number of incidents that come from ordinary uncertainty.
Try this week
- Search your codebase for outbound HTTP calls without an explicit timeout. Add one to the busiest call.
- Pick one feature flag and check what happens when the flag service is unreachable. Is the default the old path?
- Find one fallback and add a counter for how often it fires. If the answer is "we don't know," that's your first finding.
- Run the one-hour test on the default of the next config option you add.