rate-limiting

Implement per-IP rate limiting with HTTP 429 responses and 5 requests-per-minute budgets.

15|1|Updated Oct 20, 2025
One-click install
npx skills add https://github.com/harperaa/secure-claude-skills --skill rate-limiting
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rate-limiting
Source: https://github.com/harperaa/secure-claude-skills/tree/main/rate-limiting
Command: npx skills add https://github.com/harperaa/secure-claude-skills --skill rate-limiting

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill prevents costly security breaches and unexpected infrastructure charges by automatically blocking automated attacks, spam, and resource abuse before they impact your system.

Core Features & Use Cases

  • Brute Force Protection: Stops password guessing attacks by limiting attempts to 5 per minute per IP.
  • Cost Control: Prevents expensive AI API abuse that could cost thousands in minutes.
  • Use Case: Imagine a malicious script trying 10,000 requests on your AI summarization endpoint. This Skill blocks it after just 5 attempts, saving you from $200,000+ in unexpected charges.

Quick Start

Apply rate limiting to protect your contact form endpoint from spam attacks by wrapping your handler with withRateLimit().

Frequently Asked Questions about rate-limiting

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I protect my API endpoints from brute force attacks?

Rate limiting blocks brute force attacks by enforcing a per-IP request budget—typically 5 requests per minute—that automatically rejects excess attempts with an HTTP 429 response. Wrap your endpoint handler with a rate-limit utility to start protecting login, signup, and password reset routes immediately.

Can rate limiting prevent expensive AI API abuse on my endpoints?

Yes. Rate limiting stops resource-intensive operations by capping requests per IP before they accumulate into costly charges. A malicious actor hitting your AI summarization endpoint 10,000 times gets blocked after 5 attempts, preventing thousands in unexpected infrastructure costs.

How do I implement rate limiting across multiple routes like login, signup, and contact forms?

Apply per-IP rate-limit budgets across routes using a helper utility like withRateLimit(). The Skill supports shared 5 requests-per-minute tracking per IP across login, signup, contact forms, newsletters, password resets, file uploads, search, data export, webhooks, and expensive operations with in-memory state management.

Does rate limiting work behind reverse proxies or load balancers?

Yes. Rate limiting can operate behind proxies by reading the x-forwarded-for header to extract the true client IP, ensuring accurate per-IP budgets even when traffic flows through intermediaries. This prevents attackers from bypassing limits by masking their origin.

Can I combine rate limiting with CSRF protection on the same endpoints?

Yes. Rate limiting pairs with CSRF protection to defend endpoints against both automated abuse and cross-site request forgery. Apply both layers independently—rate limiting handles request volume; CSRF protection validates request origin and authenticity.

What happens when a client exceeds the rate limit?

The endpoint responds with HTTP 429 (Too Many Requests), signaling that the client has exceeded its per-IP budget. The client must wait until the budget window resets before retrying, creating a natural throttle against spam and brute force attempts.