Skip to main content

Anomaly Detection

Igris watches live traffic for suspicious patterns and raises an alert when it finds one. There are two independent detectors: one for MCP tool calls and one for LLM gateway calls. Every alert is written to the audit trail, broadcast over SSE, sent to webhooks, and grouped into incidents. Anomaly detection and policies are independent. A call can be allowed by policy and still trigger an anomaly alert. Policies enforce rules; anomaly detection catches unexpected patterns. Detectors only alert. They never block a request.
Detector state (call windows, baselines, cooldowns) is held in memory on each API instance. It resets when the instance restarts.

MCP Detectors

These run on tools/call requests and track activity per session (see Sessions). Denied calls count too.

Rate spike (rate_spike)

Fires when a session makes more than 50 calls within any 60-second window. After an alert, the same session can’t raise another rate spike for 5 minutes. Severity: high.

Destructive pattern (destructive_pattern)

Counts calls whose tool name starts with one of these prefixes:
  • delete_
  • drop_
  • rm_
  • remove_
  • destroy_
Fires when a session reaches 5 matching calls. There is no time window on this count. It resets after an alert, and the session can’t raise another destructive-pattern alert for 10 minutes (matching calls during that time are still counted). Severity: critical. The thresholds, window, and patterns are fixed. They can’t be changed per organization.

LLM Detectors

These run after each LLM gateway call. State is kept per connection and, when the request carries a user (X-Igris-User), per user on that connection, so one caller’s baseline isn’t mixed with everyone else’s. error_rate only counts streamed responses that fail partway through. Upstream HTTP errors (non-2xx) are returned to the caller before the detector runs and are not counted. If one call trips several checks, only the first alert is raised, in the order of the table above. The LLM detector has no cooldown, so a condition that persists can alert on every call. Incident clustering keeps these from flooding your inbox. The thresholds are fixed defaults. The hosted service doesn’t expose per-connection tuning.

What an Alert Does

When either detector fires, Igris:
  1. Writes an audit event of type anomaly. details.alertType holds the anomaly type (rate_spike, destructive_pattern, cost_spike, and so on), plus a human-readable message and context such as the call count, window cost, or model. MCP alerts also carry the tool name and session ID.
  2. Broadcasts an SSE event to dashboards in your organization: anomaly for MCP alerts, llm_anomaly for LLM alerts. See Real-time events.
  3. Sends the Anomaly Detections webhook to webhooks subscribed to it, with the alert message as the reason.

Incidents

Anomaly audit events are grouped into incidents. The grouping key includes the anomaly type, so a rate_spike and a cost_spike on the same connection become two separate incidents instead of one. Incidents that are still open or investigating and have had no new events for 7 days are resolved automatically with the note “Auto-resolved after 7 days of inactivity”. The sweep runs once a day (04:00 UTC by default), so an incident may stay open a few hours past the 7-day mark. Viewing incidents needs alerts:read. Triaging them (investigate, resolve, reopen, change severity) needs alerts:manage, which Owner, Admin, and CISO roles have by default. See Permissions.

Viewing Anomalies

  • Incidents — anomaly alerts are grouped into incidents
  • Observe dashboard — risk heat map highlights connections with recent anomalies
  • Audit trail — filter by type anomaly to see every alert
  • Policies — rule-based allow/deny/alert/redact governance
  • Sessions — session lifecycle and kill switch
  • Incidents — how alerts are grouped and triaged
  • Tool Calls — how tool calls are logged and audited