Expand description
Keyed sliding-window rate limiter (WEFT-148).
Used for DoS protection on:
crate::cluster::ClusterMembership::add_peer— per sourcecrate::governance::GovernanceEngine::evaluate— per principal
Thresholds are fully configurable via RateLimitConfig. A limit of
0 disables enforcement (always allow).
Structs§
- Keyed
Rate Limiter - Thread-safe sliding-window rate limiter keyed by an arbitrary string (source address, principal / agent id, etc.).
- Rate
Limit Config - Configuration for a keyed rate limiter.
Constants§
- DEFAULT_
GOVERNANCE_ EVAL_ RATE - Default governance-evaluation limit: 256 evaluations per principal per second. High enough for normal agent tool loops; low enough to stop a flood from a single principal.
- DEFAULT_
PEER_ ADD_ RATE - Default peer-add limit: 1 addition per source per 100 ms (preserves the pre-WEFT-148 aggressiveness, but keyed per source).