{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/startekenterprises-com/json-schema/startekenterprises-com-scan-result-v2-schema.json",
  "title": "ScanResultV2",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/startekenterprises-com-openapi.yaml#/components/schemas/ScanResultV2",
  "allOf": [
    {
      "$ref": "#/$defs/ScanResultV1"
    },
    {
      "type": "object",
      "properties": {
        "verdict": {
          "type": "string",
          "enum": [
            "no_signals",
            "suspicious",
            "malicious"
          ],
          "description": "no_signals = no detector fired, not \"safe\""
        }
      }
    }
  ],
  "$defs": {
    "ScanReceipt": {
      "type": "object",
      "description": "Signed tamper-evident proof-of-scan. Expires 180 days after scanned_at. A \"clean\"/\"no_signals\" verdict means \"no known patterns found\", not \"safe\".",
      "properties": {
        "receipt_id": {
          "type": "string"
        },
        "scanned_at": {
          "type": "string",
          "format": "date-time"
        },
        "expires_at": {
          "type": "string",
          "format": "date-time"
        },
        "verdict": {
          "type": "string"
        },
        "content_hash": {
          "type": "string",
          "description": "Keyed HMAC bound to this API key"
        },
        "analyzer": {
          "type": "string"
        },
        "sensitivity": {
          "type": "string"
        },
        "key_id": {
          "type": "string"
        },
        "key_fp": {
          "type": "string",
          "description": "Key fingerprint (first 16 hex chars of SHA-256 of the key)"
        },
        "nonce": {
          "type": "string",
          "description": "Operator challenge, when one was passed with the scan"
        },
        "coverage": {
          "type": "object",
          "description": "What each detector covered (e.g. prompt_injection is partial)"
        },
        "sig_alg": {
          "type": "string"
        },
        "signature": {
          "type": "string",
          "description": "HMAC-SHA256 over the canonical receipt fields"
        },
        "verify_url": {
          "type": "string",
          "description": "Human-readable verification page for this receipt"
        }
      }
    },
    "ScanResultV1": {
      "type": "object",
      "properties": {
        "verdict": {
          "type": "string",
          "enum": [
            "clean",
            "suspicious",
            "malicious"
          ]
        },
        "mode": {
          "type": "string",
          "enum": [
            "detect",
            "enforce"
          ]
        },
        "action": {
          "type": "string",
          "enum": [
            "allow",
            "review",
            "block"
          ],
          "description": "enforce mode only"
        },
        "sensitivity": {
          "type": "string",
          "enum": [
            "low",
            "medium",
            "high"
          ]
        },
        "scores": {
          "type": "object",
          "properties": {
            "prompt_injection": {
              "type": "number"
            },
            "secrets_exposure": {
              "type": "number"
            },
            "pii_disclosure": {
              "type": "number"
            },
            "ssrf_risk": {
              "type": "number"
            }
          }
        },
        "findings": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "class": {
                "type": "string"
              },
              "match_count": {
                "type": "integer"
              },
              "detail": {
                "type": "object"
              }
            }
          }
        },
        "analyzer": {
          "type": "string"
        },
        "content_hash": {
          "type": "string",
          "description": "Keyed HMAC of the scanned content (not correlatable across customers)"
        },
        "scanned_chars": {
          "type": "integer"
        },
        "receipt": {
          "$ref": "#/$defs/ScanReceipt"
        }
      }
    }
  }
}