Vol. I a living index of named laws · est. mmxxvi no ads · no account
The Law Tomeindex of named laws

Hyrum's Law

also known as — The Law of Implicit Interfaces
"With enough users of an API, every observable behaviour of your system will be depended on by somebody: whatever the contract says."
In plain English

What does Hyrum's Law mean?

Once a system has many users, its written contract stops being the real boundary. Anything users can observe about how it behaves, not just what you documented, becomes something someone relies on, so any change to observable behaviour can break them.

Reliability

Rated Heuristic: a dependable rule of thumb, not a proven theorem. The other 224.

Lineage
2020POPULAR
How it works

How does Hyrum's Law work?

At scale, users do not restrict themselves to promised behaviour; deliberately or by accident they build on whatever they can detect: an incidental ordering, a timing characteristic, a side effect, the exact text of an output. Each such reliance quietly turns an implementation detail into a de facto contract. With enough users, the probability that every observable behaviour is depended on by somebody approaches certainty, which is why changing an internal detail can break distant, unknown consumers.

Where you'll see it

What are examples of Hyrum's Law?

Undocumented ordering A map or set happens to return elements in a particular, never-promised order. Users come to depend on it, so changing the hash implementation (a change no contract forbids) breaks them.
Timing Callers implicitly rely on an operation being 'fast enough'. An optimisation that changes its latency, even one that speeds it up, can break code that depended on the old timing.
Error-message text Consumers parse the human-readable text of an error message to branch their logic. Rewording it, though the structured contract is untouched, silently breaks them.
Spacebar heating The archetype is XKCD 1172: a changelog boasts 'the CPU no longer overheats when you hold down the spacebar', and a user complains it breaks their workflow (they held the spacebar for warmth). Any observable side effect, however absurd, is someone's interface.
Why it matters

Why does Hyrum's Law matter?

It is the core reason large-scale refactoring is hard: at sufficient scale there is no such thing as a safe, invisible change, because your real interface is everything users can see, not what you wrote down. It reframes API design and deprecation around managing implicit dependencies rather than pretending they don't exist.

Working with it

How do you apply Hyrum's Law?

  • Treat observable behaviour as the contract — assume anything users can detect is load-bearing; the documented spec is a floor on your obligations, not a ceiling.
  • Randomise incidental behaviour — deliberately vary what you don't want depended on (shuffle unspecified iteration order, jitter timings), so no accidental contract can form.
  • Change through deprecation, not surprise — measure real usage, provide migration paths, and move callers before removing behaviour, rather than assuming a spec-legal change is safe.
Where it breaks down

What are the limits of Hyrum's Law?

It is an asymptotic, probabilistic claim: it needs 'a sufficient number of users'. For a small or private API, few incidental dependencies form and the law barely bites. It also does not mean you can never change anything, only that change must be managed through measurement, deprecation policy, staged rollouts, and tooling that fixes callers. And 'all observable behaviours' is a deliberately absolute, rhetorical phrasing of a strong tendency, not a quantified law.

What it doesn't say

What are common misconceptions about Hyrum's Law?

It is not a counsel of despair that forbids all change, nor a claim that every tiny API has hidden dependents. It says that at scale your effective interface is wider than your documented one, so changes need to be driven by real usage data and safe migration, not by what the spec technically permits.

Is it real?

Is Hyrum's Law real?

Real as a rule of thumb, not as a theorem. Hyrum's Law is rated Heuristic here: dependable enough to plan with, and with no proof behind it.

Rated from three sources. 225 of the 1,116 entries carry this rating. How the scale works.

25 of 69entries in software & systems carry the same rating

The best-known laws are the least likely to rest on measurement.

Origin

Where did Hyrum's Law come from?

Named after Hyrum Wright, a software engineer at Google, whose colleague Titus Winters gave the observation its name. It was popularised through the 2020 O'Reilly book Software Engineering at Google (edited by Winters, Manshreck and Wright) and the single-page site hyrumslaw.com. The exact year Wright first stated it is not firmly documented.

Sources

Sources & further reading

  1. 1Wright, H. & Winters, T. "Hyrum's Law." hyrumslaw.com. — the canonical statement and attribution.primary
  2. 2Winters, T., Manshreck, T. & Wright, H. (eds.) (2020). Software Engineering at Google. O'Reilly. — the source that popularised the law.primary
  3. 3Munroe, R. "Workflow." xkcd #1172. — the 'spacebar heating' archetype of a depended-upon side effect.secondary

Everything above traces to hyrumslaw.com, oreilly.com and xkcd.com, three sources in all, two of them the original publications rather than accounts of them. Nothing is written from memory, and the method is written down. Spot an error or a better source? Suggest a fix.

What we checked

  • 1,116entries in the tomeListed one by one on the browse page.
  • 1,116of them citing a sourceOpen any entry: its sources sit at the foot of the page.
  • 2,489source references in allEach is named, and linked wherever the source is online.