{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/firecracker/json-schema/firecracker-enclave-config-schema.json",
  "title": "EnclaveConfig",
  "description": "Describes the set of enclave-specific configuration options. Boot arguments, vCPU count, and memory size come from the boot source and machine configuration APIs.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/firecracker-enclave-api-openapi.yml#/components/schemas/EnclaveConfig",
  "type": "object",
  "properties": {
    "cpu_ids": {
      "type": "array",
      "minItems": 1,
      "maxItems": 1024,
      "description": "Specific CPU IDs from the Nitro Enclaves CPU pool. When omitted, the kernel selects CPUs from the dynamic pool. When present, the number of IDs must equal the machine vCPU count.",
      "items": {
        "type": "integer",
        "minimum": 0
      }
    },
    "debug_mode": {
      "type": "boolean",
      "default": false,
      "description": "Whether to enable enclave debug mode, which exposes guest serial output through the configured serial output sink."
    },
    "direct_mode": {
      "type": "boolean",
      "default": false,
      "description": "Whether to run in direct, non-confidential mode. The default is confidential mode, which uses per-device data memory buffers (DMBs) sized by each device's `dmb_size_mib`."
    },
    "cpu_overcommit": {
      "type": "boolean",
      "default": false,
      "description": "Whether to use host-scheduled floating vCPUs from the parent's overcommit pool instead of dedicated pinned cores from the Nitro Enclaves CPU pool."
    },
    "cpu_accounting": {
      "type": "boolean",
      "default": false,
      "description": "Whether to attribute each enclave vCPU's guest time to a parent-side thread. Spawns an additional host thread per vCPU, mirroring the vCPU's CPU time, therefore making it host-visible."
    },
    "hotplug_mode": {
      "type": "boolean",
      "default": false,
      "description": "Whether PCIe devices can be attached after the enclave starts."
    },
    "numa_nodes": {
      "type": "array",
      "minItems": 1,
      "maxItems": 1024,
      "description": "Per-parent-NUMA-node placement of vCPUs and memory. When omitted, all vCPUs and memory are placed on parent NUMA node 0. The vCPU and memory totals must equal the machine configuration, and parent NUMA node IDs must be unique.",
      "items": {
        "$ref": "#/$defs/EnclaveNumaNode"
      }
    }
  },
  "$defs": {
    "EnclaveNumaNode": {
      "type": "object",
      "required": [
        "parent_numa",
        "vcpu_count",
        "mem_size_mib"
      ],
      "description": "Placement of a slice of enclave vCPUs and memory on a parent NUMA node.",
      "properties": {
        "parent_numa": {
          "type": "integer",
          "minimum": 0,
          "maximum": 4096,
          "description": "Parent NUMA node ID."
        },
        "vcpu_count": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1024,
          "description": "Number of enclave vCPUs to place on this parent NUMA node. The total across all nodes must equal the machine vCPU count."
        },
        "mem_size_mib": {
          "type": "integer",
          "minimum": 1,
          "description": "Enclave memory in MiB to place on this parent NUMA node. Every entry except the last, after sorting by parent_numa, must be a multiple of 128 MiB."
        }
      }
    }
  }
}