Skip to main content

Rate limiting (sliding window, fail-closed)

Generated from mcp/patterns.registry.json — do not edit by hand; change the registry and run bun run patterns:build.

Index card — the docs below are the canonical explanation; deep-tier pattern pages additionally carry invariants and emulation notes.

Category: Anti-Abuse · Tier: light · Risk: medium — throttling correctness affects both abuse defense and legitimate-user access

A sliding-window rate limiter factory backed by Upstash Redis that produces per-purpose limiters (email, IP, comments, grants) and fails closed when Redis is unavailable.

When to use: Use whenever an endpoint or action needs abuse-resistant request throttling with predictable fail-closed behavior.

Docs

Code

Proof


Machine-readable record: anti-abuse-rate-limiting in mcp/patterns.registry.json.

← Back to Pattern Library

Think this pattern could be better? Tell us how.

Leave feedback