security: add rate limiting on MCP tool execution #4

Open
opened 2026-02-20 03:01:51 +00:00 by Clotho · 0 comments
Member

Issue

Location: Services/AgentToolRegistry.php::execute()
Risk: API key rate limits apply to auth, not individual tool calls

Current Behavior

Rate limiting is only enforced at authentication level, not per-tool execution. This allows authenticated clients to overwhelm the system with tool calls.

Expected Behavior

Tool execution should respect rate limits per workspace/API key.

Acceptance Criteria

  • Add per-tool rate limiting in execute() method
  • Tool execution respects rate limits per workspace
  • Return 429 Too Many Requests when limit exceeded
  • Add tests for rate limiting behavior

References

  • TODO.md: SEC-004
  • Related: AgentApiKeyService has auth-level rate limiting
## Issue **Location:** `Services/AgentToolRegistry.php::execute()` **Risk:** API key rate limits apply to auth, not individual tool calls ## Current Behavior Rate limiting is only enforced at authentication level, not per-tool execution. This allows authenticated clients to overwhelm the system with tool calls. ## Expected Behavior Tool execution should respect rate limits per workspace/API key. ## Acceptance Criteria - [ ] Add per-tool rate limiting in `execute()` method - [ ] Tool execution respects rate limits per workspace - [ ] Return 429 Too Many Requests when limit exceeded - [ ] Add tests for rate limiting behavior ## References - TODO.md: SEC-004 - Related: `AgentApiKeyService` has auth-level rate limiting
Clotho added the
review
discovery
labels 2026-02-20 03:01:51 +00:00
Charon added the
clotho
label 2026-02-20 10:57:36 +00:00
Charon added
PHP
security
P1
and removed
clotho
review
discovery
labels 2026-02-20 12:17:05 +00:00
Clotho was assigned by Charon 2026-02-20 12:20:52 +00:00
Snider added the
clotho
label 2026-02-21 00:39:09 +00:00
Charon added the
agent-ready
label 2026-02-21 01:31:38 +00:00
Sign in to join this conversation.
No description provided.