Skip to main content
Behavioral-security detection looks beyond a single request to the actor’s behavior over time. The anomaly_detector detector scores each actor (keyed on consumer_id) for bot-like timing, repeated payloads, repeated failures, and abuse spread across collectors.
PropertyValue
Sluganomaly_detector
Categorybehavioral_security
Sidesinput
Protocolsall
Mutable— (detection‑only; enforcement set on the policy rule)
StateStateful — tracks history per consumer_id (Redis)
Because it tracks per-actor state, always pass a stable consumer_id on the guard request (e.g. the authenticated user or API client). Without it, behavioral scoring can’t attribute activity.

How it scores

The detector combines three weighted signals into a single score in [0,1]:
  • Timing pattern — unnaturally regular or rapid request cadence (bot-like).
  • Content similarity — repeated or near-identical payloads (scripted abuse).
  • Cross-collector — the same actor hitting many collectors/keys.
The weights must sum to 1.0. A finding is reported above threshold.

Settings

FieldTypeDefaultNotes
thresholdnumber0.7Score above which the actor is flagged.
retention_periodinteger300Seconds of actor history retained.
min_time_between_requestsinteger1Seconds; faster cadence raises the timing signal.
max_requests_to_analyzeinteger10Sample window size.
max_failuresinteger5Failure count that contributes to the score.
cross_collector_maxinteger5Distinct collectors before cross-collector signal saturates.
timing_pattern_weightnumber0.33Must sum to 1.0
content_similarity_weightnumber0.33…with the other two weights.
cross_collector_weightnumber0.33
The detector reports a finding (signal.type: "anomaly"); the policy rule decides whether that Monitors or Blocks.

When to use

  • Pair with rate limiting at TrustGate — rate limits cap volume, anomaly_detector catches patterns that stay under the cap.
  • Start with the Monitor action and tune the weights/threshold against real traffic before switching the rule to Block, since behavioral signals are probabilistic.
  • Requires a stable consumer_id across requests to be effective.