{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/coralogix/json-schema/coralogix-evaluation-config-schema.json",
  "title": "EvaluationConfig",
  "description": "Type-specific configuration for an evaluation. Exactly one variant is set.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/coralogix-ai-evaluations-service-api-openapi.yml#/components/schemas/EvaluationConfig",
  "type": "object",
  "oneOf": [
    {
      "required": [
        "allowedTopics"
      ],
      "type": "object"
    },
    {
      "required": [
        "competition"
      ],
      "type": "object"
    },
    {
      "required": [
        "hallucinationCompleteness"
      ],
      "type": "object"
    },
    {
      "required": [
        "hallucinationContextAdherence"
      ],
      "type": "object"
    },
    {
      "required": [
        "hallucinationContextRelevance"
      ],
      "type": "object"
    },
    {
      "required": [
        "hallucinationCorrectness"
      ],
      "type": "object"
    },
    {
      "required": [
        "pii"
      ],
      "type": "object"
    },
    {
      "required": [
        "promptInjection"
      ],
      "type": "object"
    },
    {
      "required": [
        "restrictedTopics"
      ],
      "type": "object"
    },
    {
      "required": [
        "sexism"
      ],
      "type": "object"
    },
    {
      "required": [
        "sqlAllowedTables"
      ],
      "type": "object"
    },
    {
      "required": [
        "sqlHallucination"
      ],
      "type": "object"
    },
    {
      "required": [
        "sqlReadOnly"
      ],
      "type": "object"
    },
    {
      "required": [
        "sqlRestrictedTables"
      ],
      "type": "object"
    },
    {
      "required": [
        "toxicity"
      ],
      "type": "object"
    },
    {
      "required": [
        "hallucinationTaskAdherence"
      ],
      "type": "object"
    },
    {
      "required": [
        "sqlLoad"
      ],
      "type": "object"
    },
    {
      "required": [
        "languageMismatch"
      ],
      "type": "object"
    },
    {
      "required": [
        "customEvaluation"
      ],
      "type": "object"
    }
  ],
  "properties": {
    "allowedTopics": {
      "$ref": "#/$defs/AllowedTopicsConfig"
    },
    "competition": {
      "$ref": "#/$defs/CompetitionConfig"
    },
    "customEvaluation": {
      "$ref": "#/$defs/CustomEvaluationConfig"
    },
    "hallucinationCompleteness": {
      "$ref": "#/$defs/HallucinationCompletenessConfig"
    },
    "hallucinationContextAdherence": {
      "$ref": "#/$defs/HallucinationContextAdherenceConfig"
    },
    "hallucinationContextRelevance": {
      "$ref": "#/$defs/HallucinationContextRelevanceConfig"
    },
    "hallucinationCorrectness": {
      "$ref": "#/$defs/HallucinationCorrectnessConfig"
    },
    "hallucinationTaskAdherence": {
      "$ref": "#/$defs/HallucinationTaskAdherenceConfig"
    },
    "languageMismatch": {
      "$ref": "#/$defs/LanguageMismatchConfig"
    },
    "pii": {
      "$ref": "#/$defs/PiiConfig"
    },
    "promptInjection": {
      "$ref": "#/$defs/PromptInjectionConfig"
    },
    "restrictedTopics": {
      "$ref": "#/$defs/RestrictedTopicsConfig"
    },
    "sexism": {
      "$ref": "#/$defs/SexismConfig"
    },
    "sqlAllowedTables": {
      "$ref": "#/$defs/SqlAllowedTablesConfig"
    },
    "sqlHallucination": {
      "$ref": "#/$defs/SqlHallucinationConfig"
    },
    "sqlLoad": {
      "$ref": "#/$defs/SqlLoadConfig"
    },
    "sqlReadOnly": {
      "$ref": "#/$defs/SqlReadOnlyConfig"
    },
    "sqlRestrictedTables": {
      "$ref": "#/$defs/SqlRestrictedTablesConfig"
    },
    "toxicity": {
      "$ref": "#/$defs/ToxicityConfig"
    }
  },
  "$defs": {
    "AllowedTopicsConfig": {
      "required": [
        "topics"
      ],
      "type": "object",
      "properties": {
        "topics": {
          "description": "Topics considered allowed.",
          "items": {
            "maxLength": 256,
            "minLength": 1,
            "pattern": "^[\\s\\S]+$",
            "type": "string",
            "description": "Topics considered allowed."
          },
          "maxItems": 1024,
          "minItems": 1,
          "type": "array",
          "x-coralogix-collection": "set"
        }
      },
      "description": "Configuration for the AllowedTopics evaluation."
    },
    "CompetitionConfig": {
      "required": [
        "competitors"
      ],
      "type": "object",
      "properties": {
        "competitors": {
          "description": "Competitor names to watch for.",
          "items": {
            "maxLength": 256,
            "minLength": 1,
            "pattern": "^[\\s\\S]+$",
            "type": "string",
            "description": "Competitor names to watch for."
          },
          "maxItems": 1024,
          "minItems": 1,
          "type": "array",
          "x-coralogix-collection": "set"
        }
      },
      "description": "Configuration for the Competition evaluation."
    },
    "CustomEvaluationConfig": {
      "type": "object",
      "properties": {
        "instructions": {
          "maxLength": 1048576,
          "minLength": 1,
          "pattern": "^[\\s\\S]+$",
          "type": "string",
          "description": "Instructions sent to the LLM evaluator."
        },
        "policyType": {
          "maxLength": 256,
          "minLength": 1,
          "pattern": "^[\\s\\S]+$",
          "type": "string",
          "description": "Policy type identifier."
        },
        "safe": {
          "maxLength": 65536,
          "minLength": 0,
          "pattern": "^[\\s\\S]*$",
          "type": "string",
          "description": "Description of what counts as safe."
        },
        "shouldIncludeSystemPrompt": {
          "type": "boolean",
          "description": "Whether to include the system prompt in the LLM input."
        },
        "violates": {
          "maxLength": 65536,
          "minLength": 0,
          "pattern": "^[\\s\\S]*$",
          "type": "string",
          "description": "Description of what counts as violating the policy."
        }
      },
      "description": "Custom evaluation policy details (instructions + examples for the LLM evaluator)."
    },
    "CustomEvaluationExample": {
      "type": "object",
      "properties": {
        "conversation": {
          "maxLength": 65536,
          "minLength": 0,
          "pattern": "^[\\s\\S]*$",
          "type": "string",
          "description": "Example conversation text."
        },
        "score": {
          "maxLength": 4,
          "minLength": 1,
          "pattern": "^[0-9]+$",
          "type": "string",
          "description": "Expected score for this example."
        }
      },
      "description": "A single labeled example for a custom evaluation."
    },
    "HallucinationCompletenessConfig": {
      "type": "object",
      "additionalProperties": false,
      "description": "Configuration for the HallucinationCompleteness evaluation (no fields)."
    },
    "HallucinationContextAdherenceConfig": {
      "type": "object",
      "additionalProperties": false,
      "description": "Configuration for the HallucinationContextAdherence evaluation (no fields)."
    },
    "HallucinationContextRelevanceConfig": {
      "type": "object",
      "additionalProperties": false,
      "description": "Configuration for the HallucinationContextRelevance evaluation (no fields)."
    },
    "HallucinationCorrectnessConfig": {
      "type": "object",
      "additionalProperties": false,
      "description": "Configuration for the HallucinationCorrectness evaluation (no fields)."
    },
    "HallucinationTaskAdherenceConfig": {
      "type": "object",
      "additionalProperties": false,
      "description": "Configuration for the HallucinationTaskAdherence evaluation (no fields)."
    },
    "LanguageMismatchConfig": {
      "type": "object",
      "additionalProperties": false,
      "description": "Configuration for the LanguageMismatch evaluation (no fields)."
    },
    "PiiCategory": {
      "enum": [
        "PHONE_NUMBER",
        "EMAIL_ADDRESS",
        "CREDIT_CARD",
        "IBAN_CODE",
        "US_SSN"
      ],
      "type": "string"
    },
    "PiiConfig": {
      "required": [
        "categories"
      ],
      "type": "object",
      "properties": {
        "categories": {
          "description": "PII categories to detect.",
          "items": {
            "$ref": "#/$defs/PiiCategory"
          },
          "maxItems": 1024,
          "minItems": 1,
          "type": "array",
          "x-coralogix-collection": "set"
        }
      },
      "description": "Configuration for the PII evaluation."
    },
    "PromptInjectionConfig": {
      "type": "object",
      "properties": {
        "additionalContext": {
          "maxLength": 65536,
          "minLength": 0,
          "pattern": "^[\\s\\S]*$",
          "type": "string",
          "description": "Additional context passed to the LLM evaluator."
        }
      },
      "description": "Configuration for the PromptInjection evaluation."
    },
    "RestrictedTopicsConfig": {
      "required": [
        "topics"
      ],
      "type": "object",
      "properties": {
        "topics": {
          "description": "Topics that should not appear.",
          "items": {
            "maxLength": 256,
            "minLength": 1,
            "pattern": "^[\\s\\S]+$",
            "type": "string",
            "description": "Topics that should not appear."
          },
          "maxItems": 1024,
          "minItems": 1,
          "type": "array",
          "x-coralogix-collection": "set"
        }
      },
      "description": "Configuration for the RestrictedTopics evaluation."
    },
    "SexismConfig": {
      "type": "object",
      "additionalProperties": false,
      "description": "Configuration for the Sexism evaluation (no fields)."
    },
    "SqlAllowedTablesConfig": {
      "required": [
        "tables"
      ],
      "type": "object",
      "properties": {
        "tables": {
          "description": "SQL table names that are allowed.",
          "items": {
            "maxLength": 256,
            "minLength": 1,
            "pattern": "^[\\s\\S]+$",
            "type": "string",
            "description": "SQL table names that are allowed."
          },
          "maxItems": 1024,
          "minItems": 1,
          "type": "array",
          "x-coralogix-collection": "set"
        }
      },
      "description": "Configuration for the SqlAllowedTables evaluation."
    },
    "SqlHallucinationConfig": {
      "type": "object",
      "additionalProperties": false,
      "description": "Configuration for the SqlHallucination evaluation (no fields)."
    },
    "SqlLoadConfig": {
      "type": "object",
      "properties": {
        "allowRecursiveCte": {
          "type": "boolean",
          "description": "Whether recursive CTEs are allowed."
        },
        "cteLimit": {
          "maxLength": 4,
          "minLength": 1,
          "pattern": "^[0-9]+$",
          "type": "string",
          "description": "Maximum CTEs allowed in a query."
        },
        "joinLimit": {
          "maxLength": 4,
          "minLength": 1,
          "pattern": "^[0-9]+$",
          "type": "string",
          "description": "Maximum JOINs allowed in a query."
        }
      },
      "description": "Configuration for the SqlLoad evaluation: caps on query complexity."
    },
    "SqlReadOnlyConfig": {
      "type": "object",
      "additionalProperties": false,
      "description": "Configuration for the SqlReadOnly evaluation (no fields)."
    },
    "SqlRestrictedTablesConfig": {
      "required": [
        "tables"
      ],
      "type": "object",
      "properties": {
        "tables": {
          "description": "SQL table names that are not allowed.",
          "items": {
            "maxLength": 256,
            "minLength": 1,
            "pattern": "^[\\s\\S]+$",
            "type": "string",
            "description": "SQL table names that are not allowed."
          },
          "maxItems": 1024,
          "minItems": 1,
          "type": "array",
          "x-coralogix-collection": "set"
        }
      },
      "description": "Configuration for the SqlRestrictedTables evaluation."
    },
    "ToxicityConfig": {
      "type": "object",
      "additionalProperties": false,
      "description": "Configuration for the Toxicity evaluation (no fields)."
    }
  }
}