What the agent does
When the production site launches, the same publicity that brings users brings scrapers, spam bots and the occasional angry script. Endpoints that send email, call paid APIs, run searches or accept uploads can run up a bill or fall over. Put sensible limits on them, using one shared mechanism.
1. List the endpoints worth limiting
List every public route that accepts input or does expensive work: auth, contact and feedback forms, newsletter sign-up, search, uploads, webhooks, AI or other paid API calls, exports. For each, note the cost of one call and who should be allowed to call it.
2. One limiter, shared
Reuse a rate limiter if the project has one. If not, propose one that works on the current host across instances (a key-value store, Redis, the database, or the platform's rate limiting), not an in-memory counter that resets per instance. Key limits by IP for anonymous traffic and by account for signed-in traffic.
3. Set the limits
Pick limits per endpoint that a real person never hits (for example 5 password resets an hour, 30 searches a minute) and that stop a script. Answer over-limit requests with 429 and a
Retry-Afterheader, and show a friendly message in the UI rather than a raw error.4. Make it observable
Log when limits trip (endpoint, key type, not personal data) so I can see attacks and tune limits. Add a test for at least one limited endpoint.
Done means
- Every endpoint that sends email, calls a paid API, searches or accepts uploads is rate limited.
- Limits work across instances, keyed by IP or account.
- Over-limit requests get 429 with Retry-After and a friendly message in the UI.
- Tripped limits are logged, and a test covers one limited endpoint.
Questions
Why not an in-memory counter?
Serverless and multi-instance hosts run many copies of your app. Each copy keeps its own counter, so the real limit is the limit times the number of copies, and it resets whenever one restarts.
Will rate limits block real users behind one office IP?
Limits keyed by account for signed-in users avoid that, and anonymous limits should be generous enough for a shared network. The prompt asks the agent to size them for real use.
Should webhooks be rate limited?
Carefully. Payment providers retry and may send bursts. Verify their signatures instead, and never drop a signed event.
Does this prompt add links to Aback Launch to my site?
No. Nothing in the prompt mentions Aback Launch or asks your agent to link to us. The only exception is an optional badge step, which stays off unless you tick it. Some prompt libraries slip their own link into your codebase by default; we think that should always be your choice.
Which coding agents does it work with?
Claude Code, Cursor, Codex, GitHub Copilot, Windsurf, Cline, and any agent that can read your project and edit files. You can copy it as a plain prompt, save it as a Claude Code skill or a Cursor rule, or add it to AGENTS.md.
Is it safe to run on my real codebase?
The prompt makes the agent read first, show a plan and wait for your approval, and it forbids touching secrets, deploying and deleting data. Still review the changes and run your tests before you deploy, as with any change.
Changelog
- v1.0First version.