KAKUNIN

Event Ingest

Stream behaviour events from your AI agents to Kakunin for real-time risk scoring and anomaly detection.

Overview

Every action your agent takes can be recorded as a behaviour event. Kakunin scores each event in real time and returns a risk band.

Supported Action Types

ActionDescription
tool_callAgent invoked an external tool or API
message_sentAgent sent a message to a user or system
data_accessAgent read or queried a data source
decision_madeAgent made a significant autonomous decision
error_occurredAgent encountered an error
authentication_failureAgent failed to authenticate to an external service
resource_usageAgent consumed compute, tokens, or quota
policy_violationAgent attempted an action outside its allowed scope

Recording an Event

POST /v1/events
{
  "agent_id": "uuid",
  "action_type": "tool_call",
  "payload": {
    "tool": "web_search",
    "query": "EUR/USD spot rate",
    "duration_ms": 420
  }
}

Response 201:

{
  "data": {
    "id": "uuid",
    "agent_id": "uuid",
    "action_type": "tool_call",
    "risk_score": 0.12,
    "risk_band": "low",
    "occurred_at": "2026-05-17T10:00:00Z"
  }
}

Risk Bands

BandScore RangeBehaviour
low< 0.3Normal operation
medium0.3 – 0.84Logged, monitored
high≥ 0.85Triggers auto-revocation check

Querying Events

GET /v1/events?agent_id={id}&band=high&limit=50

Filters:

ParameterTypeDescription
agent_iduuidFilter by agent
bandlow | medium | highFilter by risk band
action_typestringFilter by action type
beforeISO 8601Cursor for pagination (newest first)
limitintegerMax results, capped at 100

Response:

{
  "data": [...],
  "has_next_page": true,
  "next_cursor": "2026-05-17T09:55:00.000Z"
}

Risk Scoring

Events are scored using AI-powered anomaly detection (Claude Haiku via OpenRouter). Scoring is synchronous — the score is returned in the 201 response.

High-risk events (≥ 0.85) write an audit_log entry and trigger an agent status review.

On this page