Hyrum's Law

Also known as: Law of Implicit Interfaces

framework · computer science · structured-empirical

With enough users, every observable behavior of an interface becomes someone's dependency.

Hyrum's Law was articulated by Hyrum Wright at Google around 2017 (popularized through hyrumslaw.com and through Software Engineering at Google, 2020) and states: 'With a sufficient number of users of an API, it does not matter what you promise in the contract: all observable behaviors of your system will be depended on by somebody.' The law captures the empirical reality that as APIs gain users, the gap between the documented contract and the actual behavior of the implementation becomes a dependency surface — users discover incidental behaviors (timing, error message strings, ordering of unspecified outputs, performance characteristics) and write code that depends on those behaviors, often unknowingly. Changing the implementation in ways that preserve the documented contract but alter incidental behavior breaks those users. The law is empirically grounded in Google's experience maintaining widely-used APIs and is sharply visible in standards-body work: HTML and JavaScript implementations have been forced to preserve historical bugs because real-world content depends on the bug behavior. Hyrum's Law reframes API maintenance from contract-stability to behavior-stability, with substantial implications for backward-compatibility strategy, deprecation, and the value of strict-by-default protocol design (the modern critique of Postel's Law).

Originators

Hyrum Wright (Google) high

Year / Decade

Around 2017 codification; 2020 (Software Engineering at Google book) high

Primary sources

Wright, H. (ongoing). hyrumslaw.com, Winters, T., Manshreck, T. & Wright, H. (eds.) (2020). Software Engineering at Google high

Core components

Primary use case

API and protocol design at scale; foundation for backward-compatibility strategy; basis for techniques like deliberate randomization (iteration order, ID generation) that prevent hidden dependencies; teaching framework for software engineering at scale; reference in standards-body work on protocol evolution; complement to Postel's Law in modern API thinking.

Common criticisms

Lineage

Siblings
Postel's Law