Skip to main content

Module rate_limit

Module rate_limit 

Source
Expand description

Keyed sliding-window rate limiter (WEFT-148).

Used for DoS protection on:

Thresholds are fully configurable via RateLimitConfig. A limit of 0 disables enforcement (always allow).

Structs§

KeyedRateLimiter
Thread-safe sliding-window rate limiter keyed by an arbitrary string (source address, principal / agent id, etc.).
RateLimitConfig
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).