{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://aevyra.tiptoptechknowlogy.com/guides/factual-evidence.schema.json",
  "title": "Aevyra factual evidence export v1",
  "description": "Only factual observations and source references. Size limit 512 KB; unique fact names per subject. Missing or conflicting values remain unassessed.",
  "type": "object",
  "additionalProperties": false,
  "anyOf": [
    {
      "required": [
        "ai_evidence"
      ],
      "properties": {
        "ai_evidence": {
          "minItems": 1
        }
      }
    },
    {
      "required": [
        "posture_evidence"
      ],
      "properties": {
        "posture_evidence": {
          "minItems": 1
        }
      }
    }
  ],
  "properties": {
    "ai_evidence": {
      "type": "array",
      "maxItems": 1000,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "system_id",
          "facts"
        ],
        "properties": {
          "system_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "system": {
            "type": "string",
            "maxLength": 300
          },
          "business_unit": {
            "type": "string",
            "maxLength": 300
          },
          "facts": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "fact",
                "value",
                "provenance",
                "source_id"
              ],
              "properties": {
                "provenance": {
                  "enum": [
                    "collector_observed",
                    "connector_observed",
                    "customer_confirmed",
                    "imported"
                  ]
                },
                "source_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 512
                },
                "observed_at": {
                  "anyOf": [
                    {
                      "type": "null"
                    },
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "string",
                      "format": "date"
                    }
                  ]
                },
                "fact": {
                  "enum": [
                    "ai_use_approved",
                    "endpoint_approved",
                    "excessive_data_access_observed",
                    "model_approved",
                    "model_endpoint_external",
                    "policy_bypass_observed",
                    "prompt_exfiltration_observed",
                    "sensitive_data_to_model",
                    "sensitive_internal_prompt"
                  ]
                },
                "value": {
                  "enum": [
                    true,
                    false,
                    "true",
                    "false",
                    "unknown"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "posture_evidence": {
      "type": "array",
      "maxItems": 1000,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "system_id",
          "facts"
        ],
        "properties": {
          "system_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "system": {
            "type": "string",
            "maxLength": 300
          },
          "business_unit": {
            "type": "string",
            "maxLength": 300
          },
          "facts": {
            "type": "array",
            "minItems": 1,
            "items": {
              "oneOf": [
                {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "fact",
                    "value",
                    "provenance",
                    "source_id"
                  ],
                  "properties": {
                    "provenance": {
                      "enum": [
                        "collector_observed",
                        "connector_observed",
                        "customer_confirmed",
                        "imported"
                      ]
                    },
                    "source_id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 512
                    },
                    "observed_at": {
                      "anyOf": [
                        {
                          "type": "null"
                        },
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "string",
                          "format": "date"
                        }
                      ]
                    },
                    "fact": {
                      "enum": [
                        "asset_owner_present",
                        "configuration_matches_baseline",
                        "crypto_library_supported",
                        "hsm_target_supported",
                        "migration_candidate",
                        "migration_required",
                        "policy_compliant",
                        "pqc_ready",
                        "required_evidence_complete",
                        "runtime_supported",
                        "vendor_dependency"
                      ]
                    },
                    "value": {
                      "anyOf": [
                        {
                          "type": "boolean"
                        },
                        {
                          "type": "null"
                        },
                        {
                          "const": "unknown"
                        }
                      ]
                    }
                  }
                },
                {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "fact",
                    "value",
                    "provenance",
                    "source_id"
                  ],
                  "properties": {
                    "provenance": {
                      "enum": [
                        "collector_observed",
                        "connector_observed",
                        "customer_confirmed",
                        "imported"
                      ]
                    },
                    "source_id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 512
                    },
                    "observed_at": {
                      "anyOf": [
                        {
                          "type": "null"
                        },
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "string",
                          "format": "date"
                        }
                      ]
                    },
                    "fact": {
                      "enum": [
                        "data_lifetime_years",
                        "key_rotation_max_age_days",
                        "review_max_age_days"
                      ]
                    },
                    "value": {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 1000000
                        },
                        {
                          "type": "null"
                        },
                        {
                          "const": "unknown"
                        }
                      ]
                    }
                  }
                },
                {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "fact",
                    "value",
                    "provenance",
                    "source_id"
                  ],
                  "properties": {
                    "provenance": {
                      "enum": [
                        "collector_observed",
                        "connector_observed",
                        "customer_confirmed",
                        "imported"
                      ]
                    },
                    "source_id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 512
                    },
                    "observed_at": {
                      "anyOf": [
                        {
                          "type": "null"
                        },
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "string",
                          "format": "date"
                        }
                      ]
                    },
                    "fact": {
                      "enum": [
                        "minimum_rsa_bits"
                      ]
                    },
                    "value": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 1024,
                          "maximum": 16384
                        },
                        {
                          "type": "null"
                        },
                        {
                          "const": "unknown"
                        }
                      ]
                    }
                  }
                },
                {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "fact",
                    "value",
                    "provenance",
                    "source_id"
                  ],
                  "properties": {
                    "provenance": {
                      "enum": [
                        "collector_observed",
                        "connector_observed",
                        "customer_confirmed",
                        "imported"
                      ]
                    },
                    "source_id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 512
                    },
                    "observed_at": {
                      "anyOf": [
                        {
                          "type": "null"
                        },
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "string",
                          "format": "date"
                        }
                      ]
                    },
                    "fact": {
                      "enum": [
                        "certificate_not_after",
                        "exception_expires_at",
                        "key_last_rotated_at",
                        "key_rotation_due",
                        "last_reviewed"
                      ]
                    },
                    "value": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time"
                            },
                            {
                              "type": "string",
                              "format": "date"
                            }
                          ]
                        },
                        {
                          "type": "null"
                        },
                        {
                          "const": "unknown"
                        }
                      ]
                    }
                  }
                },
                {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "fact",
                    "value",
                    "provenance",
                    "source_id"
                  ],
                  "properties": {
                    "provenance": {
                      "enum": [
                        "collector_observed",
                        "connector_observed",
                        "customer_confirmed",
                        "imported"
                      ]
                    },
                    "source_id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 512
                    },
                    "observed_at": {
                      "anyOf": [
                        {
                          "type": "null"
                        },
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "string",
                          "format": "date"
                        }
                      ]
                    },
                    "fact": {
                      "enum": [
                        "algorithm",
                        "baseline_id",
                        "business_criticality",
                        "certificate_signature_algorithm",
                        "crypto_library",
                        "data_class",
                        "hsm_target_profile",
                        "migration_blocker",
                        "owner",
                        "policy_id",
                        "runtime",
                        "vendor"
                      ]
                    },
                    "value": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 512
                        },
                        {
                          "type": "null"
                        },
                        {
                          "const": "unknown"
                        }
                      ]
                    }
                  }
                }
              ]
            }
          }
        }
      }
    }
  }
}
