{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dobby-ai-com/json-schema/dobby-ai-com-policy-schema.json",
  "title": "Policy",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/dobby-ai-com-api-openapi.json#/components/schemas/Policy",
  "type": "object",
  "properties": {
    "policy_id": {
      "type": "string"
    },
    "layer": {
      "type": "integer",
      "enum": [
        1,
        2,
        3,
        4
      ],
      "description": "1=Platform, 2=Org, 3=Tenant, 4=Process"
    },
    "scope_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "null for layer 1; org_id for layer 2; tenant_id for layer 3; workflow_id for layer 4"
    },
    "text": {
      "type": "string"
    },
    "source": {
      "type": "string"
    },
    "framework_ref": {
      "type": [
        "string",
        "null"
      ]
    },
    "severity": {
      "type": "string",
      "enum": [
        "critical",
        "high",
        "medium",
        "low"
      ]
    },
    "is_active": {
      "type": "boolean"
    },
    "version": {
      "type": "integer"
    },
    "authored_by": {
      "type": [
        "string",
        "null"
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}