{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://mrtinkz.github.io/ai-charter/schema/certification.schema.json",
  "title": "AI Charter Certification",
  "description": "Public contract for certifying an AI model, an agent built on one, or a physical autonomous bot, per the Universal AI Charter's governance and disclosure articles. A certification covers origin, training, capability, and decision-making disclosure for exactly one subject and one version.",
  "type": "object",
  "additionalProperties": true,
  "required": [
    "schema",
    "certificationId",
    "subjectType",
    "company",
    "ownerType",
    "originCountry",
    "modelName",
    "version",
    "status",
    "agentSpecialization",
    "modalities",
    "parameterScale",
    "fingerprint",
    "trainingSources",
    "agenticDecisionMaking",
    "hazardCategories",
    "decisionCategorization",
    "unintendedConsequences",
    "issuedDate",
    "effectiveDate",
    "endDate"
  ],
  "properties": {
    "schema": {
      "const": "ai-charter-certification-v1",
      "description": "Schema version marker. Bump this when the contract changes in a breaking way."
    },
    "certificationId": {
      "type": "string",
      "pattern": "^urn:ai-charter:cert:[0-9a-fA-F-]{36}$",
      "description": "Opaque, immutable identifier for this certification, assigned once at issue time and never recomputed. Format 'urn:ai-charter:cert:<uuid>'. Not derived from content, so updating disclosure fields never changes it. Resolve it in the public registry to cross-verify."
    },
    "subjectType": {
      "enum": ["model", "agent", "autonomous-bot"],
      "description": "Whether this certification covers a base model, a specialized agent built on top of one, or a physical autonomous bot."
    },
    "company": {
      "type": "string",
      "minLength": 1,
      "description": "Name of the certification holder."
    },
    "ownerType": {
      "enum": ["company", "individual", "organization"],
      "description": "Who holds the certification: a registered company, a named individual, or a non-profit/public body."
    },
    "originCountry": {
      "type": "string",
      "description": "Country where the model or agent originates. May be empty when undisclosed."
    },
    "modelName": {
      "type": "string",
      "minLength": 1,
      "description": "Name of the model, or of the agent when subjectType is 'agent'."
    },
    "version": {
      "type": "string",
      "minLength": 1,
      "description": "Version identifier this certification applies to."
    },
    "status": {
      "enum": ["planned", "active", "deactivated"],
      "description": "Current lifecycle state of the certification."
    },
    "agentSpecialization": {
      "type": "string",
      "description": "Required, non-empty when subjectType is 'agent': what the agent specializes in, e.g. 'Grid outage dispatch'. Empty when subjectType is 'model'."
    },
    "botCategory": {
      "type": "string",
      "description": "Required, non-empty when subjectType is 'autonomous-bot': its operating domain, e.g. 'civil', 'military', 'industrial', 'agricultural'. Empty for a model or an agent. Open-ended."
    },
    "modalities": {
      "type": "array",
      "items": { "type": "string" },
      "description": "What the model or agent can produce or understand, e.g. 'Text Generation', 'Image Understanding'. Open-ended list, not a fixed enum: propose additions at /ai-charter/placards' sibling reference, or via pull request."
    },
    "parameterScale": {
      "type": "string",
      "description": "Freeform training parameter scale disclosure, e.g. '7B', '24B', '1.8T', or 'Undisclosed'."
    },
    "fingerprint": {
      "type": "object",
      "additionalProperties": true,
      "required": ["present", "method"],
      "properties": {
        "present": { "type": "boolean", "description": "Whether output is fingerprinted or watermarked." },
        "method": { "type": "string", "description": "How the fingerprint/watermark works. Empty when present is false." }
      },
      "description": "Charter governance disclosure: AI tokens must be fingerprinted to protect intellectual property."
    },
    "trainingSources": {
      "type": "string",
      "description": "Disclosure of the sources used to train the model or agent."
    },
    "agenticDecisionMaking": {
      "type": "boolean",
      "description": "Whether the model or agent makes decisions on its own, without a human confirming each one."
    },
    "hazardCategories": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Hazard placard labels disclosed for this certification, HAZMAT-style. Open-ended list; see /ai-charter/placards for the reference set and severity coding."
    },
    "complianceStandards": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Optional. Data-handling and regulatory standards the subject is certified to meet, e.g. 'PII Handling', 'HIPAA (PHI)', 'GDPR', 'Classified / SECRET'. Open-ended; absence means none disclosed."
    },
    "operatingRegions": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Optional. Regions the subject is cleared to operate in, e.g. 'North America (NA)', 'European Union (EU/EEA)', 'Asia-Pacific (APAC)'. Open-ended; absence means unspecified."
    },
    "riskTier": {
      "enum": ["unacceptable", "high", "limited", "minimal"],
      "description": "Optional. EU AI Act risk tier the subject self-classifies under."
    },
    "nistFunctions": {
      "type": "array",
      "items": { "enum": ["Govern", "Map", "Measure", "Manage"] },
      "description": "Optional. NIST AI Risk Management Framework core functions this certification addresses."
    },
    "energyProfile": {
      "type": "string",
      "description": "Optional. Measured energy or compute profile, e.g. '0.8 kWh per 1M tokens' or a training-compute figure."
    },
    "incidentReferences": {
      "type": "array",
      "items": { "type": "string", "format": "uri" },
      "description": "Optional. Public URLs to logged incidents behind unintendedConsequences, e.g. an AI Incident Database entry."
    },
    "nextDisclosureDate": {
      "type": "string",
      "description": "Optional. Next yearly decision-disclosure due date, YYYY-MM-DD."
    },
    "signature": {
      "type": "object",
      "additionalProperties": true,
      "required": ["algorithm", "publicKeyUrl", "value"],
      "properties": {
        "algorithm": { "type": "string", "description": "Signature algorithm, e.g. 'ed25519' or 'ecdsa-p256'." },
        "publicKeyUrl": { "type": "string", "description": "URL where the issuer's public key can be fetched." },
        "value": { "type": "string", "description": "Base64 detached signature over the certification with this field removed." }
      },
      "description": "Optional. Issuer-provided detached signature over the certification, for provenance."
    },
    "decisionCategorization": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true,
        "required": ["category", "subcategory"],
        "properties": {
          "category": { "type": "string", "minLength": 1 },
          "subcategory": { "type": "string", "minLength": 1 }
        }
      },
      "description": "Yearly categorization/sub-categorization of decisions the model or agent took, e.g. { category: 'Healthcare', subcategory: 'Diagnosis Support' }."
    },
    "unintendedConsequences": {
      "type": "string",
      "description": "Unintended consequences already on record for this model or agent. Empty string means none reported."
    },
    "issuedDate": {
      "type": "string",
      "format": "date",
      "description": "Date this certification was issued, YYYY-MM-DD."
    },
    "effectiveDate": {
      "type": "string",
      "format": "date",
      "description": "Date this certification takes effect, YYYY-MM-DD."
    },
    "endDate": {
      "type": "string",
      "description": "Date this certification ends, YYYY-MM-DD. Empty string means open-ended, must not be earlier than effectiveDate when set."
    }
  }
}
