Skip to main content

add-api-rate-limiting

Add API rate limits that protect constrained outcomes while preserving legitimate bursts and recovery. Use when traffic can exhaust capacity, amplify abuse, or unfairly consume a shared service.

Informations de source

Dépôt
protosphinx/sphinxstack
Dernière activité de la source
29 juillet 2026 à 13:55
Langue détectée de SKILL.md
anglais
Étoiles
2
Forks
0

Options d'installation

Le prompt qui vérifie d'abord la source est sélectionné par défaut. Vous pouvez passer à une commande directe ou télécharger une copie locale.

Vérifiez les fichiers source

Lisez SKILL.md et les fichiers associés affichés par SkillsMP avant de décider de l'installer.

Explorateur de fichiers
2 fichiers

Affichage de SKILL.md

SKILL.md
Instructions source · Aperçu en lecture seule
name
add-api-rate-limiting
category
code
description
Add API rate limits that protect constrained outcomes while preserving legitimate bursts and recovery. Use when traffic can exhaust capacity, amplify abuse, or unfairly consume a shared service.
# add-api-rate-limiting Limit the scarce operation at the narrowest trustworthy identity and scope. ## Procedure 1. Define the protected resource, abuse case, acceptable burst, sustained rate, and recovery objective. 2. Select trustworthy dimensions such as account, tenant, credential, operation, destination, and network signal. 3. Choose a token bucket, fixed window, sliding window, or concurrency limit from the actual traffic behavior. 4. Store counters atomically across serving instances and define clock and regional consistency assumptions. 5. Return a stable `429` response with safe retry guidance and useful quota headers. 6. Separate authentication, expensive-operation, global safety, and contractual quota layers. 7. Define narrowly owned exemptions, degraded behavior, and fail-open or fail-closed choices. 8. Instrument allowed, limited, delayed, rejected, and exempted requests by policy version. 9. Load-test bursts, sustained use, distributed concurrency, counter outage, and legitimate shared networks. 10. Review false positives and capacity after launch and adjust with evidence. ## Guardrails - Do not identify a person solely by IP address. - Avoid an unbounded external counter lookup on the protected request path. - Never promise an exact quota when the chosen distributed algorithm is intentionally approximate. ## Done - A versioned limit policy records scope, algorithm, thresholds, and failure mode - Load and failure tests verify protection and recovery behavior - Limit decisions reconcile with traffic, capacity, and false-positive metrics
Voir sur GitHub