{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:agent-platform:guardrail-runtime:detector:v1",
  "$defs": {
    "Input": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schemaVersion": {
          "const": "agent-platform.guardrail-runtime.detector/v1"
        },
        "providerRevision": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]*$"
        },
        "stage": {
          "enum": [
            "request",
            "response"
          ]
        },
        "messages": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "role": {
                "type": "string",
                "minLength": 1,
                "maxLength": 32
              },
              "content": {
                "type": "string",
                "maxLength": 131072
              }
            },
            "required": [
              "role",
              "content"
            ]
          },
          "minItems": 1,
          "maxItems": 64
        }
      },
      "required": [
        "schemaVersion",
        "providerRevision",
        "stage",
        "messages"
      ]
    },
    "Result": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schemaVersion": {
          "const": "agent-platform.guardrail-runtime.detector/v1"
        },
        "providerRevision": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]*$"
        },
        "verdict": {
          "enum": [
            "allow",
            "deny"
          ]
        }
      },
      "required": [
        "schemaVersion",
        "providerRevision",
        "verdict"
      ]
    }
  }
}
