{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/theagentforge-io/json-schema/theagentforge-io-scan-result-schema.json",
  "title": "ScanResult",
  "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/ScanResult",
  "type": "object",
  "required": [
    "verdict",
    "fingerprint",
    "rules_version",
    "counts",
    "findings",
    "page_url",
    "source_url",
    "guarantee"
  ],
  "properties": {
    "verdict": {
      "enum": [
        "clear",
        "caution",
        "flagged"
      ],
      "description": "\"clear\" means no known pattern matched, not that the file is safe."
    },
    "fingerprint": {
      "type": "string",
      "pattern": "^sha256:[0-9a-f]{64}$"
    },
    "rules_version": {
      "type": "string"
    },
    "counts": {
      "$ref": "#/$defs/ScanCounts"
    },
    "findings": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ScanFinding"
      }
    },
    "rules_url": {
      "type": "string",
      "format": "uri"
    },
    "page_url": {
      "type": [
        "string",
        "null"
      ]
    },
    "source_url": {
      "type": [
        "string",
        "null"
      ]
    },
    "bytes": {
      "type": "integer"
    },
    "first_seen": {
      "type": "string",
      "format": "date-time"
    },
    "scans": {
      "type": "integer"
    },
    "guarantee": {
      "const": false
    },
    "share": {
      "$ref": "#/$defs/Share"
    },
    "owner_claim": {
      "$ref": "#/$defs/OwnerClaim"
    }
  },
  "$defs": {
    "OwnerClaim": {
      "type": "object",
      "description": "Where a person links the calling agent to a verified human owner (a web page with one GitHub sign-in). Absent from signed-in answers.",
      "required": [
        "url",
        "what",
        "enables"
      ],
      "properties": {
        "url": {
          "type": "string",
          "format": "uri"
        },
        "what": {
          "type": "string"
        },
        "enables": {
          "type": "array",
          "items": {
            "enum": [
              "forge_report",
              "agent_page",
              "per_agent_check_limit"
            ]
          }
        }
      }
    },
    "ScanCounts": {
      "type": "object",
      "required": [
        "high",
        "medium",
        "low"
      ],
      "properties": {
        "high": {
          "type": "integer"
        },
        "medium": {
          "type": "integer"
        },
        "low": {
          "type": "integer"
        }
      }
    },
    "ScanFinding": {
      "type": "object",
      "required": [
        "rule",
        "family",
        "severity",
        "line",
        "column"
      ],
      "properties": {
        "rule": {
          "type": "string"
        },
        "family": {
          "enum": [
            "exec",
            "secrets",
            "exfil",
            "hidden",
            "injection",
            "persistence",
            "remote",
            "money",
            "destructive",
            "obfuscation",
            "permissions",
            "impersonation"
          ]
        },
        "severity": {
          "enum": [
            "high",
            "medium",
            "low"
          ]
        },
        "line": {
          "type": "integer"
        },
        "column": {
          "type": "integer"
        }
      }
    },
    "Share": {
      "type": "object",
      "description": "A signed, dated record of this answer.",
      "required": [
        "receipt_url",
        "receipt_badge_url",
        "receipt_markdown",
        "page_url",
        "badge_markdown"
      ],
      "properties": {
        "receipt_url": {
          "type": "string",
          "format": "uri"
        },
        "receipt_badge_url": {
          "type": "string",
          "format": "uri"
        },
        "receipt_markdown": {
          "type": "string"
        },
        "page_url": {
          "type": [
            "string",
            "null"
          ]
        },
        "badge_markdown": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  }
}