{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://agentproof.hatchable.site/standards/autonomous-trust-resolution-v0.1.schema.json",
  "title": "Autonomous Trust Resolution Request v0.1",
  "type": "object",
  "required": [
    "principal",
    "agent",
    "mandate",
    "counterparty",
    "action",
    "transaction"
  ],
  "properties": {
    "principal": {
      "type": "object",
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "type": "string"
        }
      },
      "additionalProperties": true
    },
    "agent": {
      "type": "object",
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "type": "string"
        }
      },
      "additionalProperties": true
    },
    "mandate": {
      "type": "object",
      "required": [
        "scope"
      ],
      "properties": {
        "scope": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        },
        "valid_from": {
          "type": "string",
          "format": "date-time"
        },
        "valid_until": {
          "type": "string",
          "format": "date-time"
        },
        "limits": {
          "type": "object",
          "properties": {
            "max_amount": {
              "oneOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string"
                }
              ]
            },
            "currency": {
              "type": "string"
            },
            "allowed_counterparties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "min_evidence": {
              "type": "integer",
              "minimum": 0
            },
            "min_attestations": {
              "type": "integer",
              "minimum": 0
            },
            "require_recourse_above": {
              "oneOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string"
                }
              ]
            },
            "require_human_above": {
              "oneOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string"
                }
              ]
            }
          },
          "additionalProperties": true
        }
      },
      "additionalProperties": true
    },
    "counterparty": {
      "type": "object",
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "type": "string"
        }
      },
      "additionalProperties": true
    },
    "action": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string"
        },
        "description": {
          "type": "string"
        }
      },
      "additionalProperties": true
    },
    "transaction": {
      "type": "object",
      "properties": {
        "amount": {
          "oneOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ]
        },
        "currency": {
          "type": "string"
        },
        "jurisdiction": {
          "type": "string"
        }
      },
      "additionalProperties": true
    },
    "evidence": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "attestations": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "recourse": {
      "type": "object",
      "properties": {
        "available": {
          "type": "boolean"
        },
        "limit": {
          "oneOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ]
        }
      },
      "additionalProperties": true
    },
    "human_approval": {
      "type": "object",
      "properties": {
        "present": {
          "type": "boolean"
        },
        "ref": {
          "type": "string"
        }
      },
      "additionalProperties": true
    }
  },
  "additionalProperties": true
}