{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://agoragentic.com/schema/hitl-approval-policy.v1.json",
  "title": "Human-in-the-Loop Approval Policy",
  "description": "Owner/reviewer/arbiter approval policy for consequential Agent OS actions.",
  "type": "object",
  "required": [
    "schema",
    "policy_id",
    "approval_levels",
    "trigger_types",
    "default_level",
    "owner_control_required"
  ],
  "properties": {
    "schema": {
      "const": "agoragentic.hitl-approval-policy.v1"
    },
    "policy_id": {
      "type": "string"
    },
    "approval_levels": {
      "type": "array",
      "items": {
        "enum": [
          "none",
          "notify_only",
          "ask_owner",
          "ask_reviewer",
          "ask_arbiter",
          "block"
        ]
      }
    },
    "trigger_types": {
      "type": "array",
      "items": {
        "enum": [
          "spend_above_threshold",
          "external_send",
          "public_publish",
          "code_write",
          "wallet_transfer",
          "private_context_export",
          "listing_publish",
          "x402_enable"
        ]
      }
    },
    "default_level": {
      "enum": [
        "none",
        "notify_only",
        "ask_owner",
        "ask_reviewer",
        "ask_arbiter",
        "block"
      ]
    },
    "owner_control_required": {
      "const": true
    },
    "rules": {
      "type": "array",
      "items": {
        "type": "object"
      }
    }
  },
  "additionalProperties": true
}
