{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://agenticworkflowprotocol.org/schema/awp.v1alpha1.json",
  "title": "Agentic Workflow Protocol manifest (v1alpha1)",
  "description": "Structural rules of AWP v1alpha1 (spec/v1alpha1/README.md). Rules that JSON Schema cannot express are listed in schema/README.md as semantic validation rules. Per-kind entry points: #/$defs/Workflow, #/$defs/Agent, #/$defs/Policy.",
  "type": "object",
  "required": [
    "kind"
  ],
  "properties": {
    "kind": {
      "enum": [
        "Workflow",
        "Agent",
        "Policy"
      ]
    }
  },
  "allOf": [
    {
      "if": {
        "properties": {
          "kind": {
            "const": "Workflow"
          }
        },
        "required": [
          "kind"
        ]
      },
      "then": {
        "$ref": "#/$defs/Workflow"
      }
    },
    {
      "if": {
        "properties": {
          "kind": {
            "const": "Agent"
          }
        },
        "required": [
          "kind"
        ]
      },
      "then": {
        "$ref": "#/$defs/Agent"
      }
    },
    {
      "if": {
        "properties": {
          "kind": {
            "const": "Policy"
          }
        },
        "required": [
          "kind"
        ]
      },
      "then": {
        "$ref": "#/$defs/Policy"
      }
    }
  ],
  "$defs": {
    "Name": {
      "description": "Name (spec 3.4).",
      "type": "string",
      "pattern": "^[a-zA-Z][a-zA-Z0-9_-]{0,62}$"
    },
    "Identifier": {
      "description": "Identifier (spec 3.4).",
      "type": "string",
      "pattern": "^[a-z][a-z0-9-]{0,62}$"
    },
    "ActionIdentifier": {
      "description": "Action identifier (spec 5.5.3).",
      "type": "string",
      "pattern": "^[a-zA-Z][a-zA-Z0-9_-]*(\\.[a-zA-Z0-9_-]+)+$"
    },
    "ActionKey": {
      "description": "Action identifier, group identifier or wildcard pattern with a final segment * (spec 5.5.3, 5.5.4).",
      "type": "string",
      "pattern": "^[a-zA-Z][a-zA-Z0-9_-]*(\\.[a-zA-Z0-9_-]+)*(\\.[a-zA-Z0-9_-]+|\\.\\*)$"
    },
    "SemVer": {
      "description": "Semantic Version 2.0.0 (spec 3.5).",
      "type": "string",
      "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$"
    },
    "Duration": {
      "description": "Duration greater than zero (spec 3.6).",
      "type": "string",
      "pattern": "^(?!(?:0+(?:ms|s|m|h|d|w|y))+$)(?:[0-9]+(?:ms|s|m|h|d|w|y))+$"
    },
    "Date": {
      "description": "RFC 3339 full-date (spec 3.7). Calendar validity is a semantic rule.",
      "type": "string",
      "pattern": "^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$"
    },
    "Digest": {
      "description": "Digest <algorithm>:<lowercase hex> (spec 3.8). sha256/sha384/sha512 have fixed lengths; other algorithms are accepted syntactically.",
      "type": "string",
      "pattern": "^(sha256:[0-9a-f]{64}|sha384:[0-9a-f]{96}|sha512:[0-9a-f]{128}|(?!sha256:|sha384:|sha512:)[a-z0-9][a-z0-9_+.-]*:[0-9a-f]+)$"
    },
    "HttpsUrl": {
      "description": "HTTPS URL.",
      "type": "string",
      "pattern": "^https://[^\\s/?#]+([/?#]\\S*)?$"
    },
    "Classification": {
      "description": "Data class (spec 7.2).",
      "enum": [
        "public",
        "internal",
        "confidential",
        "personal",
        "restricted",
        "sensitive",
        "secret"
      ]
    },
    "RiskLevel": {
      "enum": [
        "low",
        "medium",
        "high",
        "critical"
      ]
    },
    "Expression": {
      "description": "Expression-enabled string (spec 3.9): only inputs.<name>, steps.<id>.outputs.<name>, execution.id and execution.environment are allowed inside ${{ }}.",
      "type": "string",
      "pattern": "^(?:(?!\\$\\{\\{)[\\s\\S]|\\$\\{\\{ *(?:inputs\\.[a-zA-Z][a-zA-Z0-9_-]{0,62}|steps\\.[a-z][a-z0-9-]{0,62}\\.outputs\\.[^\\s.{}$]+|execution\\.id|execution\\.environment) *\\}\\})*$"
    },
    "Approver": {
      "description": "Exactly one of role or user (spec 7.6).",
      "type": "object",
      "additionalProperties": false,
      "patternProperties": {
        "^x-": {}
      },
      "properties": {
        "role": {
          "type": "string",
          "minLength": 1
        },
        "user": {
          "type": "string",
          "minLength": 1
        }
      },
      "oneOf": [
        {
          "required": [
            "role"
          ],
          "not": {
            "required": [
              "user"
            ]
          }
        },
        {
          "required": [
            "user"
          ],
          "not": {
            "required": [
              "role"
            ]
          }
        }
      ]
    },
    "SeparationOfDuties": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "rules": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "actorCannotApproveOwnAction": {
                "type": "boolean"
              },
              "initiatorCannotApprove": {
                "type": "boolean"
              },
              "distinctApprovers": {
                "type": "boolean"
              }
            },
            "additionalProperties": false,
            "patternProperties": {
              "^x-": {}
            }
          }
        }
      },
      "additionalProperties": false,
      "patternProperties": {
        "^x-": {}
      }
    },
    "Approval": {
      "description": "Workflow-level approval configuration and approval step payload (spec 7.6).",
      "type": "object",
      "properties": {
        "requiredFor": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ActionKey"
          }
        },
        "approvers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Approver"
          }
        },
        "minApprovals": {
          "type": "integer",
          "minimum": 1
        },
        "timeout": {
          "$ref": "#/$defs/Duration"
        },
        "onTimeout": {
          "enum": [
            "reject",
            "fail"
          ]
        },
        "message": {
          "$ref": "#/$defs/Expression"
        },
        "separationOfDuties": {
          "$ref": "#/$defs/SeparationOfDuties"
        }
      },
      "additionalProperties": false,
      "patternProperties": {
        "^x-": {}
      }
    },
    "Budget": {
      "description": "Budget (spec 5.7). All limits are positive.",
      "type": "object",
      "properties": {
        "maxCostUsd": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "maxSteps": {
          "type": "integer",
          "minimum": 1
        },
        "maxDuration": {
          "$ref": "#/$defs/Duration"
        },
        "resources": {
          "type": "object",
          "properties": {
            "maxTokens": {
              "type": "integer",
              "minimum": 1
            },
            "maxToolCalls": {
              "type": "integer",
              "minimum": 1
            },
            "maxRetries": {
              "type": "integer",
              "minimum": 1
            },
            "maxConcurrency": {
              "type": "integer",
              "minimum": 1
            }
          },
          "additionalProperties": false,
          "patternProperties": {
            "^x-": {}
          }
        }
      },
      "additionalProperties": false,
      "patternProperties": {
        "^x-": {}
      }
    },
    "Permissions": {
      "description": "Permissions (spec 7.5).",
      "type": "object",
      "properties": {
        "default": {
          "enum": [
            "allow",
            "deny"
          ]
        },
        "tools": {
          "type": "object",
          "propertyNames": {
            "pattern": "^[a-zA-Z][a-zA-Z0-9_-]*(\\.[a-zA-Z0-9_-]+)*(\\.[a-zA-Z0-9_-]+|\\.\\*)$"
          },
          "additionalProperties": {
            "type": "object",
            "properties": {
              "allow": {
                "type": "boolean"
              },
              "resources": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/Expression"
                }
              }
            },
            "required": [
              "allow"
            ],
            "additionalProperties": false,
            "patternProperties": {
              "^x-": {}
            }
          }
        },
        "network": {
          "type": "object",
          "properties": {
            "egress": {
              "enum": [
                "allow",
                "deny"
              ]
            },
            "allowHosts": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            }
          },
          "additionalProperties": false,
          "patternProperties": {
            "^x-": {}
          }
        },
        "filesystem": {
          "type": "object",
          "properties": {
            "read": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "write": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            }
          },
          "additionalProperties": false,
          "patternProperties": {
            "^x-": {}
          }
        },
        "secrets": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Name"
          }
        },
        "environments": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "additionalProperties": false,
      "patternProperties": {
        "^x-": {}
      }
    },
    "Model": {
      "description": "Model object (spec 5.4.3).",
      "type": "object",
      "properties": {
        "provider": {
          "type": "string",
          "minLength": 1
        },
        "name": {
          "type": "string",
          "minLength": 1
        },
        "version": {
          "type": "string",
          "minLength": 1
        },
        "region": {
          "type": "string",
          "minLength": 1
        },
        "approval": {
          "type": "object",
          "properties": {
            "status": {
              "enum": [
                "approved",
                "pending",
                "rejected",
                "revoked"
              ]
            },
            "expires": {
              "$ref": "#/$defs/Date"
            },
            "approvedBy": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false,
          "patternProperties": {
            "^x-": {}
          }
        },
        "riskClassification": {
          "$ref": "#/$defs/RiskLevel"
        },
        "evaluation": {
          "type": "object",
          "properties": {
            "status": {
              "enum": [
                "passed",
                "failed",
                "pending",
                "notEvaluated"
              ]
            },
            "ref": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false,
          "patternProperties": {
            "^x-": {}
          }
        },
        "allowedUseCases": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "required": [
        "provider",
        "name"
      ],
      "additionalProperties": false,
      "patternProperties": {
        "^x-": {}
      }
    },
    "PromptRef": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "version": {
          "type": "string",
          "minLength": 1
        },
        "digest": {
          "$ref": "#/$defs/Digest"
        }
      },
      "required": [
        "name",
        "version"
      ],
      "additionalProperties": false,
      "patternProperties": {
        "^x-": {}
      }
    },
    "ToolSource": {
      "description": "Tool source (spec 5.5.2).",
      "type": "object",
      "properties": {
        "type": {
          "enum": [
            "mcp",
            "builtin"
          ]
        },
        "server": {
          "$ref": "#/$defs/Name"
        },
        "name": {
          "type": "string",
          "minLength": 1
        },
        "tools": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "required": [
        "type"
      ],
      "additionalProperties": false,
      "patternProperties": {
        "^x-": {}
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "type": {
                "const": "mcp"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "required": [
              "server"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "builtin"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "required": [
              "name"
            ]
          }
        }
      ]
    },
    "McpServer": {
      "description": "MCP server (spec 5.5.1).",
      "type": "object",
      "properties": {
        "name": {
          "$ref": "#/$defs/Name"
        },
        "transport": {
          "enum": [
            "stdio",
            "streamable-http"
          ]
        },
        "url": {
          "$ref": "#/$defs/HttpsUrl"
        },
        "image": {
          "type": "string",
          "minLength": 1
        },
        "version": {
          "type": "string",
          "minLength": 1
        },
        "auth": {
          "type": "object",
          "properties": {
            "secretRef": {
              "$ref": "#/$defs/Name"
            }
          },
          "required": [
            "secretRef"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-": {}
          }
        }
      },
      "required": [
        "name",
        "transport"
      ],
      "additionalProperties": false,
      "patternProperties": {
        "^x-": {}
      },
      "if": {
        "properties": {
          "transport": {
            "const": "streamable-http"
          }
        },
        "required": [
          "transport"
        ]
      },
      "then": {
        "required": [
          "url"
        ]
      }
    },
    "Secret": {
      "description": "Secret declaration (spec 7.9). Secret values never appear in manifests.",
      "type": "object",
      "properties": {
        "name": {
          "$ref": "#/$defs/Name"
        },
        "source": {
          "type": "string",
          "minLength": 1
        },
        "key": {
          "type": "string",
          "minLength": 1
        },
        "scope": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "required": [
        "name",
        "source"
      ],
      "additionalProperties": false,
      "patternProperties": {
        "^x-": {}
      }
    },
    "ActionGroups": {
      "description": "Action groups (spec 5.5.4). Nesting is a semantic rule.",
      "type": "object",
      "propertyNames": {
        "pattern": "^[a-zA-Z][a-zA-Z0-9_-]*(\\.[a-zA-Z0-9_-]+)+$"
      },
      "additionalProperties": {
        "type": "array",
        "items": {
          "$ref": "#/$defs/ActionIdentifier"
        }
      }
    },
    "InlineAgent": {
      "description": "Inline agent (spec 5.4.1).",
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/Identifier"
        },
        "model": {
          "$ref": "#/$defs/Model"
        },
        "instructions": {
          "type": "string"
        },
        "promptRef": {
          "$ref": "#/$defs/PromptRef"
        },
        "tools": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ToolSource"
          }
        },
        "permissions": {
          "$ref": "#/$defs/Permissions"
        },
        "budget": {
          "$ref": "#/$defs/Budget"
        }
      },
      "required": [
        "id",
        "model"
      ],
      "additionalProperties": false,
      "patternProperties": {
        "^x-": {}
      },
      "not": {
        "required": [
          "instructions",
          "promptRef"
        ]
      }
    },
    "AgentReference": {
      "description": "Agent reference (spec 5.4.2).",
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/Identifier"
        },
        "ref": {
          "type": "object",
          "properties": {
            "name": {
              "$ref": "#/$defs/Name"
            },
            "version": {
              "$ref": "#/$defs/SemVer"
            },
            "digest": {
              "$ref": "#/$defs/Digest"
            }
          },
          "required": [
            "name",
            "version"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-": {}
          }
        },
        "permissions": {
          "$ref": "#/$defs/Permissions"
        },
        "budget": {
          "$ref": "#/$defs/Budget"
        }
      },
      "required": [
        "id",
        "ref"
      ],
      "additionalProperties": false,
      "patternProperties": {
        "^x-": {}
      }
    },
    "RemoteAgent": {
      "description": "Remote agent over A2A (spec 5.4.4).",
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/Identifier"
        },
        "protocol": {
          "const": "a2a"
        },
        "endpoint": {
          "$ref": "#/$defs/HttpsUrl"
        },
        "agentCard": {
          "type": "object",
          "properties": {
            "url": {
              "$ref": "#/$defs/HttpsUrl"
            },
            "digest": {
              "$ref": "#/$defs/Digest"
            }
          },
          "required": [
            "url"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-": {}
          }
        },
        "auth": {
          "type": "object",
          "properties": {
            "secretRef": {
              "$ref": "#/$defs/Name"
            }
          },
          "required": [
            "secretRef"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-": {}
          }
        }
      },
      "required": [
        "id",
        "protocol",
        "endpoint"
      ],
      "additionalProperties": false,
      "patternProperties": {
        "^x-": {}
      }
    },
    "AgentEntry": {
      "description": "One entry of spec.agents: agent reference if it has ref, remote agent if it has protocol, otherwise inline agent (spec 5.4).",
      "type": "object",
      "required": [
        "id"
      ],
      "if": {
        "required": [
          "ref"
        ]
      },
      "then": {
        "$ref": "#/$defs/AgentReference"
      },
      "else": {
        "if": {
          "required": [
            "protocol"
          ]
        },
        "then": {
          "$ref": "#/$defs/RemoteAgent"
        },
        "else": {
          "$ref": "#/$defs/InlineAgent"
        }
      }
    },
    "Trigger": {
      "description": "Trigger (spec 5.2).",
      "type": "object",
      "properties": {
        "type": {
          "enum": [
            "manual",
            "schedule",
            "event"
          ]
        },
        "cron": {
          "type": "string",
          "pattern": "^\\S+(\\s+\\S+){4}$"
        },
        "timezone": {
          "type": "string",
          "minLength": 1
        },
        "source": {
          "type": "string",
          "minLength": 1
        },
        "eventType": {
          "type": "string",
          "minLength": 1
        },
        "filter": {
          "type": "object",
          "propertyNames": {
            "pattern": "^.+$"
          },
          "additionalProperties": {
            "type": "string"
          }
        }
      },
      "required": [
        "type"
      ],
      "additionalProperties": false,
      "patternProperties": {
        "^x-": {}
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "type": {
                "const": "manual"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "not": {
              "anyOf": [
                {
                  "required": [
                    "cron"
                  ]
                },
                {
                  "required": [
                    "timezone"
                  ]
                },
                {
                  "required": [
                    "source"
                  ]
                },
                {
                  "required": [
                    "eventType"
                  ]
                },
                {
                  "required": [
                    "filter"
                  ]
                }
              ]
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "schedule"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "required": [
              "cron"
            ],
            "not": {
              "anyOf": [
                {
                  "required": [
                    "source"
                  ]
                },
                {
                  "required": [
                    "eventType"
                  ]
                },
                {
                  "required": [
                    "filter"
                  ]
                }
              ]
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "event"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "required": [
              "source",
              "eventType"
            ],
            "not": {
              "anyOf": [
                {
                  "required": [
                    "cron"
                  ]
                },
                {
                  "required": [
                    "timezone"
                  ]
                }
              ]
            }
          }
        }
      ]
    },
    "Input": {
      "description": "Workflow input (spec 5.3).",
      "type": "object",
      "properties": {
        "name": {
          "$ref": "#/$defs/Name"
        },
        "type": {
          "enum": [
            "string",
            "integer",
            "number",
            "boolean",
            "object",
            "array",
            "artifact"
          ]
        },
        "required": {
          "type": "boolean"
        },
        "default": {},
        "description": {
          "type": "string"
        },
        "pattern": {
          "type": "string"
        },
        "enum": {
          "type": "array",
          "items": {}
        },
        "classification": {
          "$ref": "#/$defs/Classification"
        }
      },
      "required": [
        "name",
        "type"
      ],
      "additionalProperties": false,
      "patternProperties": {
        "^x-": {}
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "type": {
                "const": "string"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "default": {
                "type": "string"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "integer"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "default": {
                "type": "integer"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "number"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "default": {
                "type": "number"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "boolean"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "default": {
                "type": "boolean"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "object"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "default": {
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "array"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "default": {
                "type": "array"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "required": {
                "const": true
              }
            },
            "required": [
              "required"
            ]
          },
          "then": {
            "not": {
              "required": [
                "default"
              ]
            }
          }
        }
      ]
    },
    "Step": {
      "description": "Workflow step (spec 5.6).",
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/Identifier"
        },
        "type": {
          "enum": [
            "agent",
            "command",
            "approval"
          ]
        },
        "dependsOn": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Identifier"
          }
        },
        "timeout": {
          "$ref": "#/$defs/Duration"
        },
        "retries": {
          "type": "integer",
          "minimum": 0
        },
        "outputs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1
              },
              "classification": {
                "$ref": "#/$defs/Classification"
              },
              "description": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false,
            "patternProperties": {
              "^x-": {}
            }
          }
        },
        "budget": {
          "$ref": "#/$defs/Budget"
        },
        "agent": {
          "$ref": "#/$defs/Identifier"
        },
        "task": {
          "$ref": "#/$defs/Expression"
        },
        "command": {
          "type": "string",
          "minLength": 1
        },
        "image": {
          "type": "string",
          "minLength": 1
        },
        "env": {
          "type": "object",
          "propertyNames": {
            "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
          },
          "additionalProperties": {
            "$ref": "#/$defs/Expression"
          }
        },
        "workingDir": {
          "type": "string",
          "minLength": 1
        },
        "approval": {
          "$ref": "#/$defs/Approval"
        }
      },
      "required": [
        "id"
      ],
      "additionalProperties": false,
      "patternProperties": {
        "^x-": {}
      },
      "if": {
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "const": "command"
          }
        }
      },
      "then": {
        "required": [
          "command"
        ],
        "not": {
          "anyOf": [
            {
              "required": [
                "agent"
              ]
            },
            {
              "required": [
                "task"
              ]
            },
            {
              "required": [
                "approval"
              ]
            }
          ]
        }
      },
      "else": {
        "if": {
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "const": "approval"
            }
          }
        },
        "then": {
          "required": [
            "approval"
          ],
          "not": {
            "anyOf": [
              {
                "required": [
                  "agent"
                ]
              },
              {
                "required": [
                  "task"
                ]
              },
              {
                "required": [
                  "command"
                ]
              },
              {
                "required": [
                  "image"
                ]
              },
              {
                "required": [
                  "env"
                ]
              },
              {
                "required": [
                  "workingDir"
                ]
              }
            ]
          }
        },
        "else": {
          "required": [
            "agent"
          ],
          "not": {
            "anyOf": [
              {
                "required": [
                  "command"
                ]
              },
              {
                "required": [
                  "image"
                ]
              },
              {
                "required": [
                  "env"
                ]
              },
              {
                "required": [
                  "workingDir"
                ]
              },
              {
                "required": [
                  "approval"
                ]
              }
            ]
          }
        }
      }
    },
    "DataPolicy": {
      "description": "Data policy (spec 7.2, 7.3).",
      "type": "object",
      "properties": {
        "classification": {
          "$ref": "#/$defs/Classification"
        },
        "inputs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1
              },
              "classification": {
                "$ref": "#/$defs/Classification"
              }
            },
            "required": [
              "name",
              "classification"
            ],
            "additionalProperties": false,
            "patternProperties": {
              "^x-": {}
            }
          }
        },
        "outputs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1
              },
              "classification": {
                "$ref": "#/$defs/Classification"
              }
            },
            "required": [
              "name",
              "classification"
            ],
            "additionalProperties": false,
            "patternProperties": {
              "^x-": {}
            }
          }
        },
        "restrictions": {
          "type": "object",
          "properties": {
            "externalTransfer": {
              "enum": [
                "allow",
                "deny"
              ]
            }
          },
          "additionalProperties": false,
          "patternProperties": {
            "^x-": {}
          }
        },
        "residency": {
          "type": "object",
          "properties": {
            "allowed": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            }
          },
          "additionalProperties": false,
          "patternProperties": {
            "^x-": {}
          }
        },
        "processing": {
          "type": "object",
          "properties": {
            "allowedProviders": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "forbiddenProviders": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            }
          },
          "additionalProperties": false,
          "patternProperties": {
            "^x-": {}
          }
        }
      },
      "additionalProperties": false,
      "patternProperties": {
        "^x-": {}
      }
    },
    "ModelPolicy": {
      "description": "Model policy (spec 7.4).",
      "type": "object",
      "properties": {
        "allowedProviders": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "allowedModels": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "forbiddenModels": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "requirements": {
          "type": "object",
          "properties": {
            "approvalStatus": {
              "enum": [
                "approved",
                "pending",
                "rejected",
                "revoked"
              ]
            },
            "encryption": {
              "type": "boolean"
            },
            "region": {
              "type": "string",
              "minLength": 1
            },
            "evaluationStatus": {
              "enum": [
                "passed",
                "failed",
                "pending",
                "notEvaluated"
              ]
            }
          },
          "additionalProperties": false,
          "patternProperties": {
            "^x-": {}
          }
        }
      },
      "additionalProperties": false,
      "patternProperties": {
        "^x-": {}
      }
    },
    "Policies": {
      "description": "Workflow policy shorthands and includes (spec 8.1).",
      "type": "object",
      "properties": {
        "git": {
          "type": "object",
          "properties": {
            "allowPush": {
              "type": "boolean"
            },
            "allowForcePush": {
              "type": "boolean"
            }
          },
          "additionalProperties": false,
          "patternProperties": {
            "^x-": {}
          }
        },
        "pullRequest": {
          "type": "object",
          "properties": {
            "allowCreate": {
              "type": "boolean"
            }
          },
          "additionalProperties": false,
          "patternProperties": {
            "^x-": {}
          }
        },
        "merge": {
          "type": "object",
          "properties": {
            "allow": {
              "type": "boolean"
            }
          },
          "additionalProperties": false,
          "patternProperties": {
            "^x-": {}
          }
        },
        "production": {
          "type": "object",
          "properties": {
            "allow": {
              "type": "boolean"
            }
          },
          "additionalProperties": false,
          "patternProperties": {
            "^x-": {}
          }
        },
        "include": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "$ref": "#/$defs/Name"
              },
              "version": {
                "$ref": "#/$defs/SemVer"
              },
              "digest": {
                "$ref": "#/$defs/Digest"
              }
            },
            "required": [
              "name",
              "version"
            ],
            "additionalProperties": false,
            "patternProperties": {
              "^x-": {}
            }
          }
        }
      },
      "additionalProperties": false,
      "patternProperties": {
        "^x-": {}
      }
    },
    "Audit": {
      "description": "Audit configuration (spec 10.2).",
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "payload": {
          "enum": [
            "metadata",
            "full"
          ]
        },
        "integrity": {
          "type": "object",
          "properties": {
            "mode": {
              "enum": [
                "none",
                "hash-chain",
                "signed"
              ]
            }
          },
          "additionalProperties": false,
          "patternProperties": {
            "^x-": {}
          }
        },
        "retention": {
          "type": "object",
          "properties": {
            "duration": {
              "$ref": "#/$defs/Duration"
            }
          },
          "additionalProperties": false,
          "patternProperties": {
            "^x-": {}
          }
        }
      },
      "additionalProperties": false,
      "patternProperties": {
        "^x-": {}
      }
    },
    "Environments": {
      "description": "Environments (spec 7.10). Keys are organizational environment names.",
      "type": "object",
      "propertyNames": {
        "pattern": "^.+$"
      },
      "additionalProperties": {
        "type": "object",
        "properties": {
          "autonomy": {
            "enum": [
              "unrestricted",
              "controlled",
              "approval-required",
              "prohibited"
            ]
          },
          "autoApprove": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/ActionKey"
            }
          }
        },
        "required": [
          "autonomy"
        ],
        "additionalProperties": false,
        "patternProperties": {
          "^x-": {}
        }
      }
    },
    "Owner": {
      "description": "Ownership (spec 7.1): a team name (shorthand) or an object.",
      "oneOf": [
        {
          "type": "string",
          "minLength": 1
        },
        {
          "type": "object",
          "properties": {
            "team": {
              "type": "string",
              "minLength": 1
            },
            "contact": {
              "type": "string"
            },
            "businessOwner": {
              "type": "string"
            },
            "technicalOwner": {
              "type": "string"
            },
            "dataOwner": {
              "type": "string"
            }
          },
          "required": [
            "team"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-": {}
          }
        }
      ]
    },
    "Metadata": {
      "description": "Metadata common to all kinds (spec 4).",
      "type": "object",
      "properties": {
        "name": {
          "$ref": "#/$defs/Name"
        },
        "version": {
          "$ref": "#/$defs/SemVer"
        },
        "description": {
          "type": "string"
        },
        "owner": {
          "$ref": "#/$defs/Owner"
        },
        "classification": {
          "$ref": "#/$defs/Classification"
        },
        "purpose": {
          "type": "string"
        },
        "risk": {
          "type": "object",
          "properties": {
            "level": {
              "$ref": "#/$defs/RiskLevel"
            },
            "category": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            }
          },
          "required": [
            "level"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-": {}
          }
        },
        "labels": {
          "type": "object",
          "propertyNames": {
            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._/-]{0,127}$"
          },
          "additionalProperties": {
            "type": "string"
          }
        },
        "annotations": {
          "type": "object",
          "propertyNames": {
            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._/-]{0,127}$"
          },
          "additionalProperties": {
            "type": "string"
          }
        },
        "integrity": {
          "type": "object",
          "properties": {
            "digest": {
              "$ref": "#/$defs/Digest"
            }
          },
          "required": [
            "digest"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-": {}
          }
        },
        "signature": {
          "type": "object",
          "properties": {
            "format": {
              "type": "string",
              "minLength": 1
            },
            "ref": {
              "type": "string",
              "minLength": 1
            },
            "identity": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false,
          "patternProperties": {
            "^x-": {}
          }
        },
        "provenance": {
          "type": "object",
          "properties": {
            "format": {
              "type": "string",
              "minLength": 1
            },
            "ref": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false,
          "patternProperties": {
            "^x-": {}
          }
        }
      },
      "required": [
        "name",
        "version",
        "owner"
      ],
      "additionalProperties": false,
      "patternProperties": {
        "^x-": {}
      }
    },
    "WorkflowSpec": {
      "description": "spec of kind Workflow (spec 5.1).",
      "type": "object",
      "properties": {
        "triggers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Trigger"
          }
        },
        "inputs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Input"
          }
        },
        "budget": {
          "$ref": "#/$defs/Budget"
        },
        "agents": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AgentEntry"
          }
        },
        "mcpServers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/McpServer"
          }
        },
        "actionGroups": {
          "$ref": "#/$defs/ActionGroups"
        },
        "workflow": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Step"
          }
        },
        "secrets": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Secret"
          }
        },
        "environment": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-": {}
          }
        },
        "environments": {
          "$ref": "#/$defs/Environments"
        },
        "permissions": {
          "$ref": "#/$defs/Permissions"
        },
        "dataPolicy": {
          "$ref": "#/$defs/DataPolicy"
        },
        "modelPolicy": {
          "$ref": "#/$defs/ModelPolicy"
        },
        "approval": {
          "$ref": "#/$defs/Approval"
        },
        "policies": {
          "$ref": "#/$defs/Policies"
        },
        "audit": {
          "$ref": "#/$defs/Audit"
        }
      },
      "required": [
        "agents",
        "workflow"
      ],
      "additionalProperties": false,
      "patternProperties": {
        "^x-": {}
      }
    },
    "AgentSpec": {
      "description": "spec of kind Agent (spec 6).",
      "type": "object",
      "properties": {
        "model": {
          "$ref": "#/$defs/Model"
        },
        "instructions": {
          "type": "string"
        },
        "promptRef": {
          "$ref": "#/$defs/PromptRef"
        },
        "tools": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ToolSource"
          }
        },
        "mcpServers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/McpServer"
          }
        },
        "actionGroups": {
          "$ref": "#/$defs/ActionGroups"
        },
        "permissions": {
          "$ref": "#/$defs/Permissions"
        },
        "budget": {
          "$ref": "#/$defs/Budget"
        },
        "secrets": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Secret"
          }
        }
      },
      "required": [
        "model"
      ],
      "additionalProperties": false,
      "patternProperties": {
        "^x-": {}
      },
      "not": {
        "required": [
          "instructions",
          "promptRef"
        ]
      }
    },
    "Condition": {
      "description": "Policy rule conditions (spec 8.3). Unknown attributes are rejected; ordering operators are limited to data.classification and risk.level.",
      "type": "object",
      "minProperties": 1,
      "additionalProperties": false,
      "properties": {
        "action": {
          "oneOf": [
            {
              "$ref": "#/$defs/ActionKey"
            },
            {
              "type": "object",
              "properties": {
                "in": {
                  "type": "array",
                  "items": {
                    "$ref": "#/$defs/ActionKey"
                  }
                },
                "notIn": {
                  "type": "array",
                  "items": {
                    "$ref": "#/$defs/ActionKey"
                  }
                },
                "equals": {
                  "$ref": "#/$defs/ActionKey"
                },
                "notEquals": {
                  "$ref": "#/$defs/ActionKey"
                }
              },
              "additionalProperties": false,
              "patternProperties": {
                "^x-": {}
              },
              "minProperties": 1
            }
          ]
        },
        "environment.name": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "object",
              "properties": {
                "in": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "notIn": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "equals": {
                  "type": "string",
                  "minLength": 1
                },
                "notEquals": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false,
              "patternProperties": {
                "^x-": {}
              },
              "minProperties": 1
            }
          ]
        },
        "risk.level": {
          "oneOf": [
            {
              "$ref": "#/$defs/RiskLevel"
            },
            {
              "type": "object",
              "properties": {
                "in": {
                  "type": "array",
                  "items": {
                    "$ref": "#/$defs/RiskLevel"
                  }
                },
                "notIn": {
                  "type": "array",
                  "items": {
                    "$ref": "#/$defs/RiskLevel"
                  }
                },
                "equals": {
                  "$ref": "#/$defs/RiskLevel"
                },
                "notEquals": {
                  "$ref": "#/$defs/RiskLevel"
                },
                "gt": {
                  "$ref": "#/$defs/RiskLevel"
                },
                "gte": {
                  "$ref": "#/$defs/RiskLevel"
                },
                "lt": {
                  "$ref": "#/$defs/RiskLevel"
                },
                "lte": {
                  "$ref": "#/$defs/RiskLevel"
                }
              },
              "additionalProperties": false,
              "patternProperties": {
                "^x-": {}
              },
              "minProperties": 1
            }
          ]
        },
        "data.classification": {
          "oneOf": [
            {
              "$ref": "#/$defs/Classification"
            },
            {
              "type": "object",
              "properties": {
                "in": {
                  "type": "array",
                  "items": {
                    "$ref": "#/$defs/Classification"
                  }
                },
                "notIn": {
                  "type": "array",
                  "items": {
                    "$ref": "#/$defs/Classification"
                  }
                },
                "equals": {
                  "$ref": "#/$defs/Classification"
                },
                "notEquals": {
                  "$ref": "#/$defs/Classification"
                },
                "gt": {
                  "$ref": "#/$defs/Classification"
                },
                "gte": {
                  "$ref": "#/$defs/Classification"
                },
                "lt": {
                  "$ref": "#/$defs/Classification"
                },
                "lte": {
                  "$ref": "#/$defs/Classification"
                }
              },
              "additionalProperties": false,
              "patternProperties": {
                "^x-": {}
              },
              "minProperties": 1
            }
          ]
        },
        "destination.provider": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "object",
              "properties": {
                "in": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "notIn": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "equals": {
                  "type": "string",
                  "minLength": 1
                },
                "notEquals": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false,
              "patternProperties": {
                "^x-": {}
              },
              "minProperties": 1
            }
          ]
        },
        "destination.region": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "object",
              "properties": {
                "in": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "notIn": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "equals": {
                  "type": "string",
                  "minLength": 1
                },
                "notEquals": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false,
              "patternProperties": {
                "^x-": {}
              },
              "minProperties": 1
            }
          ]
        },
        "model.provider": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "object",
              "properties": {
                "in": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "notIn": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "equals": {
                  "type": "string",
                  "minLength": 1
                },
                "notEquals": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false,
              "patternProperties": {
                "^x-": {}
              },
              "minProperties": 1
            }
          ]
        },
        "model.name": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "object",
              "properties": {
                "in": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "notIn": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "equals": {
                  "type": "string",
                  "minLength": 1
                },
                "notEquals": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false,
              "patternProperties": {
                "^x-": {}
              },
              "minProperties": 1
            }
          ]
        },
        "actor.type": {
          "oneOf": [
            {
              "enum": [
                "agent",
                "human",
                "runtime",
                "system"
              ]
            },
            {
              "type": "object",
              "properties": {
                "in": {
                  "type": "array",
                  "items": {
                    "enum": [
                      "agent",
                      "human",
                      "runtime",
                      "system"
                    ]
                  }
                },
                "notIn": {
                  "type": "array",
                  "items": {
                    "enum": [
                      "agent",
                      "human",
                      "runtime",
                      "system"
                    ]
                  }
                },
                "equals": {
                  "enum": [
                    "agent",
                    "human",
                    "runtime",
                    "system"
                  ]
                },
                "notEquals": {
                  "enum": [
                    "agent",
                    "human",
                    "runtime",
                    "system"
                  ]
                }
              },
              "additionalProperties": false,
              "patternProperties": {
                "^x-": {}
              },
              "minProperties": 1
            }
          ]
        },
        "workflow.name": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "object",
              "properties": {
                "in": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "notIn": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "equals": {
                  "type": "string",
                  "minLength": 1
                },
                "notEquals": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false,
              "patternProperties": {
                "^x-": {}
              },
              "minProperties": 1
            }
          ]
        },
        "step.id": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "object",
              "properties": {
                "in": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "notIn": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "equals": {
                  "type": "string",
                  "minLength": 1
                },
                "notEquals": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false,
              "patternProperties": {
                "^x-": {}
              },
              "minProperties": 1
            }
          ]
        },
        "agent.id": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "object",
              "properties": {
                "in": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "notIn": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "equals": {
                  "type": "string",
                  "minLength": 1
                },
                "notEquals": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false,
              "patternProperties": {
                "^x-": {}
              },
              "minProperties": 1
            }
          ]
        }
      }
    },
    "Rule": {
      "description": "Policy rule (spec 8.2).",
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/Identifier"
        },
        "when": {
          "$ref": "#/$defs/Condition"
        },
        "effect": {
          "enum": [
            "deny",
            "requireApproval"
          ]
        },
        "approval": {
          "type": "object",
          "properties": {
            "approvers": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/Approver"
              }
            },
            "minApprovals": {
              "type": "integer",
              "minimum": 1
            },
            "timeout": {
              "$ref": "#/$defs/Duration"
            },
            "onTimeout": {
              "enum": [
                "reject",
                "fail"
              ]
            }
          },
          "additionalProperties": false,
          "patternProperties": {
            "^x-": {}
          }
        },
        "message": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "when",
        "effect"
      ],
      "additionalProperties": false,
      "patternProperties": {
        "^x-": {}
      },
      "if": {
        "properties": {
          "effect": {
            "const": "requireApproval"
          }
        },
        "required": [
          "effect"
        ]
      },
      "then": {
        "required": [
          "approval"
        ]
      }
    },
    "PolicySpec": {
      "description": "spec of kind Policy (spec 8.2).",
      "type": "object",
      "properties": {
        "rules": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Rule"
          }
        }
      },
      "required": [
        "rules"
      ],
      "additionalProperties": false,
      "patternProperties": {
        "^x-": {}
      }
    },
    "Workflow": {
      "description": "A complete manifest of kind Workflow (spec 3.2, 5).",
      "type": "object",
      "properties": {
        "apiVersion": {
          "const": "awp.agenticworkflowprotocol.org/v1alpha1"
        },
        "kind": {
          "const": "Workflow"
        },
        "metadata": {
          "$ref": "#/$defs/Metadata"
        },
        "spec": {
          "$ref": "#/$defs/WorkflowSpec"
        }
      },
      "required": [
        "apiVersion",
        "kind",
        "metadata",
        "spec"
      ],
      "additionalProperties": false,
      "patternProperties": {
        "^x-": {}
      }
    },
    "Agent": {
      "description": "A complete manifest of kind Agent (spec 3.2, 6).",
      "type": "object",
      "properties": {
        "apiVersion": {
          "const": "awp.agenticworkflowprotocol.org/v1alpha1"
        },
        "kind": {
          "const": "Agent"
        },
        "metadata": {
          "$ref": "#/$defs/Metadata"
        },
        "spec": {
          "$ref": "#/$defs/AgentSpec"
        }
      },
      "required": [
        "apiVersion",
        "kind",
        "metadata",
        "spec"
      ],
      "additionalProperties": false,
      "patternProperties": {
        "^x-": {}
      }
    },
    "Policy": {
      "description": "A complete manifest of kind Policy (spec 3.2, 8.2).",
      "type": "object",
      "properties": {
        "apiVersion": {
          "const": "awp.agenticworkflowprotocol.org/v1alpha1"
        },
        "kind": {
          "const": "Policy"
        },
        "metadata": {
          "$ref": "#/$defs/Metadata"
        },
        "spec": {
          "$ref": "#/$defs/PolicySpec"
        }
      },
      "required": [
        "apiVersion",
        "kind",
        "metadata",
        "spec"
      ],
      "additionalProperties": false,
      "patternProperties": {
        "^x-": {}
      }
    }
  }
}
