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

# Anomalies

> Detect and manage security anomalies

## Detect

Published `v0.4.1` includes `client.Anomalies.GetResponsePolicy(ctx)` and
`SetResponsePolicy(ctx, "alert_only")`. These are account-wide and require the
default-off server setting `IRREGULARITY_RESPONSE_POLICY_ENABLED=true`.
Earlier tags do not include these methods. Alert-only stops
automatic revocation by this detector, not independent controls.

Trigger anomaly detection and get results.

```go theme={null}
result, err := client.Anomalies.Detect(ctx)
fmt.Printf("Found %d anomalies\n", result.Total)
fmt.Printf("Mode %s, revoked %d grants\n", result.ResponseMode, result.AutoRevokedGrants)
for _, a := range result.Anomalies {
    fmt.Printf("[%s] %s: %s\n", a.Severity, a.Type, a.Description)
}
```

## List

```go theme={null}
// All anomalies
result, err := client.Anomalies.List(ctx, nil)

// Only unacknowledged
unack := true
result, err := client.Anomalies.List(ctx, &grantex.ListAnomaliesParams{
    Unacknowledged: &unack,
})
```

## Acknowledge

```go theme={null}
anomaly, err := client.Anomalies.Acknowledge(ctx, "anomaly-id")
fmt.Printf("Acknowledged at: %s\n", *anomaly.AcknowledgedAt)
```

## Anomaly Types

| Type | Description |
| - | - |
| `rate_spike` | Unusual request rate |
| `high_failure_rate` | High action failure rate |
| `new_principal` | Activity from new user |
| `off_hours_activity` | Activity outside business hours |

## Severity Levels

| Level | Description |
| - | - |
| `low` | Informational |
| `medium` | Requires attention |
| `high` | Requires immediate action |

## Ownership

Grantex is owned by Orchestrum Technologies LLP. Inventor and owner: Sanjeev Kumar. Ownership contact: [sanjeev@orchestrum.in](mailto:sanjeev@orchestrum.in) or [mishra.sanjeev@gmail.com](mailto:mishra.sanjeev@gmail.com).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.