> ## Documentation Index
> Fetch the complete documentation index at: https://docs.meshai.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Anomalies

> List, inspect, acknowledge, and resolve anomalies detected by MeshAI

MeshAI's ML engine runs four detection algorithms every 5 minutes: cost spikes, reliability decay, behavioral drift, and security threats. Detected anomalies are surfaced via the SDK and dashboard.

## list\_anomalies()

List anomalies for your tenant, optionally filtered by status, type, or agent.

```python theme={null}
anomalies = client.list_anomalies(
    status="open",
    anomaly_type="cost_spike",
    agent_id="agt_abc123",
    limit=20,
)
```

<ParamField path="status" type="string">
  Filter by status: `open`, `acknowledged`, `resolved`
</ParamField>

<ParamField path="anomaly_type" type="string">
  Filter by type: `cost_spike`, `reliability_decay`, `behavioral_drift`, `security_threat`
</ParamField>

<ParamField path="agent_id" type="string">
  Filter by agent ID
</ParamField>

<ParamField path="limit" type="integer" default="20">
  Results per page
</ParamField>

<ParamField path="offset" type="integer" default="0">
  Results to skip
</ParamField>

**Returns**:

```json theme={null}
[
  {
    "id": 12345,
    "agent_id": "agt_xyz789",
    "agent_name": "production-summarizer",
    "anomaly_type": "cost_spike",
    "severity": "high",
    "status": "open",
    "description": "Token spend increased 340% vs 7-day average",
    "detected_at": "2026-03-17T09:45:00Z",
    "details": {
      "current_cost_usd": 45.20,
      "baseline_cost_usd": 10.30,
      "deviation_percent": 338.8
    }
  }
]
```

## get\_anomaly()

Get a single anomaly by ID.

```python theme={null}
anomaly = client.get_anomaly(12345)
```

<ParamField path="event_id" type="integer" required>
  Anomaly event ID
</ParamField>

## acknowledge\_anomaly()

Mark an anomaly as acknowledged. This indicates a human has reviewed it.

```python theme={null}
client.acknowledge_anomaly(12345)
```

<ParamField path="event_id" type="integer" required>
  Anomaly event ID
</ParamField>

## resolve\_anomaly()

Mark an anomaly as resolved.

```python theme={null}
client.resolve_anomaly(12345)
```

<ParamField path="event_id" type="integer" required>
  Anomaly event ID
</ParamField>

## get\_anomaly\_summary()

Get a summary of anomaly counts by type and status.

```python theme={null}
summary = client.get_anomaly_summary()
```

**Returns**:

```json theme={null}
{
  "total": 12,
  "by_status": {
    "open": 3,
    "acknowledged": 5,
    "resolved": 4
  },
  "by_type": {
    "cost_spike": 6,
    "reliability_decay": 3,
    "behavioral_drift": 2,
    "security_threat": 1
  }
}
```
