Overview
Theanomalies client provides automated anomaly detection for your authorization system. It identifies unusual patterns such as rate spikes, high failure rates, new principals, and off-hours activity.
Access the anomalies client via client.anomalies.
Detect
Run anomaly detection across all agents and return any detected anomalies:DetectAnomaliesResponse
| Field | Type | Description |
|---|---|---|
detected_at | str | ISO 8601 timestamp of the detection run. |
total | int | Number of anomalies detected. |
anomalies | tuple[Anomaly, ...] | The detected anomalies. |
List
List stored anomalies. Optionally filter to show only unacknowledged anomalies:Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
unacknowledged | bool | No | False | If True, only return unacknowledged anomalies. |
ListAnomaliesResponse
| Field | Type | Description |
|---|---|---|
anomalies | tuple[Anomaly, ...] | The list of anomalies. |
total | int | Total number of anomalies. |
Acknowledge
Acknowledge an anomaly to mark it as reviewed:Anomaly with the acknowledged_at timestamp set.
Anomaly Type
TheAnomaly frozen dataclass has the following fields:
| Field | Type | Description |
|---|---|---|
id | str | Unique anomaly identifier. |
type | str | The anomaly type (see table below). |
severity | str | "low", "medium", or "high". |
agent_id | str | None | The agent involved (if applicable). |
principal_id | str | None | The principal involved (if applicable). |
description | str | Human-readable description of the anomaly. |
metadata | dict[str, Any] | Additional data about the anomaly. |
detected_at | str | ISO 8601 timestamp when the anomaly was detected. |
acknowledged_at | str | None | ISO 8601 timestamp when the anomaly was acknowledged (or None). |
Anomaly Types
| Type | Description |
|---|---|
rate_spike | Unusual spike in authorization or token requests. |
high_failure_rate | Abnormally high rate of failed actions. |
new_principal | A previously unseen principal is being used. |
off_hours_activity | Authorization activity outside normal hours. |