By Luke Harrop

Rate limiting caps how many requests one client can send in a set period and refuses the excess; the standard response is HTTP 429 Too Many Requests. It is the right first control against volume from a single source. The ICO's guidance on passwords also warns that "some attackers will deliberately work within your limits to avoid detection" (ICO).

A rate limit counts per client, and the simplest way to identify a client is by IP address. Traffic spread across many addresses, or sent as one request per address, can stay below every per-IP threshold you set. OWASP's guidance on credential stuffing says mitigation should "not rely on a single predictable volume limit" (OWASP).

What is rate limiting, and what does a 429 response mean?

Rate limiting is a rule that counts a client's requests over a time window and refuses the ones above a threshold. RFC 6585 defines 429 Too Many Requests as the status for a user who "has sent too many requests in a given amount of time", and says the response may carry a Retry-After header telling the client how long to wait (RFC 6585). Under RFC 9110, that header can hold a date or a number of seconds (RFC 9110).

Two lines in RFC 6585 belong in any requirement you write. The standard "does not define how the origin server identifies the user, nor how it counts requests", so both choices fall to you and your supplier. It also says servers under attack "are not required to use the 429 status code" and may drop connections instead, since answering each one costs resources.

HAProxy's traffic policing documentation gives an example that tracks each client by IP address in a stick table and denies any client making more than 100 requests in a sliding ten-second window, returning a 429 (HAProxy). The same page also keys counters on URL path and on a token in the URL, so one page or one API key can carry its own limit.

Where should a rate limit sit on an API?

A rate limit on an API belongs on each endpoint, set to what that endpoint does. OWASP's API Security Top 10 lists rate limiting as a prevention for API4:2023 Unrestricted Resource Consumption and adds that "some API Endpoints might require stricter policies" (OWASP API4). It names validating a one-time passcode and requesting password recovery as operations to throttle per user.

OWASP's API4 entry also lists higher operational costs among the consequences, and recommends spending limits or billing alerts on paid integrations. We set out the metered AI version of that problem in what bot traffic costs you. A login form, a site search and a cached page should not share one number.

Why does per-IP rate limiting miss distributed and slow attacks?

Per-IP rate limiting misses attacks that spread their requests across many addresses, because each address stays under the threshold. OWASP's Credential Stuffing Prevention Cheat Sheet says toolkits with built-in proxy support "may defeat both IP block-lists and rate limiting, as per IP request volume may remain relatively low, even on high volume attacks". The NCSC's 2018 advisory recorded attacks using anything "from one up to tens of thousands" of IP addresses (NCSC).

23andMe's own investigation, as recorded in the ICO's 2025 penalty notice, found that its rate-limiting rules keyed on IP address "had not been triggered by the threat actor's activity due to their rotation of thousands of unique IP addresses" (ICO penalty notice). Our piece on credential stuffing covers the full case.

Quiet traffic is the other gap. OWASP's Automated Threat Handbook lists "just one single request and no more from that browser/session/device/fingerprint" as a possible symptom of OAT-004 Fingerprinting, and one request per client cannot exceed any per-client rate (OWASP handbook). The cheat sheet asks for long periods to be watched as well as bursts, including one address that "generates low but consistent volumes of traffic" alongside many others.

What a behavioural and policy layer adds

A behavioural layer counts the shape of activity rather than the raw number of requests. CrowdSec's published aggressive-crawl scenario counts distinct non-static pages fetched and overflows past 40, draining one entry every half second; its probing scenario counts distinct paths returning 404, 403 or 400 errors and overflows past 10 (crawl, probing). A scraper or a scanner shows up on those counts at a volume a rate limit would allow.

Those scenarios still group events by source IP and site. An attacker who rotates addresses splits a behavioural count in the same way they split a rate limit, so behavioural rules alone do not answer the distributed case. Three other parts of the layer address it.

Reputation shared across many sites changes where you start. CrowdSec's community blocklist is "a curated list of IP addresses identified as malicious by CrowdSec", built from signals its users contribute (CrowdSec), so an address already seen attacking elsewhere can be challenged on its first request to you. It is still a list of addresses, and one nobody has reported yet will pass.

Proportionate responses keep people moving when an address is doubtful. OWASP's API6:2023 guidance on sensitive business flows lists human detection by CAPTCHA, and flow analysis for non-human patterns such as reaching "add to cart" and "complete purchase" in under a second (OWASP API6). A challenge in place of a block lets a real person on a shared address continue, while every scripted request now has a step to clear.

Correlating signals across the whole site catches what one endpoint cannot see. The NCSC advised a backend metric for "unsuccessful login attempts across accounts", which works however many addresses an attacker uses. The advisory says the metric will flag instances "where an attacker isn't rate-limiting the number of guesses".

Axistwelve BotShield Edge applies behavioural rules and source reputation at the HTTP edge of the hosting we operate, built on HAProxy and CrowdSec, before requests reach the application. Axistwelve's hosting team sets and tunes a policy for each site, starting in monitor mode, and every allow, challenge or block decision keeps the reason it was made. It does not replace the rate limits in your application (BotShield Edge).

When is rate limiting enough, and when do you need behavioural bot control?

Rate limiting is enough when the risk is excess volume from clients you can identify, such as an API whose callers authenticate with keys you issue. Counting per key and per endpoint means an address change does not reset the count. NIST's SP 800-63B-4 takes the same approach for authentication, limiting consecutive failed attempts on a single subscriber account to no more than 100 (NIST).

Behavioural bot control earns its place where the client is anonymous and the target is worth the effort: a public login or password reset, content worth scraping, or a site being mapped for weaknesses.

Whichever you run, someone has to own the thresholds. Put a review date on every limit and check it against current traffic.

What to ask a supplier about rate limiting and bot control

Put these questions to whoever runs your hosting, CDN or application, and ask for the answer in writing.

Question A strong answer A weak answer
What does each limit key on? IP, account, API key or path, chosen per endpoint and written down "We rate limit by IP" across the whole site
Which endpoints have their own limit? Login, password reset, one-time passcodes and search each named, with numbers One global figure
What happens when a limit trips? 429 with Retry-After for clients, a challenge or block for abuse, and a stated duration "Requests are blocked" with no detail
What would show an attack spread across thousands of addresses? A site-wide metric, such as failed logins across accounts, with an alert on it Nothing beyond per-IP counters
Can you show why a request was blocked? A named rule or scenario on every decision, in a report we can see A block count with no reasons
Can new rules run in monitor mode first? Yes, per site, with a review before enforcement Rules go straight to blocking

Before you rely on rate limiting alone

  • List your endpoints: note the limit on each, starting with login, password reset, passcode checks, search and anything billed per request.
  • Check the key: find out whether each limit counts per IP, per account or per API key, and whether that matches who uses the endpoint.
  • Read a refusal: trigger a limit in a test environment and check the status code, the Retry-After value and how long the refusal lasts.
  • Set a site-wide baseline: pull a normal week of login logs, count failed logins across all accounts, and alert when that count moves.

Frequently asked questions

Is rate limiting per account better than per IP address?

Per-account and per-IP limits catch different things, so a login service is better served by both. A per-account limit, like the NIST cap of 100 consecutive failures, protects one account however many addresses attack it. Neither limit sees an attacker trying one password on each of thousands of accounts from thousands of addresses, which is the case the NCSC's cross-account metric is meant to flag.

Can rate limiting lock real users out?

Rate limiting can lock real users out. The ICO warns that "overly-aggressive rate limiting can be used as a denial of service attack", noting UK GDPR's requirement that personal data stay available. Users who share an address, such as staff behind one office connection, can hit a per-IP limit together. A challenge in place of an outright refusal gives those users a way through.

Do behavioural bot controls replace rate limiting?

Behavioural bot controls sit alongside rate limiting, and OWASP files the two under separate risks: API4:2023 covers resource consumption, where rate limiting is one of the listed preventions, and API6:2023 covers abuse of legitimate business flows, where behavioural defences appear. Keep per-endpoint limits in the application and put the behavioural layer at the edge.