{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://hai.ai/schemas/components/signature/v1/signature.schema.json",
  "title": "Signature",
  "description": "SACRED CRYPTOGRAPHIC COMMITMENT: A signature is a permanent, irreversible cryptographic proof binding the signer to document content. Once signed, the signer cannot deny their attestation (non-repudiation). Signatures should only be created after careful review of document content. The signer is forever accountable for what they sign.",
  "type": "object",
  "properties": {
    "agentID": {
      "description": "The id of agent that produced signature",
      "hai": "agent",
      "type": "string",
      "format": "uuid"
    },
    "agentVersion": {
      "description": " Version of the agent",
      "hai": "meta",
      "type": "string",
      "format": "uuid"
    },
    "date": {
      "description": "Date ",
      "hai": "meta",
      "format": "date-time",
      "type": "string"
    },
    "iat": {
      "description": "Issued-at timestamp as Unix epoch seconds.",
      "hai": "meta",
      "type": "integer",
      "minimum": 0
    },
    "jti": {
      "description": "Unique signature nonce for replay defense.",
      "hai": "meta",
      "type": "string",
      "minLength": 1
    },
    "signature": {
      "description": "The actual signature, made from the docid, ",
      "hai": "base",
      "type": "string"
    },
    "publicKeyHash": {
      "description": "Hash of the public key to verify signature with.",
      "hai": "meta",
      "type": "string"
    },
    "signingAlgorithm": {
      "description": "The cryptographic algorithm used to create this signature. MUST be verified explicitly during signature verification.",
      "hai": "base",
      "type": "string",
      "enum": [
        "RSA-PSS",
        "ring-Ed25519",
        "pq2025"
      ]
    },
    "response": {
      "type": "string",
      "description": "When prompting an agent, is there text provided with the agreement?",
      "hai": "agent"
    },
    "responseType": {
      "type": "string",
      "description": "Optional way to track disagreement, or agreement. Reject means question not understood or considered relevant. ",
      "hai": "agent",
      "enum": [
        "agree",
        "disagree",
        "reject"
      ]
    },
    "fields": {
      "type": "array",
      "description": "fields fields from document which were used to generate signature.",
      "hai": "base",
      "items": {
        "type": "string"
      }
    }
  },
  "additionalProperties": false,
  "required": [
    "agentID",
    "agentVersion",
    "signature",
    "date",
    "iat",
    "jti",
    "publicKeyHash",
    "signingAlgorithm",
    "fields"
  ]
}
