We get asked about per-tenant rate limits for SaaS platforms more than almost anything else, so here is the long answer.
What we changed
We moved the decision from a single threshold to a continuous score, added an explanation to every decision and made every rule testable against historical traffic before it goes live.
The result is fewer late-night pages for our analysts and — more importantly — fewer real users challenged by mistake.
Why per-route baselines matter
A thousand requests per second to your homepage is Tuesday. A thousand requests per second to your password-reset endpoint is an attack. Global rate limits cannot tell the difference; per-route baselines can.
We learn the normal shape of traffic per route and per hour of the week, so a surge on a sensitive endpoint raises the risk score long before it approaches a global threshold.
Challenges beat blocks
Blocking lists go stale within minutes when attackers rotate through residential proxies. Proof-of-work does not care where a request comes from; it only cares whether the client is willing to pay the cost.
For a real browser that cost is a few hundred milliseconds, once per session. For a botnet sending a million requests a minute it is a million puzzles a minute — and at that point the attack stops being cheap.
Latency budget
Our budget for the whole filtering pipeline is one millisecond at the 99th percentile. Anything that cannot be decided within that budget runs asynchronously and influences the next request from the same client, not the current one.
That constraint shapes everything: data structures, where state lives and which signals we are willing to compute inline.
We will follow up with the numbers from the next quarter.
Great write-up. We saw almost the same pattern on our login endpoint last month.
Clear and practical, thanks.
Great write-up. We saw almost the same pattern on our login endpoint last month.
Good question. We will cover that in a follow-up post.
The point about origin IPs leaking through certificate transparency logs is underrated.
Carpet bombing is nasty. Good to see a clear explanation of it.
Great to hear, thanks for sharing your experience.