{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://ryan-wolbeck.github.io/agentlogsafe/schemas/agent-event.schema.json",
  "title": "agentlogsafe AgentEvent",
  "description": "A versioned audit event for an AI agent workflow.",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema_version", "event_id", "run_id", "event_type", "timestamp", "agent_name", "workflow_name", "parent_event_id", "provider", "model", "tool_name", "status", "payload", "risk", "metadata"],
  "properties": {
    "schema_version": {"const": "1.0"},
    "event_id": {"type": "string", "format": "uuid"},
    "run_id": {"type": "string", "minLength": 1},
    "event_type": {"type": "string", "minLength": 1},
    "timestamp": {"type": "string", "format": "date-time"},
    "agent_name": {"type": ["string", "null"]},
    "workflow_name": {"type": ["string", "null"]},
    "parent_event_id": {"type": ["string", "null"]},
    "provider": {"type": ["string", "null"]},
    "model": {"type": ["string", "null"]},
    "tool_name": {"type": ["string", "null"]},
    "status": {"type": ["string", "null"]},
    "payload": {"type": "object"},
    "risk": {"type": "object"},
    "metadata": {"type": "object"}
  }
}
