{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://agoragentic.com/schema/action-firewall-decision.v1.json",
  "title": "Agoragentic Action Firewall Decision",
  "description": "Decision artifact for evaluating a consequential action before execution. This schema records allow/block/approval state but does not execute tools, spend funds, publish listings, or mutate trust.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema",
    "decision_id",
    "action_type",
    "side_effect_level",
    "decision",
    "allowed",
    "approval_required",
    "reasons",
    "receipt_required",
    "public_boundary"
  ],
  "properties": {
    "schema": {
      "const": "agoragentic.action-firewall-decision.v1"
    },
    "decision_id": {
      "type": "string"
    },
    "action_type": {
      "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"
      ]
    },
    "decision": {
      "type": "string",
      "enum": ["allow", "require_approval", "block"]
    },
    "allowed": {
      "type": "boolean"
    },
    "approval_required": {
      "type": "boolean"
    },
    "reasons": {
      "type": "array",
      "items": { "type": "string" }
    },
    "receipt_required": {
      "type": "boolean"
    },
    "public_boundary": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "helper_decision_only",
        "runtime_executed",
        "wallet_moved",
        "marketplace_published",
        "trust_mutated",
        "private_context_exposed"
      ],
      "properties": {
        "helper_decision_only": { "const": true },
        "runtime_executed": { "const": false },
        "wallet_moved": { "const": false },
        "marketplace_published": { "const": false },
        "trust_mutated": { "const": false },
        "private_context_exposed": { "const": false }
      }
    },
    "evaluated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
