QUESTPIE Autopilot
Security

Rate Limiting

Three-layer rate limiting architecture protecting QUESTPIE Autopilot API endpoints.

QUESTPIE Autopilot uses a three-layer rate limiting architecture to protect against abuse while keeping agent workflows unthrottled.

Architecture

LayerScopeWhereLimitStorage
1 — AuthLogin/signup endpointsBetter Auth plugin30 req/min global, 10/5min login, 5/5min signupIn-memory
2 — IPAll API endpointsHono middleware (before auth)20 req/min per IPSQLite
3 — ActorAuthenticated endpointsHono middleware (after auth)Per-actor, per-endpointSQLite

Per-Actor Limits (Layer 3)

Actor TypeEndpointLimitKey
Agent (type: agent)AllExempt
Webhook (source: webhook)AllExempt
Human/api/search*10/minactor:{id}:/api/search
Human/api/chat*20/minactor:{id}:/api/chat
HumanEverything else300/minactor:{id}

Agents and webhooks are exempt from actor-level rate limiting to avoid blocking automated workflows.

Response Headers

Every API response includes standard rate limit headers:

X-RateLimit-Limit: 300
X-RateLimit-Remaining: 287
X-RateLimit-Reset: 1711234567
HeaderDescription
X-RateLimit-LimitMaximum requests allowed in the window
X-RateLimit-RemainingRequests remaining in the current window
X-RateLimit-ResetUnix timestamp when the window resets

When the limit is exceeded, the API returns 429 Too Many Requests:

{ "error": "Rate limit exceeded" }

Exempt Paths

The following paths are exempt from IP rate limiting:

  • /hooks/* — Webhook endpoints (external services like GitHub, Slack)
  • /api/status — Health check endpoint

SQLite Storage

Rate limit counters are stored in a rate_limit_entries SQLite table with sliding window semantics. Expired entries are cleaned up automatically every 5 minutes.

This approach ensures rate limits persist across process restarts and work correctly in single-instance deployments.

On this page