{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://agoragentic.com/schema/hitl-risk-card.v1.json",
  "title": "Agoragentic HITL Risk Card",
  "description": "Platform-computed human approval risk card. Approval screens must show data movement, money movement, public exposure, rollback state, and receipt expectations instead of relying on an agent summary alone.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema",
    "risk_card_id",
    "action_summary",
    "side_effect_level",
    "risk_level",
    "approve_all_allowed",
    "data_movement",
    "money_movement",
    "public_exposure",
    "rollback",
    "required_receipt_type",
    "platform_computed",
    "public_boundary"
  ],
  "properties": {
    "schema": {
      "const": "agoragentic.hitl-risk-card.v1"
    },
    "risk_card_id": {
      "type": "string"
    },
    "action_id": {
      "type": ["string", "null"]
    },
    "action_summary": {
      "type": "string"
    },
    "side_effect_level": {
      "type": "string",
      "enum": [
        "read_only",
        "draft_only",
        "internal_write",
        "external_send",
        "code_write",
        "wallet_spend",
        "public_publish",
        "subagent_spawn",
        "policy_change"
      ]
    },
    "risk_level": {
      "type": "string",
      "enum": ["low", "medium", "high", "critical"]
    },
    "approve_all_allowed": {
      "type": "boolean"
    },
    "data_movement": {
      "type": "object",
      "additionalProperties": false,
      "required": ["leaves_boundary", "recipient", "includes_private_context", "includes_secrets"],
      "properties": {
        "leaves_boundary": { "type": "boolean" },
        "recipient": { "type": ["string", "null"] },
        "includes_private_context": { "type": "boolean" },
        "includes_secrets": { "type": "boolean" }
      }
    },
    "money_movement": {
      "type": "object",
      "additionalProperties": false,
      "required": ["wallet_touch", "amount_usdc", "budget_policy_ref"],
      "properties": {
        "wallet_touch": { "type": "boolean" },
        "amount_usdc": { "type": "string" },
        "budget_policy_ref": { "type": ["string", "null"] }
      }
    },
    "public_exposure": {
      "type": "object",
      "additionalProperties": false,
      "required": ["changes_public_state", "exposure_target", "owner_approval_required"],
      "properties": {
        "changes_public_state": { "type": "boolean" },
        "exposure_target": { "type": ["string", "null"] },
        "owner_approval_required": { "type": "boolean" }
      }
    },
    "rollback": {
      "type": "object",
      "additionalProperties": false,
      "required": ["available", "description"],
      "properties": {
        "available": { "type": "boolean" },
        "description": { "type": ["string", "null"] }
      }
    },
    "required_receipt_type": {
      "type": "string"
    },
    "risk_reasons": {
      "type": "array",
      "items": { "type": "string" }
    },
    "platform_computed": {
      "const": true
    },
    "public_boundary": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "helper_card_only",
        "action_executed",
        "approval_recorded",
        "wallet_moved",
        "public_state_changed"
      ],
      "properties": {
        "helper_card_only": { "const": true },
        "action_executed": { "const": false },
        "approval_recorded": { "const": false },
        "wallet_moved": { "const": false },
        "public_state_changed": { "const": false }
      }
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
