Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add tmj-90/gaffer --skill rate-limitinggit clone --depth 1 https://github.com/tmj-90/gafferWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/tmj-90/gaffer/rate-limiting)<a href="https://agentmods.dev/skills/tmj-90/gaffer/rate-limiting"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/rate-limiting/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/tmj-90/gaffer/rate-limiting"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/rate-limiting.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00081 | $0.01426 |
| Opus 5.5 | $0.00032 | $0.00570 |
| Sonnet 5.5 | $0.00016 | $0.00285 |
| Haiku 4.5 | $0.00008 | $0.00143 |
Grade A, and why
rate-limiting scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 16d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 93 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Add rate limiting
A rate limit is a promise about fairness and safety: no single caller can consume the
service, and callers are told how to behave. Decide what you limit (a key), how (an
algorithm), where the counters live (shared, atomic), and what clients see; then test the
boundary exactly, including under concurrent requests. Sources: RFC 6585 (429), RFC
9110 (Retry-After), IETF draft-ietf-httpapi-ratelimit-headers (RateLimit,
RateLimit-Policy), OWASP Authentication and Credential Stuffing Prevention cheat sheets,
Redis documentation on atomic scripts.
Steps
- Name the threat and the key. Credential stuffing, a noisy client, scraping, or a
downstream to protect. The key follows: user id, API key, tenant, IP (weakest: NAT
and IPv6 rotation; use a /64 for IPv6), or a combination. Derive the IP from the
trusted proxy chain only, never a raw client-supplied
X-Forwarded-For. Callsearch_lorefor existing limiter middleware. - Choose the algorithm for the behaviour you want. Token bucket / GCRA: bursts up to capacity, steady refill (most APIs). Sliding-window counter: smooth rate, little memory. Fixed window: simplest, allows 2× bursts at window edges. Concurrency limit (semaphore): protects a downstream's capacity, not a rate. Use the repo's, gateway's or a maintained library's implementation before writing one.
- Share and atomically update the counters. An in-process counter behind a load
balancer is not a limit. Use the shared store with one atomic operation per decision:
a Redis Lua script or
INCRwhose returned value is compared, neverGETthenSET(concurrent requests all read the same value and all pass). Set the TTL in the same atomic step: anINCRfollowed by a separateEXPIREthat fails leaves a key that never expires, locking the caller out forever. Use the store's clock (RedisTIME) so instance clock skew cannot widen the window. - Fail open or closed on purpose. If the store is unavailable: fail open for ordinary reads (availability), fail closed or fall back to a conservative local limit for login, password reset, OTP and costly writes. Put a short timeout on the store call. Comment the decision and test it.
- Tell the client. Reject with
429andRetry-After(seconds). Emit the repo's rate-limit headers; if the repo has none, use the current IETF draft fields,RateLimit-Policy: "default";q=100;w=60andRateLimit: "default";r=42;t=18, on successful responses as well as rejections.Retry-Aftertakes precedence overRateLimit. LegacyX-RateLimit-*headers stay if clients depend on them. Never leak other tenants' identifiers in a partition key. Document it (theopenapi-contractskill). - Throttle authentication without enabling lockout abuse. Limit per account and per source; prefer progressive delays or a challenge over hard account lockout (an attacker can lock a victim out); return the same response whether or not the account exists. Never disable a security limit for convenience.
- Check early and cheaply. Run the limiter before expensive work (body parsing, downstream calls) where the key is available; for authenticated keys, after cheap token validation. Keep key derivation allocation-free.
- Leave a way out. Allow-lists for internal callers, per-tenant overrides in config, and a rejection metric by limit name (not by user id; cardinality) with an alert, so a limit locking out a real customer is seen within minutes.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 16d ago Changed · +29 lines e8ab44985119
- 19d ago First seen · 64 lines · 81 tokens per session scan A b2d04c74c7cf
rate-limiting is a skill published in the GitHub repository tmj-90/gaffer (2 stars, last pushed 17d ago), licensed Apache-2.0. It adds 81 tokens to every session and 1,426 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-28.
Other skills, from other repositories
bulwark-brainstorm
Role-based brainstorming with dual modes: --scoped (sequential Task tool, 5 roles) and --exploratory (Agent Teams peer debate, 4 roles). Use for feasibility assessment and idea validation.
plan-creation
Create structured implementation plans via a 4-role scrum team (Product Owner, Architect, Eng/Delivery Lead, QA/Critic) with optional Agent Teams peer debate mode.
anthropic-validator
Validates Claude Code assets (skills, hooks, agents, commands, MCP servers, plugins) against official Anthropic standards. Fetches latest docs dynamically and produces structured validation reports.
create-subagent
Generates single-purpose Claude Code sub-agents for use via the Task tool. Use when creating dedicated sub-agents, scaffolding agent definitions, or generating agents with diagnostics and permissions setup.
test-audit
Audit test suites for T1-T4 violations using AST analysis, mock detection, and multi-stage synthesis. Invoke when user asks to audit tests, check test quality, find mock violations, review test effectiveness, or inspect test suites for over-mocking. Triggers automatic rewrites when quality gates fail.
code-review
Comprehensive code review with distinct aspect based sections. Use when reviewing code, checking for security issues, finding type safety problems, auditing code quality, or when user asks to review code, PRs or changes. Three-phase workflow runs static tools, LLM judgment, and writes diagnostic log.