In short.
Rate Limiting and Security is a reusable skill for coding assistants and API developers, but its examples need security and integration fixes before deployment. It explains rate-limit algorithms, client retry information, input validation, authorization, CORS and webhook signing. Concrete problems include shared counters between Express rate-limit policies, a Python body-size check that relies on Content-Length, and client-supplied admin roles without an authorization gate. Nothing was executed; runtime correctness, performance and dependency compatibility remain unverified.
Researched and written by an AI model and checked by a second AI model. How it works
Coverage includes the complete supplied skill folder: SKILL.md, examples/input-validation-middleware.md and examples/sliding-window-rate-limiter.md, plus the repository-root LICENSE, all at commit 182a2e1e6033cbcd2dd086a1d6bcee956dc901f6. Other repository content, imported dependency source and external references are outside this evidence. No code was executed. Runtime behavior, assistant loading, deployment integration, concurrency, performance and security outcomes remain unverified.
The overview
Identity
This resource is the rate-limiting-and-security skill in oborchers/fractional-cto, under api-design-principles/skills. SKILL.md declares version 1.0.0 and contains reusable assistant instructions, explanations and a review checklist. Two accompanying Markdown files contain implementation examples. It is an instruction package with code examples, rather than an installable middleware library.
The original folder is [https://github.com/oborchers/fractional-cto/tree/main/api-design-principles/skills/rate-limiting-and-security]. The supplied files are pinned to commit 182a2e1e6033cbcd2dd086a1d6bcee956dc901f6; the main-branch address can change.
Assessment
The strongest feature is the connection between explanations and concrete code: readers can follow how request budgets become response headers, how excess traffic produces a 429 response, and how schemas reject unexpected input. The guide also separates authentication from permission to access a particular resource.
Use it as a learning and implementation aid with engineering review. Descriptions such as complete implementations and protection against mass assignment overstate what the examples establish: authorization is absent, and several implementation details contradict the accompanying explanations. No execution results or benchmarks are supplied.
Users
The skill suits developers asking a coding assistant to design or review API protection. Beginners get explanations of algorithms, headers and common vulnerabilities. Experienced developers get middleware patterns and a checklist to compare with their own architecture.
The examples are most directly relevant to Express and FastAPI applications using Redis. Readers still need enough backend knowledge to integrate authentication, permissions, trusted proxy settings, error handling and deployment controls. It cannot establish an API's security by itself.
Capabilities
The guide compares fixed windows, sliding-window logs, weighted sliding-window counters, token buckets and leaky buckets. It covers rate-limit headers, structured 429 errors, retry backoff, endpoint and customer-tier policies, the OWASP API Security Top 10 from 2023, CORS, HTTPS, webhook signatures and IP allowlisting.
The supplied code implements weighted Redis counters and request-validation patterns in two frameworks. Validation examples include strict body schemas, string limits, pagination bounds, prefixed identifiers and structured errors. Other topics, including webhook signing and authorization, are guidance rather than complete implementations in these files.
Using it
Requirements
The Express examples use TypeScript, Express, Zod and ioredis. The Python examples use FastAPI, Starlette, Pydantic and redis.asyncio; the validation code uses field_validator, model_config and model_dump APIs. Running either limiter requires a reachable Redis service. Exact compatible dependency versions, lockfiles and runtime requirements are not supplied.
Assistant-specific installation requirements are unknown. The files do not name a supported assistant host or provide its installation procedure. Application authentication, permissions, TLS termination and infrastructure-level request limits must be supplied separately.
Mechanism
The limiter estimates recent traffic using the previous window's count multiplied by its remaining weight, plus the current window's count. It rounds down the weighted previous count. Redis stores the counters with expiry after two window periods, avoiding a timestamp for every request. This is an approximation of a rolling request count.
Each check increments the current counter before deciding whether to allow the request, so rejected attempts also increase it. The middleware identifies clients using x-api-key when present, otherwise an IP address, and returns budget headers or a rejection. The calculated reset time is the next fixed window boundary, rather than a calculation of when the weighted count will permit another request.
Setup
Acquire SKILL.md together with its examples directory so the relative references remain usable, and retain the licence notice. Use the chosen assistant's documented skill-loading procedure; no host-specific command is established by these files.
For application integration, configure Redis and compatible dependencies, then adapt the examples to authenticated identities and distinct policy keys. The Express examples create routers but export only helper functions. The validation example mentions express.json with a body limit only in a comment; application initialization, router integration and parser configuration remain necessary. The Python limiter uses a localhost Redis URL that must match the deployment.
Example
The limiter walkthrough uses 84 requests in the previous minute and 36 in the current minute, 15 seconds into that minute. Its estimate is 84 × 0.75 + 36 = 99, below the example limit of 100. This illustrates the arithmetic; it is not a measured throughput result.
The validation examples allow user names and email addresses while rejecting unexpected body fields such as is_admin. However, role is an explicitly allowed creation field, including admin, so rejecting unknown fields does not restrict who may assign privileges. The pagination prose also says excessive limits are clamped to 100, while both implementations reject values above 100.
Assessment & evidence
Limitations
The Express global and export-specific limiters use the same Redis key structure without a policy or route identifier. An export request that passes the global check increments the same counter again at the endpoint check, and other requests contribute to the supposed export budget. The FastAPI endpoint limiter uses a separate path key, but its rejection body uses a detail envelope and omits endpoint-specific limit, remaining and reset_at fields; outer middleware supplies global-budget headers.
Both limiter examples accept the supplied x-api-key string as the bucket identity without validating it. Unless integration first binds it to an authenticated identity, changing that string selects a different bucket. Redis operations are pipelined without an atomic transaction or script, and no explicit Redis-outage policy is supplied. Concurrency and failure behavior are unverified.
The Python body-size middleware checks Content-Length rather than counting received bytes, leaving bodies without that header unbounded by this check. Invalid path IDs raise ValueError inside the route, outside the supplied RequestValidationError handler. Both creation examples accept role=admin without showing authorization. These findings follow from the code; runtime failures were not reproduced.
The guide's provider quotas, claims about widespread algorithm adoption and unspecified IETF header draft are not independently substantiated by the supplied files. Their current accuracy is unknown. No tests, benchmarks or dependency pins are included in the supplied folder.
Fit and tradeoffs
This resource fits work that needs understandable explanations and a starting point for API protection. Its paired framework examples make the concepts concrete, while the checklist broadens attention beyond throttling to permissions and input handling.
Its main tradeoff is the engineering work required to turn examples into dependable enforcement. Strict schemas establish accepted input shapes, but do not establish permission to set an allowed field. Likewise, weighted counters estimate traffic, but do not prove a strict rolling-window guarantee. Keep those distinctions when adapting the guidance.
Alternatives
The guide itself describes alternative algorithms: fixed windows for simplicity, timestamp logs for exact request tracking, token buckets for controlled bursts and leaky buckets for smoothing traffic. Its weighted counter uses less state than a timestamp log, with approximate accounting. No competing skill, middleware package or gateway is evaluated in the supplied evidence, so comparative reliability and operating cost are unknown.
Evidence
The original instruction file is [https://raw.githubusercontent.com/oborchers/fractional-cto/182a2e1e6033cbcd2dd086a1d6bcee956dc901f6/api-design-principles/skills/rate-limiting-and-security/SKILL.md]. The validation example is [https://raw.githubusercontent.com/oborchers/fractional-cto/182a2e1e6033cbcd2dd086a1d6bcee956dc901f6/api-design-principles/skills/rate-limiting-and-security/examples/input-validation-middleware.md], and the limiter example is [https://raw.githubusercontent.com/oborchers/fractional-cto/182a2e1e6033cbcd2dd086a1d6bcee956dc901f6/api-design-principles/skills/rate-limiting-and-security/examples/sliding-window-rate-limiter.md].
The applicable supplied notice is [https://raw.githubusercontent.com/oborchers/fractional-cto/182a2e1e6033cbcd2dd086a1d6bcee956dc901f6/LICENSE]. These files establish the documented design and visible code, not successful integration, measured performance or verified security outcomes. Nothing was executed.
Access & freshness
Costs
The MIT licence grants permission without a licence fee. No subscription price, paid support price or operating-cost estimate is supplied. Redis, application hosting and any assistant usage can have costs that depend on the chosen deployment; amounts are unknown. The guide's Free, Starter, Pro and Enterprise limits are illustrative API policies, not prices or plans for this resource.
Rights
The supplied repository-root MIT licence names Dr. Oliver Borchers as copyright holder for 2026. It permits use, modification, redistribution, sublicensing and sale, provided the copyright and permission notices accompany copies or substantial portions. It provides no warranty. No narrower licence notice is supplied for the skill folder. Licences for imported dependencies are not included in this evidence.
Freshness
SKILL.md declares version 1.0.0. The supplied snapshot was captured on 16 November 2026 at commit 182a2e1e6033cbcd2dd086a1d6bcee956dc901f6; that capture date does not establish a release date. The guide references the 2023 OWASP API list and an unspecified IETF RateLimit draft. Current standards alignment, provider quotas and compatibility with current dependencies are unknown.
Before deployment
Separate Redis counters by policy, derive client identities from validated authentication and define behavior when Redis fails. Make endpoint rejection bodies and headers describe the same budget. Check whether Retry-After remains useful after heavy rejected traffic, because rejected attempts increase counters and the advertised boundary may arrive before capacity becomes available.
Restrict role assignment through authorization, enforce body limits against actual received bytes and convert invalid path IDs into deliberate client errors. Then verify these changes with framework integration checks, concurrent traffic, malformed requests and Redis failures. Confirm dependency compatibility and current header guidance before deployment; none of those outcomes is established here.
