{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://aidisclose.io/schema/0.1/ai-disclosure.schema.json",
  "title": "ai-disclosure.json v0.1",
  "type": "object",
  "required": ["specVersion", "publisher", "lastUpdated", "languages", "aiSystems", "evidence"],
  "additionalProperties": false,
  "properties": {
    "$schema": { "type": "string" },
    "specVersion": { "const": "0.1" },
    "publisher": {
      "type": "object",
      "required": ["name", "domain", "contact"],
      "additionalProperties": false,
      "properties": {
        "name": { "type": "string", "minLength": 1 },
        "legalName": { "type": "string" },
        "domain": { "type": "string", "pattern": "^[a-z0-9.-]+\\.[a-z]{2,}$" },
        "contact": { "type": "string", "pattern": "^(mailto:|https://)" },
        "euRepresentative": { "type": "string" }
      }
    },
    "lastUpdated": { "type": "string", "format": "date" },
    "languages": {
      "type": "array", "minItems": 1,
      "items": { "type": "string", "pattern": "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$" }
    },
    "aiSystems": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["id", "name", "role", "kind", "purpose", "article50", "disclosure"],
        "additionalProperties": false,
        "properties": {
          "id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{0,63}$" },
          "name": { "type": "string" },
          "role": { "enum": ["provider", "deployer", "both"] },
          "kind": { "enum": ["conversational", "content-generation", "emotion-recognition", "biometric-categorisation", "other"] },
          "vendor": { "type": "string" },
          "model": { "type": "string" },
          "purpose": { "type": "string" },
          "article50": {
            "type": "array", "minItems": 1, "uniqueItems": true,
            "items": { "enum": ["50(1)", "50(2)", "50(3)", "50(4)"] }
          },
          "disclosure": {
            "type": "object",
            "required": ["methods"],
            "additionalProperties": false,
            "properties": {
              "methods": {
                "type": "array", "minItems": 1, "uniqueItems": true,
                "items": { "enum": ["banner", "inline-label", "icon", "audio-notice", "metadata"] }
              },
              "placement": { "type": "string" },
              "texts": {
                "type": "object",
                "patternProperties": { "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$": { "type": "string" } },
                "additionalProperties": false
              }
            }
          },
          "agentInteractionPolicy": { "enum": ["always", "when-plausible", "n/a"] },
          "generationDegree": { "enum": ["fully-ai-generated", "ai-assisted", "unspecified"] }
        }
      }
    },
    "contentMarking": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "machineReadable": {
          "type": "array",
          "items": {
            "type": "object",
            "required": ["standard", "scope"],
            "additionalProperties": false,
            "properties": {
              "standard": { "enum": ["C2PA", "IPTC-DigitalSourceType", "schema.org", "watermark", "other"] },
              "scope": { "type": "string" },
              "detectionEndpoint": { "type": "string", "format": "uri" }
            }
          }
        },
        "visibleLabel": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "style": { "enum": ["AI-acronym", "custom"] },
            "localized": { "type": "boolean" }
          }
        }
      }
    },
    "editorialResponsibility": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "humanReview": { "type": "boolean" },
        "statementUrl": { "type": "string", "format": "uri" }
      }
    },
    "evidence": {
      "type": "object",
      "required": ["retentionMonths"],
      "additionalProperties": false,
      "properties": {
        "retentionMonths": { "type": "integer", "minimum": 6 },
        "registerUrl": { "type": "string", "format": "uri" }
      }
    },
    "exemptions": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["systemId", "basis", "rationale"],
        "additionalProperties": false,
        "properties": {
          "systemId": { "type": "string" },
          "basis": { "enum": ["obviousness", "artistic", "law-enforcement", "editorial-review", "other"] },
          "rationale": { "type": "string" }
        }
      }
    }
  }
}
