Per-endpoint rate limits are too restrictive for AI agent workflows and not configurable #12224
ian-vannman
started this conversation in
Ideas
Replies: 1 comment
|
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem
Outline's per-endpoint rate limits are hard-coded in the route definitions and cannot be adjusted by self-hosted operators. The global rate limiter has environment variables (
RATE_LIMITER_REQUESTS,RATE_LIMITER_DURATION_WINDOW), but per-endpoint overrides ignore these and use fixed values fromRateLimiterStrategy.This is increasingly a problem as AI agents become a primary API consumer — a use case Outline is actively embracing with the built-in MCP server (v1.6.0). A single logical agent operation like "review a document and post feedback" can involve a burst of API calls that exceeds these limits. For example,
comments.createis capped at 10 requests per minute. An agent posting 11 comments on a document review hits 429 on the 11th call. The MCP endpoint itself allows 1,000 requests/hour, but the underlying API routes it calls have their own stricter limits — so the MCP rate limit is misleading.This was also raised in Discussion #6458 where a user building a static site generator hit 429s and noted the limits felt very low.
Current behavior
Per-route rate limits are defined in code with no way to override them:
The strategies in
RateLimiterStrategyare also fixed constants — there's no mechanism to adjust them.Meanwhile, the global defaults are configurable:
But these only apply to routes that don't have a per-endpoint override — which is most of the write endpoints.
Affected endpoints (agent-relevant subset)
comments.createdocuments.createdocuments.updateattachments.createcollections.createProposal
Allow self-hosted operators to override per-endpoint rate limits via environment variables, without needing to fork the codebase. Two possible approaches:
Option A: Per-endpoint env var overrides
Follow the existing naming convention with endpoint-specific variables:
The
rateLimiter()middleware would check for an env override before falling back to the hard-coded strategy.Option B: Multiplier for API-key / MCP-authenticated requests
Recognize that agent traffic has different burst characteristics than interactive use. Apply a configurable multiplier to rate limits when the request is authenticated via API key or MCP token:
This would give
comments.createan effective limit of 100/min for API consumers while keeping the interactive limit at 10/min.Context
We're a team running self-hosted Outline as a knowledge base with AI agents (Claude via MCP) as first-class participants — reading, editing, and commenting on documents. The agent workflow involves structured document reviews where Claude reads a document and posts multiple targeted comments, which is exactly the kind of burst that hits the
comments.createlimit. We expect this pattern to become more common as the MCP server adoption grows.Workarounds (current)
RATE_LIMITER_ENABLED=false— disables all rate limiting, which is too broadRateLimiterStrategyconstants — works but creates a maintenance burdenNone of these are great for production use.
All reactions