{
  "$id": "https://public-agents.com/schemas/evidence-probe.schema.json",
  "title": "evidence-probe",
  "description": "One unauthenticated, unpaid request and what it answered (registry/evidence/probes/<id>.json)",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "$schema": {
      "type": "string",
      "const": "https://public-agents.com/schemas/evidence-probe.schema.json"
    },
    "schemaVersion": {
      "type": "number",
      "const": 1
    },
    "id": {
      "type": "string",
      "allOf": [
        {
          "pattern": "^(m|cr|p)-\\d{8}-[a-z0-9-]{3,60}$"
        },
        {
          "pattern": "^p-"
        }
      ]
    },
    "subject": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "agent",
            "tool"
          ]
        },
        "id": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "type",
        "id"
      ],
      "additionalProperties": false
    },
    "surface": {
      "type": "string",
      "pattern": "^[Hh][Tt][Tt][Pp][Ss]:\\/\\/",
      "format": "uri"
    },
    "question": {
      "type": "string",
      "enum": [
        "access",
        "payment",
        "disclosure"
      ]
    },
    "request": {
      "type": "object",
      "properties": {
        "method": {
          "type": "string",
          "enum": [
            "GET",
            "HEAD",
            "POST",
            "OPTIONS"
          ]
        },
        "credentials": {
          "type": "string",
          "const": "none"
        },
        "payment": {
          "type": "string",
          "const": "none"
        },
        "from": {
          "type": "string",
          "minLength": 1,
          "maxLength": 120
        },
        "body": {
          "type": "string",
          "minLength": 1,
          "maxLength": 600,
          "pattern": "^(?![\\s\\S]*(?:[bB][eE][aA][rR][eE][rR]\\s+[A-Za-z0-9._~+/=-]{8,}|\\b[eE][yY][jJ][A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]{8,}|\\b[sprkSPRK][kpKP]?[-_](?:[lL][iI][vV][eE]|[tT][eE][sS][tT])?[-_]?[A-Za-z0-9]{16,}|\\b[sS][kK]-[A-Za-z0-9_-]{20,}|\\b[aA][kK][iI][aA][A-Za-z0-9]{16}\\b|\\b[gG][hH][pousrPOUSR]_[A-Za-z0-9]{20,}|\\b[xX][oO][xX][abprABPR]-[A-Za-z0-9-]{10,}))"
        }
      },
      "required": [
        "method",
        "credentials",
        "payment",
        "from"
      ],
      "additionalProperties": false
    },
    "observed": {
      "type": "object",
      "properties": {
        "status": {
          "type": "integer",
          "minimum": 100,
          "maximum": 599
        },
        "headers": {
          "type": "object",
          "propertyNames": {
            "type": "string",
            "pattern": "^(?!(?:authorization|proxy-authorization|cookie|set-cookie|x-api-key|api-key|x-auth-token|x-access-token|x-csrf-token|x-xsrf-token|x-amz-security-token|x-session-token|x-payment|payment-signature)$)[a-z0-9-]+$"
          },
          "additionalProperties": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000,
            "pattern": "^(?![\\s\\S]*(?:[bB][eE][aA][rR][eE][rR]\\s+[A-Za-z0-9._~+/=-]{8,}|\\b[eE][yY][jJ][A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]{8,}|\\b[sprkSPRK][kpKP]?[-_](?:[lL][iI][vV][eE]|[tT][eE][sS][tT])?[-_]?[A-Za-z0-9]{16,}|\\b[sS][kK]-[A-Za-z0-9_-]{20,}|\\b[aA][kK][iI][aA][A-Za-z0-9]{16}\\b|\\b[gG][hH][pousrPOUSR]_[A-Za-z0-9]{20,}|\\b[xX][oO][xX][abprABPR]-[A-Za-z0-9-]{10,}))"
          }
        },
        "decoded": {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 2000,
                "pattern": "^(?![\\s\\S]*(?:[bB][eE][aA][rR][eE][rR]\\s+[A-Za-z0-9._~+/=-]{8,}|\\b[eE][yY][jJ][A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]{8,}|\\b[sprkSPRK][kpKP]?[-_](?:[lL][iI][vV][eE]|[tT][eE][sS][tT])?[-_]?[A-Za-z0-9]{16,}|\\b[sS][kK]-[A-Za-z0-9_-]{20,}|\\b[aA][kK][iI][aA][A-Za-z0-9]{16}\\b|\\b[gG][hH][pousrPOUSR]_[A-Za-z0-9]{20,}|\\b[xX][oO][xX][abprABPR]-[A-Za-z0-9-]{10,}))"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "protocols": {
          "maxItems": 10,
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z0-9](?:[a-z0-9-]{0,30}[a-z0-9])?$"
          }
        }
      },
      "required": [
        "status"
      ],
      "additionalProperties": false
    },
    "finding": {
      "type": "string",
      "minLength": 20,
      "maxLength": 1200
    },
    "conductedBy": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 120
        },
        "github": {
          "type": "string",
          "pattern": "^[A-Za-z0-9](?:[A-Za-z0-9-]{0,37}[A-Za-z0-9])?$"
        },
        "url": {
          "type": "string",
          "pattern": "^[Hh][Tt][Tt][Pp][Ss]:\\/\\/",
          "format": "uri"
        }
      },
      "required": [
        "name",
        "github"
      ],
      "additionalProperties": false
    },
    "independence": {
      "type": "string",
      "enum": [
        "independent",
        "self",
        "vendor-sponsored"
      ]
    },
    "reproducibility": {
      "type": "object",
      "properties": {
        "command": {
          "type": "string",
          "minLength": 1,
          "maxLength": 600,
          "pattern": "^(?![\\s\\S]*(?:[bB][eE][aA][rR][eE][rR]\\s+[A-Za-z0-9._~+/=-]{8,}|\\b[eE][yY][jJ][A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]{8,}|\\b[sprkSPRK][kpKP]?[-_](?:[lL][iI][vV][eE]|[tT][eE][sS][tT])?[-_]?[A-Za-z0-9]{16,}|\\b[sS][kK]-[A-Za-z0-9_-]{20,}|\\b[aA][kK][iI][aA][A-Za-z0-9]{16}\\b|\\b[gG][hH][pousrPOUSR]_[A-Za-z0-9]{20,}|\\b[xX][oO][xX][abprABPR]-[A-Za-z0-9-]{10,}))(?![\\s\\S]*(?:-H\\s*['\"]?\\s*(?:[aA][uU][tT][hH][oO][rR][iI][zZ][aA][tT][iI][oO][nN]|[pP][rR][oO][xX][yY]-[aA][uU][tT][hH][oO][rR][iI][zZ][aA][tT][iI][oO][nN]|[cC][oO][oO][kK][iI][eE]|[xX]-[aA][pP][iI]-[kK][eE][yY]|[aA][pP][iI]-[kK][eE][yY]|[xX]-[aA][uU][tT][hH]-[tT][oO][kK][eE][nN]|[xX]-[aA][cC][cC][eE][sS][sS]-[tT][oO][kK][eE][nN])\\s*:|(?:^|\\s)(?:-u|-U|--user|--proxy-user|--oauth2-bearer)\\s|[?&](?:[aA][pP][iI][_-]?[kK][eE][yY]|[aA][cC][cC][eE][sS][sS][_-]?[tT][oO][kK][eE][nN]|[aA][uU][tT][hH][_-]?[tT][oO][kK][eE][nN]|[tT][oO][kK][eE][nN]|[sS][eE][cC][rR][eE][tT]|[pP][aA][sS][sS][wW][oO][rR][dD]|[pP][aA][sS][sS][wW][dD]|[cC][lL][iI][eE][nN][tT][_-]?[sS][eE][cC][rR][eE][tT])=))"
        },
        "artifactsUrl": {
          "type": "string",
          "pattern": "^[Hh][Tt][Tt][Pp][Ss]:\\/\\/",
          "format": "uri"
        }
      },
      "required": [
        "command"
      ],
      "additionalProperties": false
    },
    "at": {
      "type": "string",
      "pattern": "^(?:\\d{4}-(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|\\d{4}-(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|\\d{4}-02-(?:0[1-9]|1\\d|2[0-8])|(?:\\d\\d(?:0[48]|[2468][048]|[13579][26])|(?:[02468][048]|[13579][26])00)-02-29)T(?:[01]\\d|2[0-3]):[0-5]\\dZ$"
    },
    "disclosure": {
      "type": "object",
      "properties": {
        "affiliation": {
          "type": "string",
          "enum": [
            "none",
            "employee",
            "contractor",
            "investor",
            "operator",
            "partner",
            "other"
          ]
        },
        "affiliationDetail": {
          "type": "string",
          "minLength": 1,
          "maxLength": 300
        },
        "compensation": {
          "type": "string",
          "enum": [
            "none",
            "paid-by-vendor",
            "discounted",
            "credits",
            "other"
          ]
        },
        "compensationDetail": {
          "type": "string",
          "minLength": 1,
          "maxLength": 300
        },
        "reseller": {
          "type": "boolean"
        },
        "resellerDetail": {
          "type": "string",
          "minLength": 1,
          "maxLength": 300
        }
      },
      "required": [
        "affiliation",
        "compensation",
        "reseller"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "updated": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "version": {
      "type": "integer",
      "minimum": 1,
      "maximum": 9007199254740991
    }
  },
  "required": [
    "schemaVersion",
    "id",
    "subject",
    "surface",
    "question",
    "request",
    "observed",
    "finding",
    "conductedBy",
    "independence",
    "reproducibility",
    "at",
    "disclosure",
    "created",
    "updated",
    "version"
  ],
  "additionalProperties": false
}
