{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sealgate-ai/json-schema/sealgate-ai-session-security-response-schema.json",
  "title": "SessionSecurityResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sealgate-ai-insights-api-openapi.yml#/components/schemas/SessionSecurityResponse",
  "properties": {
    "sessions": {
      "items": {
        "$ref": "#/$defs/SessionSummary"
      },
      "type": "array",
      "title": "Sessions"
    },
    "window_days": {
      "type": "integer",
      "title": "Window Days"
    },
    "window_start": {
      "type": "string",
      "title": "Window Start"
    }
  },
  "type": "object",
  "required": [
    "sessions",
    "window_days",
    "window_start"
  ],
  "$defs": {
    "SessionSummary": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id",
          "description": "Session identifier"
        },
        "correlation_id": {
          "type": "string",
          "title": "Correlation Id",
          "description": "Correlation ID linking related events"
        },
        "session_token": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Session Token",
          "description": "SealGate session token the LLM client holds in context for token-based sessions (from builtin_obtain_session_token); null otherwise"
        },
        "user_id": {
          "type": "string",
          "title": "User Id",
          "description": "Authenticated user ID"
        },
        "user_email": {
          "type": "string",
          "title": "User Email",
          "description": "User email address"
        },
        "agent_name": {
          "type": "string",
          "title": "Agent Name",
          "description": "Name of the AI agent"
        },
        "agent_type": {
          "type": "string",
          "title": "Agent Type",
          "description": "Type/category of the agent"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At",
          "description": "Session start timestamp"
        },
        "last_activity_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Last Activity At",
          "description": "Timestamp of the last tool call activity"
        },
        "duration_ms": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Duration Ms",
          "description": "Total session duration in milliseconds"
        },
        "tool_call_count": {
          "type": "integer",
          "title": "Tool Call Count",
          "description": "Number of tool calls in this session"
        },
        "status": {
          "type": "string",
          "title": "Status",
          "description": "Session status (active, completed, error)"
        },
        "trifecta_flags": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Trifecta Flags",
          "description": "Trifecta security flags triggered"
        },
        "trifecta_disposition": {
          "type": "string",
          "title": "Trifecta Disposition",
          "description": "Worst outcome (denied > expired > approved) of any trifecta write gated for approval this session; 'pending' is a transient in-flight state. One of: none, pending, approved, expired, denied",
          "default": "none"
        },
        "trifecta_block_count": {
          "type": "integer",
          "title": "Trifecta Block Count",
          "description": "Number of trifecta writes gated for approval this session",
          "default": 0
        },
        "block_severity": {
          "type": "string",
          "title": "Block Severity",
          "description": "Severity of trifecta blocks for dashboard colouring: none, low, medium, high",
          "default": "none"
        },
        "acl_level": {
          "type": "string",
          "title": "Acl Level",
          "description": "Highest ACL level (PUBLIC, PRIVATE, SECRET)",
          "default": "PUBLIC"
        },
        "tool_names": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Tool Names",
          "description": "Distinct tool names invoked in this session"
        }
      },
      "type": "object",
      "required": [
        "id",
        "correlation_id",
        "user_id",
        "user_email",
        "agent_name",
        "agent_type",
        "created_at",
        "tool_call_count",
        "status",
        "trifecta_flags"
      ],
      "title": "SessionSummary"
    }
  }
}