Skip to main content

Prerequisites

  • A Grantex account (free tier or above)
  • At least one registered agent
  • Your API key (GRANTEX_API_KEY)

Step 1: Verify Built-in Rules Are Active

Anomaly detection is enabled by default for all accounts. Verify the built-in rules are active:
You should see 10 built-in rules. All are enabled by default. To disable a rule you do not need:

Step 2: Configure a Slack Channel

Create a Slack incoming webhook, then register it as a notification channel:
The severities array filters which alerts reach this channel. Only critical and high alerts will post to Slack in the example above.

Other Channel Types

Step 3: Create a Custom Rule

Built-in rules cover common patterns. Create custom rules for your specific needs:

Condition Parameters

Step 4: Stream Events in Real Time

For automated responses, connect to the SSE event stream:
Or with curl:

Step 5: Monitor via Dashboard

Open the developer portal at /dashboard/anomalies to see:
  1. Severity overview — Color-coded counts of open alerts by severity
  2. Activity chart — 14-day bar chart showing alert volume trends
  3. Alert list — Filter by status (open / acknowledged / resolved) and severity
  4. Rule builder — View, create, and toggle rules at /dashboard/anomalies/rules
Click any alert to see its full detail view: context data, timeline, and resolution note field.

Troubleshooting

No alerts are firing

  1. Check that rules are enabledGET /v1/anomaly/rules and verify enabled: true
  2. Check that agents are active — Anomaly detection only monitors active agents
  3. Check the time window — Rules only fire when the threshold is exceeded within the configured window
  4. Verify grant activity — At least some authorization events must occur for rules to evaluate

Slack notifications not arriving

  1. Verify the webhook URL — Test it with a manual curl POST
  2. Check channel severities — The alert severity must match the channel’s severities filter
  3. Check channel statusGET /v1/anomaly/channels and verify enabled: true

Too many false positives

  1. Increase thresholds — Raise the threshold value for noisy rules
  2. Narrow scope filters — Add agentIds or scopes to limit which events the rule evaluates
  3. Disable low-value rules — Toggle off rules like off_hours_activity if your agents intentionally run 24/7

Custom rule not creating

  1. Rule ID must be unique — Check it does not conflict with a built-in rule ID
  2. Valid time window — Must be one of 5m, 15m, 1h, 6h, 24h
  3. Threshold must be positive — Must be an integer >= 1
Last modified on July 11, 2026