A graduated response ladder where every rung is invisible
Detection produces a number. Something has to turn that number into a response, and the response has two hard constraints that pull against each other: It must be proportionate . A score of 55 is not a score of 95, and treating them the same means either blocking clients you shouldn't or serving attackers you shouldn't. It must be invisible . An attacker who learns they were detected changes tactics, and you've converted a detection into a training signal for them. The second constraint rules out most of the obvious implementations of the first. The ladder Six tiers, evaluated in Rego, driven by the pushed risk score plus the gateway's own fast-path signals: allow → log → throttle → step_up → deny → revoke The policy is small enough to read in full, and mirrors the scorer's thresholds exactly: score_tier := "deny" if { score_fresh ; score_entry . score >= 85 } score_tier := "step_up" if { score_fresh ; score_entry . score >= 70 ; score_entry . score < 85 } score_tier := "throttle" if { score_fresh ; score_entry . score >= 50 ; score_entry . score < 70 } score_tier := "log" if { score_fresh ; score_entry . score >= 30 ; score_entry . score < 50 } final_tier := fast_tier if { tier_rank [ fast_tier ] >= tier_rank [ score_tier ] } final_tier := score_tier if { tier_rank [ score_tier ] > tier_rank [ fast_tier ] } The final decision is the more severe of two independent signals: the scorer's composite, and the gateway's own sub-second guardrails. The second exists because windowed scoring cannot react faster than one window, and a flood needs stopping before then. Fail open, deliberately # FAIL-OPEN: when the risk-score data is missing or stale we allow (with a # logged reason) rather than deny. This is the choice most likely to get an argument, so here's the reasoning. This is a detection layer bolted onto a production API. If the scorer, the pipeline, or the data path between them breaks, failing closed takes the real API down for every legitimate integration — a self-i