{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Task-scoped Capability Lease",
  "type": "object",
  "required": [
    "lease_id",
    "subject",
    "workflow_id",
    "operations",
    "origins",
    "objects",
    "max_calls",
    "expires_at",
    "parent_digest"
  ],
  "properties": {
    "lease_id": {
      "type": "string"
    },
    "subject": {
      "type": "string"
    },
    "workflow_id": {
      "type": "string"
    },
    "operations": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string"
      }
    },
    "origins": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string"
      }
    },
    "objects": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "max_calls": {
      "type": "integer",
      "minimum": 1
    },
    "max_amount_aud": {
      "type": "number",
      "minimum": 0
    },
    "expires_at": {
      "type": "string",
      "format": "date-time"
    },
    "parent_digest": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    }
  }
}