Hyrum's Law
"With enough users of an API, every observable behaviour of your system will be depended on by somebody: whatever the contract says."
"With enough users of an API, every observable behaviour of your system will be depended on by somebody: whatever the contract says."
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.
Rated Heuristic: a dependable rule of thumb, not a proven theorem. The other 224.
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.
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.
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.
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.
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.
The best-known laws are the least likely to rest on measurement.
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.
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.