Overview
AgentDoor provides three layers of protection:- Rate Limiting - Token bucket algorithm for request throttling
- Reputation System - Behavioral scoring and access gates
- Spending Caps - Per-agent budget limits
Rate Limiting
Token Bucket Algorithm
AgentDoor uses a token bucket rate limiter with continuous refill:Rate Limit Configuration
Per-Scope Rate Limits
Per-Agent Rate Limits
Override rate limits for specific agents:Window Formats
Rate Limit Response
Advanced Usage
Consume Multiple Tokens
Peek Without Consuming
Reset Rate Limit
Reputation System
Track agent behavior and gate access based on reputation scores.Configuration
Event Types
Usage
Reputation Gates
Block Access
Warning Mode
Bulk Score Updates
Custom Weights
Spending Caps
Enforce daily and monthly spending limits per agent.Configuration
Cap Types
- Hard Cap (
type: "hard"): Blocks requests when exceeded (returns 402 Payment Required) - Soft Cap (
type: "soft"): Sends warning header but allows requests
Usage
Check Result
Per-Agent Custom Caps
Get Spending History
Reset Spending
Cleanup
Combined Protection Strategy
Use all three layers together for comprehensive protection:Monitoring
Rate Limit Metrics
Reputation Metrics
Spending Metrics
Best Practices
- Start conservative: Begin with tight limits and relax based on agent behavior
- Monitor metrics: Track rate limit hits, reputation changes, and spending patterns
- Use graduated limits: Different limits for different scopes
- Implement appeals: Allow agents to contest suspensions
- Log events: Record all reputation events for audit trails
- Cleanup regularly: Run periodic cleanup jobs for expired records
- Test limits: Verify limits work as expected before production