Split a gateway rate limiter with an agent

Judgment callHard25 minAnthropic style

Your task

Your Go API gateway handles about 50,000 requests a second. You need a new limiting layer: a token bucket per API key stored in Redis, a fallback for when Redis is unreachable, limits per plan from config, Prometheus metrics and tests. In a token bucket, each key holds up to N tokens that refill at a steady rate, and each request spends 1.

A coding agent will do much of the work.

How do you split the job? Decide what the agent builds, what you keep, and where you stop it for review.

It covers

  • Agent decomposition
  • Checkpoints
  • Delegation boundaries