Skip to content
Seedling

Mill’s Harm Principle Applied to API Rate Limiting

· 2 min read
Mill’s harm principle draws the line for API rate limiting: restriction is justified when one client’s consumption degrades service for others, not when it serves only the provider’s commercial interest. Limits that protect a shared resource are governance of a commons; limits set to push upgrades are extraction.

When does rate limiting protect shared resources and when does it restrict legitimate use?

Mill’s harm principle draws the line: restriction is justified when one user’s consumption degrades the experience for others. It is not justified when the restriction serves only the provider’s convenience or commercial interests. The distinction is between protecting a commons and controlling access to it.

Mill’s On Liberty argues that individual freedom should be restricted only to prevent harm to others. Applied to APIs, this means rate limiting is justified when one client’s request volume threatens the service quality experienced by other clients. It is harder to justify when the API has spare capacity and the rate limit serves primarily to upsell to a premium tier.

I implemented rate limiting on a public API that served many clients. The initial limits were based on the top percentile of usage: clients who consumed far more than the rest were rate-limited. This was Millian: the restriction protected the shared resource from the few who would degrade it for the many. Six months later, the business team asked me to lower the limits to push clients toward a paid tier. The API had capacity to spare. The new limits were not protecting anyone. They were restricting liberty for commercial gain. Mill would not have approved. I pushed back. The limits stayed at the protective threshold.

The engineering question and the ethical question are the same: is this limit protecting the commons we share, or is it an artificial constraint? The answer determines whether rate limiting is infrastructure or extraction. Every infrastructure design decision carries this ethical dimension, whether acknowledged or not.

Mill wrote about speech and assembly. The principle applies wherever shared resources exist. An API is a commons. Rate limiting is governance of that commons. And governance, as Mill insisted, requires justification beyond the governor’s convenience.