Admin Console

Alerts Center

Configure alerts and notifications for governance events across your AI agents.

Alert Types

Tork supports multiple alert types to keep you informed of important governance events:

Policy Violation

high

An agent action was blocked by a policy

Circuit Breaker

high

An agent circuit breaker state changed

Budget Threshold

medium

Spending reached a configured threshold

Jailbreak Attempt

high

A jailbreak attempt was detected

Approval Required

medium

An action is pending human approval

Anomaly Detected

medium

Unusual agent behavior detected

Creating Alert Rules

Alert rules live in the Tork cloud, so they are configured over the REST API. There is no Python cloud SDK — @torknetwork/sdk is npm-only, and tork-governance on PyPI governs on-device and does not manage alerts. Authenticate with your API key:

python
import os
import requests

# There is no Python cloud SDK — use the REST API.
TORK_API_KEY = os.environ["TORK_API_KEY"]

response = requests.post(
    "https://tork.network/api/v1/alerts",
    headers={
        "X-API-Key": TORK_API_KEY,
        "Content-Type": "application/json",
    },
    json={
        "api_key_id": "key_abc123",
        "alert_type": "consecutive_failures",
        "channels": {
            "email": ["security@company.com"],
            "slack_webhook_url": "https://hooks.slack.com/...",
        },
        "thresholds": {"failure_count": 3},
        "is_active": True,
    },
)
response.raise_for_status()

print(response.json()["config"]["id"])

Notification Channels

Alerts can be sent to multiple channels:

Slack

Real-time alerts to channels

Email

Detailed email notifications

Webhook

Custom HTTP endpoints

Webhook Format

Alert webhook payload structure:

json
{
  "alert_id": "alert_abc123",
  "rule_id": "rule_xyz789",
  "rule_name": "High-Risk Policy Violations",
  "timestamp": "2024-01-15T10:30:00Z",
  "severity": "high",
  "event": {
    "type": "policy.violation",
    "agent_id": "agent-123",
    "policy_name": "block-medical-advice",
    "action": "BLOCK",
    "reason": "Medical advice is not permitted"
  },
  "context": {
    "user_id": "user_456",
    "session_id": "sess_789",
    "environment": "production"
  }
}

Managing Alerts

Inspect your alert configurations and the delivery log:

python
headers = {"X-API-Key": TORK_API_KEY}

# List the alert configurations for an API key
configs = requests.get(
    "https://tork.network/api/v1/alerts",
    headers=headers,
    params={"api_key_id": "key_abc123"},
).json()

for config in configs["configs"]:
    print(f"{config['alert_type']}: active={config['is_active']}")

# List recent alert deliveries (the send log)
logs = requests.get(
    "https://tork.network/api/v1/alerts",
    headers=headers,
    params={"api_key_id": "key_abc123", "type": "logs"},
).json()

for entry in logs["logs"]:
    print(f"[{entry['status']}] {entry['channel']} -> {entry['recipient']}: {entry['subject']}")

# Silence an alert type by deactivating its configuration
requests.post(
    "https://tork.network/api/v1/alerts",
    headers={**headers, "Content-Type": "application/json"},
    json={
        "api_key_id": "key_abc123",
        "alert_type": "consecutive_failures",
        "channels": {"email": ["security@company.com"]},
        "is_active": False,
    },
)

Tip: Use cooldown periods and severity filters to prevent alert fatigue while maintaining visibility.

Documentation

Learn to integrate TORK

Upgrade Plan

Current: free

Support

Get help from our team