{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sealgate-ai/json-schema/sealgate-ai-auto-label-review-response-schema.json",
  "title": "AutoLabelReviewResponse",
  "description": "Response for GET config-perms/review.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sealgate-ai-config-perms-api-openapi.yml#/components/schemas/AutoLabelReviewResponse",
  "properties": {
    "servers": {
      "items": {
        "$ref": "#/$defs/AutoLabelReviewServer"
      },
      "type": "array",
      "title": "Servers",
      "description": "Servers with pending reviews"
    },
    "total": {
      "type": "integer",
      "title": "Total",
      "description": "Total unreviewed labels across all servers"
    },
    "pending_label_servers": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Pending Label Servers",
      "description": "Server names where auto_label_pending is True - the LLM labeling has not yet started or is still in progress"
    }
  },
  "type": "object",
  "required": [
    "servers",
    "total"
  ],
  "$defs": {
    "AutoLabelReviewItem": {
      "properties": {
        "item_type": {
          "type": "string",
          "title": "Item Type",
          "description": "Element type: tool, resource, or prompt"
        },
        "item_name": {
          "type": "string",
          "title": "Item Name",
          "description": "Element name"
        },
        "flags": {
          "additionalProperties": true,
          "type": "object",
          "title": "Flags",
          "description": "Applied permission flags (trifecta booleans + acl)"
        },
        "reasoning": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reasoning",
          "description": "LLM's one-line explanation for why it chose these flags"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Description",
          "description": "Element description from interface-lock metadata"
        }
      },
      "type": "object",
      "required": [
        "item_type",
        "item_name"
      ],
      "title": "AutoLabelReviewItem",
      "description": "One auto-applied, not-yet-reviewed labelled element."
    },
    "AutoLabelReviewServer": {
      "properties": {
        "server_name": {
          "type": "string",
          "title": "Server Name",
          "description": "Server name"
        },
        "server_id": {
          "type": "integer",
          "title": "Server Id",
          "description": "Server ID"
        },
        "items": {
          "items": {
            "$ref": "#/$defs/AutoLabelReviewItem"
          },
          "type": "array",
          "title": "Items",
          "description": "Unreviewed labelled elements"
        }
      },
      "type": "object",
      "required": [
        "server_name",
        "server_id",
        "items"
      ],
      "title": "AutoLabelReviewServer",
      "description": "All unreviewed auto-applied labels for one server."
    }
  }
}