Skip to main content

Event Types

OpenBox classifies agent operations into 21 semantic event types. These types enable precise policy writing and meaningful analytics.

Event Categories

LLM Operations

TypeDescriptionRisk Level
LLM_CALLCall to language model for completion/chatMedium
LLM_EMBEDDINGGenerate embeddings from textLow

Data Operations

TypeDescriptionRisk Level
DATABASE_READRead from databaseLow-Medium
DATABASE_WRITEWrite/update/delete database recordsMedium-High
FILE_READRead from filesystemLow-Medium
FILE_WRITEWrite to filesystemMedium-High
CACHE_READRead from cache layerLow
CACHE_WRITEWrite to cache layerLow

External Operations

TypeDescriptionRisk Level
EXTERNAL_API_CALLCall to external APIMedium-High
WEBHOOK_SENDSend webhook to external systemMedium-High
EMAIL_SENDSend emailMedium

Messaging Operations

TypeDescriptionRisk Level
MESSAGE_QUEUE_SENDPublish to message queueMedium
MESSAGE_QUEUE_RECEIVEConsume from message queueLow

Authentication Operations

TypeDescriptionRisk Level
AUTH_REQUESTRequest authentication/authorizationLow
AUTH_GRANTAuthentication grantedLow
AUTH_DENYAuthentication deniedLow

Workflow Operations

TypeDescriptionRisk Level
WORKFLOW_STARTWorkflow execution beginsLow
WORKFLOW_COMPLETEWorkflow execution endsLow
ACTIVITY_STARTActivity execution beginsLow
ACTIVITY_COMPLETEActivity execution endsLow

Agent Operations

TypeDescriptionRisk Level
AGENT_GOAL_SETAgent goal definedLow
AGENT_GOAL_UPDATEAgent goal modifiedMedium
AGENT_DECISIONAgent makes autonomous decisionMedium
AGENT_ACTIONAgent takes actionVariable

Using Event Types

In Policies

Reference event types in OPA policies:

package openbox.policy

# Allow all read operations
allow {
input.operation.type == "DATABASE_READ"
}

# Require approval for external calls
require_approval {
input.operation.type == "EXTERNAL_API_CALL"
}

# Block file writes for low-trust agents
deny {
input.operation.type == "FILE_WRITE"
input.agent.trust_tier >= 3
}

In Behavioral Rules

Detect patterns across event types:

rule:
name: "PII Exfiltration Pattern"
trigger:
type: DATABASE_READ
target: "*.pii_*"
condition:
within: 60s
followed_by:
- type: EXTERNAL_API_CALL
- type: WEBHOOK_SEND
- type: EMAIL_SEND
action: REQUIRE_APPROVAL

In Monitoring

Filter sessions by event type:

  • View all EXTERNAL_API_CALL events
  • Track DATABASE_WRITE frequency
  • Alert on AUTH_DENY spikes

Event Metadata

Each event includes:

{
"event_id": "evt_abc123",
"type": "DATABASE_WRITE",
"timestamp": "2024-01-15T09:14:32.001Z",
"session_id": "ses_xyz789",
"agent_id": "agt_def456",

"target": "customers.update",
"parameters": {
"table": "customers",
"operation": "update",
"record_count": 1
},

"governance": {
"decision": "ALLOW",
"policies_evaluated": ["default", "customer-data"],
"trust_score_at_time": 87
},

"telemetry": {
"duration_ms": 45,
"trace_id": "abc123def456"
}
}

Custom Event Types

For operations not covered by the 21 standard types, use AGENT_ACTION with custom metadata:

# In your activity
openbox.emit_event(
type="AGENT_ACTION",
metadata={
"custom_type": "payment_processing",
"amount": 99.99,
"currency": "USD"
}
)

Then reference in policies:

require_approval {
input.operation.type == "AGENT_ACTION"
input.operation.metadata.custom_type == "payment_processing"
input.operation.metadata.amount > 100
}