{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/theagentforge-io/json-schema/theagentforge-io-exposure-result-schema.json",
  "title": "ExposureResult",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/theagentforge-io-api-openapi.json#/components/schemas/ExposureResult",
  "type": "object",
  "required": [
    "source",
    "checked_at",
    "kev_as_of",
    "items",
    "checked",
    "matched",
    "not_checked",
    "matches"
  ],
  "properties": {
    "source": {
      "const": "osv"
    },
    "checked_at": {
      "type": "string",
      "format": "date-time"
    },
    "kev_as_of": {
      "type": [
        "string",
        "null"
      ]
    },
    "items": {
      "type": "integer"
    },
    "checked": {
      "type": "integer"
    },
    "matched": {
      "type": "integer"
    },
    "not_checked": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "ecosystem": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          }
        }
      }
    },
    "matches": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "package",
          "ecosystem",
          "version",
          "status",
          "line",
          "advisories"
        ],
        "properties": {
          "package": {
            "type": "string"
          },
          "ecosystem": {
            "enum": [
              "npm",
              "pypi"
            ]
          },
          "version": {
            "type": "string"
          },
          "status": {
            "enum": [
              "flagged",
              "caution"
            ]
          },
          "line": {
            "type": "string"
          },
          "advisories": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/Advisory"
            }
          }
        }
      }
    }
  },
  "$defs": {
    "Advisory": {
      "type": "object",
      "required": [
        "id",
        "kind",
        "aliases",
        "affects_version",
        "fixed",
        "published",
        "modified",
        "url"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "kind": {
          "enum": [
            "malicious",
            "vulnerability"
          ]
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "affects_version": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "fixed": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "published": {
          "type": [
            "string",
            "null"
          ]
        },
        "modified": {
          "type": [
            "string",
            "null"
          ]
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "exploited_in_wild": {
          "type": "boolean",
          "description": "A CVE alias is on the CISA Known Exploited Vulnerabilities list."
        }
      }
    }
  }
}