Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    API Rate Limiting and Brute-Force Protection with 429s

    1

    Add or audit API rate limits: per user, key and route, login and LLM cost limits, spoof-proof client IP, Redis, 429 + Retry-After, tested. PROTECTED / GAPS / WIDE OPEN.

    $5

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    API Rate Limiting and Brute-Force Protection with 429s

    API Rate Limiting and Brute-Force Protection with 429s

    Example session with this skill installed

    Audit rate limiting on our Express API. It runs 3 instances on Render behind Cloudflare. We use express-rate-limit with 100 req / 15 min on everything. There's a /login, /reset-password, and /api/ai/chat that calls OpenAI.

    • Read your context and instructions
    • Compiled the api rate limiting

    Rate limiting: api — VERDICT: WIDE OPEN

    Deployment facts

    Instances: 3 · Proxy chain: Cloudflare → Render → Express · Store: in-memory (default) · Client IP source: req.ip with trust proxy = true

    Gaps found

    #SeverityGapFix
    1Criticaltrust proxy: true trusts any X-Forwarded-For, so a client resets its limit by sending a new fake IP (express-rate-limit warns ERR_ERL_PERMISSIVE_TRUST_PROXY)trust only the real hops; key on CF-Connecting-IP and only accept origin traffic from Cloudflare
    2HighIn-memory store on 3 instances: effective limit is up to 300 per windowrate-limit-redis on the existing Redis
    3High/login shares the global limit; no per-account limit5 tries / 15 min per normalized email + 20 / 15 min per IP
    4High/api/ai/chat has no cost limit50k tokens / user / day budget + 2 concurrent streams
    5Medium/reset-password can email any address 100 times3 / hour per target email
    6Low429 body is plain text and only legacy X-RateLimit-* headers are sentJSON error body + standardHeaders: 'draft-8'

    Limits (proposed)

    ScopeKeyLimitAlgorithmStore downSource
    Globaluser id, else IP300 / minsliding windowfail-open + alertASSUMED, tune from logs
    Loginemail + IP5 / 15 min, 20 / 15 minfixed windowfail-closedASSUMED, common baseline
    Resettarget email3 / hourfixed windowfail-closedyour business rule
    AI chatuser id50k tokens / day, 2 concurrenttoken budgetfail-closedyour OpenAI budget

    Test results

    test/rate-limit.spec.ts: 6/6 pass. Request 6 to /login for one email returns 429 with Retry-After: 893. Changing X-Forwarded-For no longer resets the count. Limit holds across 2 local instances sharing Redis.

    Verdict will move to PROTECTED once gaps 1 to 4 are deployed.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Most APIs have either no rate limit or one that does not work: an in-memory limiter on three instances, a key based on a spoofable X-Forwarded-For, or a single global limit that leaves login, password reset and the LLM endpoint wide open. That is how you get credential stuffing, SMS pumping and a surprise bill.

    This skill gives your coding agent a procedure and a reference file covering the standards (RFC 6585 429, Retry-After, the IETF RateLimit header draft, OWASP API4:2023) and the main libraries. It:

    • Maps every route and tags it: auth, expensive, write, read, webhook
    • Audits what exists: store, key, proxy trust settings, what a blocked client gets, and whether limits run before expensive work
    • Designs layered limits: edge, global per identity, stricter per-route, account-based login/OTP limits, token or money budgets for LLM calls, and concurrency limits
    • Picks the algorithm per limit (token bucket, GCRA, sliding window) and explains why
    • Implements with your framework's maintained library (express-rate-limit, @fastify/rate-limit, NestJS Throttler, Upstash, DRF, Flask-Limiter, Rack::Attack, Laravel, Go) and a shared store
    • Gets the real client IP behind your CDN or load balancer, and groups IPv6 by prefix
    • Returns 429 with Retry-After and RateLimit headers, without revealing whether an account exists
    • Tests it, including a spoofing test and a cross-instance test
    • Returns a limits table and a verdict: PROTECTED, GAPS or WIDE OPEN

    Who it is for: backend developers, SaaS founders and API owners who need limits that hold up, not just a middleware line.

    Safety: asks before adding infrastructure, and marks any limit number it had to assume as ASSUMED so you can tune it from real traffic.

    Honesty note: it only reports tests it actually ran.

    Requires Redis or similar for multi-instance apps. Cannot fix upstream ISP-level DDoS. User must provide traffic metrics for non-assumed limits.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 29 days ago

    Permissions

    Network Access
    Read Files
    Listed29 days ago

    What's inside

    Frequently Asked Questions

    It tags expensive routes such as LLM calls, exports and uploads, and adds limits that match their cost: a token or money budget per user per day and a cap on concurrent requests, not just a request count. It also adds account-based limits on login, password reset and OTP routes, which stops brute force and SMS or email cost abuse.

    The reference file covers Express, Fastify, NestJS, Next.js and edge runtimes (Upstash), Django and DRF, FastAPI, Flask, Rails, Laravel and Go, plus nginx and Cloudflare at the edge, and how to get the real client IP on each. For other stacks your agent applies the same procedure with that framework's maintained rate-limit library.

    A SKILL.md with the audit and implementation procedure and verdict rules, plus a reference file on the standards (429, Retry-After, the IETF RateLimit header draft, OWASP API4:2023), algorithms, client IP settings per stack, library notes and a login/OTP checklist. Your agent produces a limits table, a gap list, the code changes and tests.

    Unlike basic code snippets, this skill addresses production-critical issues like IP spoofing via headers and ensures rate limits are shared across multiple server instances using a distributed store.

    Yes, the skill is designed to implement identity-based limiting, allowing you to set distinct thresholds for different user tiers, API keys, or verified client IPs.

    For a single-instance app, an in-memory store works and the report says so. With more than one instance or serverless functions you need a shared store such as Redis, Valkey, Memcached, your database or the platform's KV store. The skill asks before adding any new infrastructure.

    New in APIs & Backend