---
updatedAt: 2026-08-17T17:12:51.000Z
agentTools:
  siteIndex: https://docs.jfrog.com/llms.txt
  projectIndex: https://docs.jfrog.com/governance/llms.txt
---

# List all rules

Retrieve a paginated list of all rules in the system.
This endpoint supports filtering by template category and other criteria.

**Expand Parameter:**
- Use `expand=template` to include complete template details with each rule


# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "JFrog Unified Policy Service APIs",
    "description": "JFrog Unified Policy Service APIs for managing policies across the JFrog Platform.\n\nThis API provides endpoints for creating, updating, and managing policies\nthat can be applied to various JFrog platform resources.\n\n## Authentication\nAll API requests require a valid JWT bearer token in the Authorization header.\n",
    "version": "1.0.0",
    "contact": {
      "name": "JFrog Support",
      "url": "https://jfrog.com/contact-us/",
      "email": "support@jfrog.com"
    },
    "license": {
      "name": "JFrog Terms of Service",
      "url": "https://jfrog.com/terms-and-conditions/"
    }
  },
  "servers": [
    {
      "url": "https://api.jfrog.com/unifiedpolicy/api/v1",
      "description": "JFrog Unified Policy Service API"
    }
  ],
  "tags": [
    {
      "name": "rule",
      "description": "rules to use in a policy."
    }
  ],
  "paths": {
    "/rules": {
      "get": {
        "summary": "List all rules",
        "description": "Retrieve a paginated list of all rules in the system.\nThis endpoint supports filtering by template category and other criteria.\n\n**Expand Parameter:**\n- Use `expand=template` to include complete template details with each rule\n",
        "tags": [
          "rule"
        ],
        "operationId": "rulesList",
        "parameters": [
          {
            "$ref": "#/components/parameters/idQueryParam"
          },
          {
            "$ref": "#/components/parameters/nameQueryParam"
          },
          {
            "$ref": "#/components/parameters/ruleTemplateDataSourceQueryParam"
          },
          {
            "$ref": "#/components/parameters/ruleTemplateScannersQueryParam"
          },
          {
            "$ref": "#/components/parameters/ruleTemplateCategoryQueryParam"
          },
          {
            "$ref": "#/components/parameters/ruleExpandQueryParam"
          },
          {
            "$ref": "#/components/parameters/pageQueryParam"
          },
          {
            "$ref": "#/components/parameters/limitQueryParam"
          },
          {
            "$ref": "#/components/parameters/ruleSortByParam"
          },
          {
            "$ref": "#/components/parameters/sortOrderQueryParam"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/RulePaginatedResponse"
          },
          "400": {
            "$ref": "#/components/responses/BadRequestError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "unifiedPolicyAuth": [
              "rule:read"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "description": "JWT Bearer token authentication",
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      },
      "unifiedPolicyAuth": {
        "description": "Unified Policy OAuth2 security scheme defining required permission scopes.\nUses JFrog's permission scope format: <resource-type>:<target>:<action>\n\nWhile OAuth2 is defined here for permission documentation, the actual \nimplementation uses JWT Bearer tokens transported via Authorization header.\n\nPermission scopes follow JFrog's standard format:\n- policy:*:read - Read access to all policies\n- policy:project-key:write - Write access to project-specific policies\n- template:*:manage - Full management access to all templates\n- rule:rule-id:delete - Delete access to specific rule\n",
        "type": "oauth2",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://your-jfrog-instance.com/access/oauth/authorize",
            "tokenUrl": "https://your-domain.jfrog.io/access/oauth/token",
            "scopes": {
              "policy:read": "Read access to policies",
              "policy:manage": "Full management access to policies",
              "policy:*:read": "Read access to all policies",
              "policy:*:write": "Write access to all policies",
              "policy:*:delete": "Delete access to all policies",
              "policy:*:manage": "Full management access to all policies",
              "policy:*:execute": "Execute/evaluate all policies",
              "policy:project:read": "Read access to project-scoped policies",
              "policy:project:write": "Write access to project-scoped policies",
              "policy:project:delete": "Delete access to project-scoped policies",
              "policy:project:manage": "Full management of project-scoped policies",
              "policy:project:execute": "Execute project-scoped policies",
              "template:read": "Read access to templates",
              "template:manage": "Full management access to templates",
              "template:*:read": "Read access to all templates",
              "template:*:write": "Write access to all templates",
              "template:*:delete": "Delete access to all templates",
              "template:*:manage": "Full management access to all templates",
              "rule:read": "Read access to rules",
              "rule:*:read": "Read access to all rules",
              "rule:*:write": "Write access to all rules",
              "rule:*:delete": "Delete access to all rules",
              "rule:*:manage": "Full management access to all rules",
              "evaluation:*:read": "Read access to all evaluations",
              "evaluation:*:write": "Write access to create evaluations",
              "evaluation:*:delete": "Delete access to evaluations",
              "system:admin": "Full system administrative access",
              "internal:developer:w": "Internal developer write access",
              "unifiedpolicy:admin": "Full unified policy administrative access"
            }
          }
        }
      }
    },
    "parameters": {
      "ruleSortByParam": {
        "name": "sort_by",
        "in": "query",
        "description": "Rule attribute to sort by.",
        "required": false,
        "schema": {
          "type": "string",
          "default": "created_at",
          "example": "created_at",
          "enum": [
            "name",
            "created_at"
          ],
          "x-oapi-codegen-extra-tags": {
            "binding": "omitempty,oneof=name created_at"
          }
        }
      },
      "ruleTemplateScannersQueryParam": {
        "name": "scanner_types",
        "in": "query",
        "description": "Filter rules by template scanner types. Multiple values can be provided for filtering.",
        "required": false,
        "allowEmptyValue": true,
        "style": "form",
        "explode": true,
        "schema": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/TemplateScannerType"
          }
        }
      },
      "ruleTemplateDataSourceQueryParam": {
        "name": "template_data_source",
        "in": "query",
        "description": "Filter rules by template data source type.",
        "required": false,
        "allowEmptyValue": true,
        "style": "form",
        "explode": true,
        "schema": {
          "$ref": "#/components/schemas/TemplateDataSourceType"
        }
      },
      "ruleTemplateCategoryQueryParam": {
        "name": "template_category",
        "in": "query",
        "description": "Filter rules by template category.",
        "required": false,
        "allowEmptyValue": true,
        "schema": {
          "$ref": "#/components/schemas/TemplateCategory"
        }
      },
      "ruleExpandQueryParam": {
        "name": "expand",
        "in": "query",
        "description": "Comma-separated list of fields to expand in the response.",
        "required": false,
        "schema": {
          "type": "string",
          "enum": [
            "template"
          ],
          "example": "template",
          "x-oapi-codegen-extra-tags": {
            "binding": "omitempty,oneof=template"
          }
        }
      },
      "idQueryParam": {
        "name": "id",
        "in": "query",
        "description": "Query by the resource id. Multiple values can be provided for filtering.",
        "required": false,
        "style": "form",
        "explode": true,
        "schema": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/JFrogId"
          }
        }
      },
      "nameQueryParam": {
        "name": "name",
        "in": "query",
        "description": "Query by the resource name. Multiple values can be provided for filtering.\n",
        "required": false,
        "style": "form",
        "explode": true,
        "schema": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/SearchName"
          }
        }
      },
      "pageQueryParam": {
        "name": "offset",
        "in": "query",
        "description": "A page offset to the requested page.",
        "required": false,
        "schema": {
          "$ref": "#/components/schemas/JFPageOffset"
        }
      },
      "limitQueryParam": {
        "name": "limit",
        "in": "query",
        "description": "An integer value representing the maximum number of items to include in the response.",
        "required": false,
        "schema": {
          "$ref": "#/components/schemas/JFPageLimit"
        }
      },
      "sortOrderQueryParam": {
        "name": "sort_order",
        "in": "query",
        "description": "Sort direction.",
        "required": false,
        "schema": {
          "type": "string",
          "default": "desc",
          "example": "desc",
          "enum": [
            "asc",
            "desc"
          ],
          "x-oapi-codegen-extra-tags": {
            "binding": "omitempty,oneof=asc desc"
          }
        }
      }
    },
    "schemas": {
      "ResourceBase": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "$ref": "#/components/schemas/JFrogResourceName"
          },
          "description": {
            "$ref": "#/components/schemas/JFrogResourceDescription"
          }
        },
        "description": "Foundation schema for all named resources in the system.\nProvides common name and description fields that all resources inherit.\nUsed as the base for all resource payload schemas.\n"
      },
      "ResourceIdentity": {
        "type": "object",
        "required": [
          "id",
          "created_at",
          "created_by",
          "updated_at",
          "updated_by"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/JFrogId"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp when the resource was created"
          },
          "created_by": {
            "$ref": "#/components/schemas/JFPrincipal"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp when the resource was last updated"
          },
          "updated_by": {
            "$ref": "#/components/schemas/JFPrincipal"
          }
        },
        "description": "System-managed identity and audit trail fields for all resources.\nThese fields are automatically managed by the system and cannot be modified by clients.\nIncluded in all resource response schemas to provide complete resource information.\n"
      },
      "CustomResource": {
        "description": "Custom resource flag\n",
        "type": "object",
        "properties": {
          "is_custom": {
            "$ref": "#/components/schemas/IsCustom"
          }
        }
      },
      "TemplatePayloadBase": {
        "description": "Base template data without data_source_type field.\nUsed as a base for both TemplatePayload and TemplateCreatePayload.\n",
        "allOf": [
          {
            "$ref": "#/components/schemas/ResourceBase"
          },
          {
            "type": "object",
            "required": [
              "version",
              "category",
              "rego",
              "parameters"
            ],
            "properties": {
              "version": {
                "$ref": "#/components/schemas/TemplateVersion"
              },
              "category": {
                "$ref": "#/components/schemas/TemplateCategory",
                "x-oapi-codegen-extra-tags": {
                  "binding": "required"
                }
              },
              "scanners": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/TemplateScannerType"
                },
                "description": "List of scanner types that this template supports. Defaults to empty array if not provided.",
                "minItems": 0,
                "maxItems": 10,
                "default": [],
                "x-oapi-codegen-extra-tags": {
                  "binding": "omitempty,min=0,max=10,dive,oneof=secrets sca exposures contextual_analysis malicious_package"
                }
              },
              "rego": {
                "$ref": "#/components/schemas/Rego",
                "x-oapi-codegen-extra-tags": {
                  "binding": "required"
                }
              },
              "parameters": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/TemplateParameter"
                },
                "description": "List of configurable parameters for the template",
                "maxItems": 20,
                "x-oapi-codegen-extra-tags": {
                  "binding": "max=20,dive"
                }
              }
            }
          }
        ]
      },
      "TemplatePayload": {
        "description": "Template data for create and update operations.\nContains the template configuration without system-managed fields.\n",
        "allOf": [
          {
            "$ref": "#/components/schemas/TemplatePayloadBase"
          },
          {
            "type": "object",
            "required": [
              "data_source_type"
            ],
            "properties": {
              "data_source_type": {
                "$ref": "#/components/schemas/TemplateDataSourceType",
                "x-oapi-codegen-extra-tags": {
                  "binding": "required"
                }
              }
            }
          }
        ]
      },
      "Template": {
        "description": "Complete template resource including system-managed identity fields.\nReturned in all template response operations.\n",
        "allOf": [
          {
            "$ref": "#/components/schemas/TemplatePayload"
          },
          {
            "$ref": "#/components/schemas/CustomResource"
          },
          {
            "$ref": "#/components/schemas/ResourceIdentity"
          }
        ]
      },
      "IsCustom": {
        "type": "boolean",
        "description": "Whether the resource is custom or built-in."
      },
      "TemplateCategory": {
        "type": "string",
        "enum": [
          "security",
          "legal",
          "operational",
          "quality",
          "audit",
          "workflow"
        ],
        "description": "Type/category of the rule.",
        "example": "security",
        "x-oapi-codegen-extra-tags": {
          "binding": "required,oneof=security legal operational quality audit workflow"
        }
      },
      "TemplateScannerType": {
        "type": "string",
        "maxLength": 50,
        "enum": [
          "secrets",
          "sca",
          "exposures",
          "contextual_analysis",
          "malicious_package"
        ],
        "description": "The type of scanner that the template's Rego policy expects to evaluate.",
        "example": "sca",
        "x-oapi-codegen-extra-tags": {
          "binding": "required,oneof=secrets sca exposures contextual_analysis malicious_package,max=50"
        }
      },
      "TemplateDataSourceType": {
        "type": "string",
        "enum": [
          "noop",
          "evidence",
          "onemodel_evidence",
          "public_vulnerability",
          "contextual_analysis",
          "exposures"
        ],
        "description": "The type of data source that the template's Rego policy expects to evaluate.\n- evidence: Evidence attestation data (SBOMs, signatures, gate certifications, etc.).\n- public_vulnerability: Evaluates all vulnerabilities regardless of applicability.\n- contextual_analysis: Evaluates all vulnerabilities only when they are applicable.\n- exposures: Evaluates JAS exposures findings (secrets, services, applications, and IaC).\n",
        "example": "public_vulnerability",
        "x-oapi-codegen-extra-tags": {
          "binding": "required,oneof=noop evidence onemodel_evidence public_vulnerability contextual_analysis exposures"
        }
      },
      "TemplateParameter": {
        "allOf": [
          {
            "type": "object",
            "required": [
              "name",
              "type"
            ],
            "properties": {
              "name": {
                "$ref": "#/components/schemas/TemplateParameterName"
              },
              "type": {
                "$ref": "#/components/schemas/TemplateParameterType"
              }
            },
            "description": "Configurable parameter for a template.\nTemplates can define parameters that can be customized when creating rules from the template.\n"
          }
        ]
      },
      "RuleParameter": {
        "allOf": [
          {
            "type": "object",
            "required": [
              "name",
              "value"
            ],
            "properties": {
              "name": {
                "$ref": "#/components/schemas/TemplateParameterName"
              },
              "value": {
                "$ref": "#/components/schemas/TemplateParameterValue",
                "x-oapi-codegen-extra-tags": {
                  "binding": "required"
                }
              }
            },
            "description": "Rule-specific parameter value.\nWhen the rule is based on a template, the parameter name must match a template parameter,\nand the value must be compatible with the template parameter's type.\n"
          }
        ]
      },
      "TemplateParameterName": {
        "type": "string",
        "minLength": 1,
        "maxLength": 100,
        "pattern": "^[a-zA-Z0-9]([a-zA-Z0-9._-]*[a-zA-Z0-9])?$",
        "description": "Parameter name (must be unique within the template).\nMust begin and end with an alphanumeric character and may consist only of dashes, \nunderscores, dots and alphanumerics in between.\n",
        "example": "severity_threshold",
        "x-oapi-codegen-extra-tags": {
          "binding": "required,min=1,max=100,regex=^[a-zA-Z0-9]([a-zA-Z0-9._-]*[a-zA-Z0-9])?$"
        }
      },
      "TemplateParameterType": {
        "type": "string",
        "enum": [
          "string",
          "bool",
          "int",
          "float",
          "object"
        ],
        "description": "Data type of the parameter",
        "example": "string",
        "x-oapi-codegen-extra-tags": {
          "binding": "required,oneof=string bool int float object"
        }
      },
      "TemplateParameterValue": {
        "description": "Parameter value (must match the template parameter type).\nThe value format depends on the parameter type:\n- string: Any string value\n- bool: \"true\" or \"false\"\n- int: Integer number as string\n- float: Floating point number as string\n- object: JSON object as string\n",
        "type": "string",
        "example": "critical",
        "x-oapi-codegen-extra-tags": {
          "binding": "required"
        }
      },
      "RulePayload": {
        "description": "Rule data for create and update operations.\nContains the rule configuration without system-managed fields.\n\nWhen creating a rule from a template:\n- template_id must be provided\n- rule parameters must match the template parameters\n- all template parameters must be provided\n",
        "allOf": [
          {
            "$ref": "#/components/schemas/ResourceBase"
          },
          {
            "type": "object",
            "required": [
              "template_id"
            ],
            "properties": {
              "template_id": {
                "$ref": "#/components/schemas/JFrogId"
              },
              "parameters": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RuleParameter"
                },
                "description": "Rule-specific parameter values.\nWhen template_id is provided, these must match the template parameters.\nAll template parameters without default values must be provided.\n",
                "maxItems": 20,
                "x-oapi-codegen-extra-tags": {
                  "binding": "omitempty,max=20,dive"
                }
              }
            }
          }
        ]
      },
      "Rule": {
        "description": "Complete rule resource including system-managed identity fields.\nThe template field is optional and included when expand=template parameter is used.\n",
        "allOf": [
          {
            "$ref": "#/components/schemas/RulePayload"
          },
          {
            "$ref": "#/components/schemas/CustomResource"
          },
          {
            "$ref": "#/components/schemas/ResourceIdentity"
          }
        ]
      },
      "RuleExpanded": {
        "description": "Complete rule resource including system-managed identity fields and template details.\nReturned when the expand=template parameter is used.\n",
        "allOf": [
          {
            "$ref": "#/components/schemas/Rule"
          },
          {
            "type": "object",
            "properties": {
              "template": {
                "$ref": "#/components/schemas/Template"
              }
            }
          }
        ]
      },
      "JFPageLimit": {
        "type": "integer",
        "format": "int32",
        "description": "The maximum number of items to return per page.",
        "minimum": 1,
        "maximum": 1000,
        "default": 100,
        "example": 100,
        "x-oapi-codegen-extra-tags": {
          "binding": "min=1,max=1000"
        }
      },
      "JFPageOffset": {
        "type": "integer",
        "format": "int32",
        "description": "The number of items to skip before starting to collect the result set.",
        "minimum": 0,
        "default": 0,
        "example": 0,
        "x-oapi-codegen-extra-tags": {
          "binding": "min=0"
        }
      },
      "JFPageSize": {
        "type": "integer",
        "format": "int32",
        "description": "The number of items returned in the current page.",
        "minimum": 0,
        "example": 100,
        "x-oapi-codegen-extra-tags": {
          "binding": "min=0"
        }
      },
      "JFTotalCount": {
        "type": "integer",
        "format": "int64",
        "description": "The total number of items in the database matching the filter criteria.",
        "minimum": 0,
        "example": 1000,
        "x-oapi-codegen-extra-tags": {
          "binding": "min=0"
        }
      },
      "PaginationResponse": {
        "type": "object",
        "required": [
          "page_size",
          "offset",
          "limit"
        ],
        "properties": {
          "offset": {
            "$ref": "#/components/schemas/JFPageOffset"
          },
          "limit": {
            "$ref": "#/components/schemas/JFPageLimit"
          },
          "page_size": {
            "$ref": "#/components/schemas/JFPageSize"
          },
          "total_count": {
            "$ref": "#/components/schemas/JFTotalCount"
          }
        },
        "x-oapi-codegen-extra-tags": {
          "binding": "required"
        }
      },
      "JFPrincipal": {
        "type": "string",
        "maxLength": 255,
        "description": "A human or system identifier that interacts with the API.\nExamples include usernames, email addresses, and system account identifiers.\n",
        "example": "john.doe",
        "x-oapi-codegen-extra-tags": {
          "binding": "required,max=255"
        }
      },
      "JFrogId": {
        "type": "string",
        "description": "A Snowflake unique identifier (64-bit integer, represented as a string).",
        "pattern": "^[0-9]*$",
        "minLength": 4,
        "maxLength": 20,
        "example": "123456789012345",
        "x-oapi-codegen-extra-tags": {
          "binding": "required,min=4,max=20,regex=^[0-9]*$"
        }
      },
      "JFrogResourceName": {
        "type": "string",
        "minLength": 1,
        "maxLength": 225,
        "pattern": "^[a-zA-Z0-9_ -]*$",
        "description": "A unique name for JFrog resources.\nMust be 1-225 alphanumeric characters, underscores, hyphens, and spaces.\n",
        "example": "resource-name",
        "x-oapi-codegen-extra-tags": {
          "binding": "min=1,max=225,regex=^[a-zA-Z0-9_ -]*$"
        }
      },
      "SearchName": {
        "type": "string",
        "minLength": 1,
        "maxLength": 257,
        "description": "Name pattern for searching resources in list/search APIs.\nSupports four patterns (ordered by search performance):\n- `name`: Exact match (e.g., `my-policy`)\n- `name*`: Prefix search (e.g., `policy*` matches names starting with \"policy\")\n- `*name`: Suffix search (e.g., `*policy` matches names ending with \"policy\")\n- `*name*`: Contains search (e.g., `*policy*` matches names containing \"policy\")\n\n**Important:** All name searches are case-sensitive. For example, `Policy` will not match `policy`.\n",
        "pattern": "^[*]?[a-zA-Z0-9_\\- ]*[*]?$",
        "example": "*policy*",
        "x-oapi-codegen-extra-tags": {
          "binding": "min=1,max=257,regex=^[*]?[a-zA-Z0-9_\\- ]*[*]?$"
        }
      },
      "JFrogResourceDescription": {
        "type": "string",
        "maxLength": 2048,
        "description": "A human-readable description of the resource.\nOptional field with a maximum length of 2048 characters. Can contain any characters.\n",
        "example": "This is a description of a platform resource.",
        "x-oapi-codegen-extra-tags": {
          "binding": "omitempty,max=2048"
        }
      },
      "TemplateVersion": {
        "type": "string",
        "minLength": 1,
        "maxLength": 100,
        "pattern": "^[a-zA-Z0-9_.:-]*$",
        "description": "Template version in the JFrog platform.\nMust be 1-100 alphanumeric characters, underscores, hyphens, periods, and colons.\nExamples: \"1.0.0\", \"v2.1.3\", \"1.0.0-beta.1\"\n",
        "example": "1.0.0",
        "x-oapi-codegen-extra-tags": {
          "binding": "min=1,max=100,regex=^[a-zA-Z0-9_.:-]*$"
        }
      },
      "Rego": {
        "type": "string",
        "minLength": 1,
        "maxLength": 65536,
        "description": "Rego policy language code for evaluation (Open Policy Agent policy language).\nMust be valid Rego syntax that defines evaluation logic. The policy should define\nan 'allow' rule that returns a boolean value.\n\nRego supports all standard programming language characters including:\n- Alphanumeric characters (a-z, A-Z, 0-9)\n- Special characters (!@#$%^&*()_+-=[]{}|;:'\",.<>?/~`)\n- Whitespace characters (spaces, tabs, newlines)\n- Unicode characters for identifiers and string literals\n\nSyntax validation should be performed by an OPA parser. This field only enforces\nlength constraints (1-65536 characters).\n\nFor Rego syntax reference, see: https://www.openpolicyagent.org/docs/latest/policy-language/\n",
        "example": "package policy\n\ndefault allow = false\n\nallow {\n  input.parameters.severity_threshold == \"critical\"\n  count(input.vulnerabilities) <= input.parameters.max_vulnerabilities\n}\n",
        "x-oapi-codegen-extra-tags": {
          "binding": "required,min=1,max=65536"
        }
      },
      "JFBaseError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "A unique, machine-readable code for the general error type.",
            "example": "resource_not_found",
            "x-oapi-codegen-extra-tags": {
              "binding": "required,min=1,max=100"
            }
          },
          "message": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000,
            "description": "A human-readable message summarizing the error.",
            "example": "The resource with the specified ID was not found.",
            "x-oapi-codegen-extra-tags": {
              "binding": "required,min=1,max=1000"
            }
          },
          "trace_id": {
            "type": "string",
            "maxLength": 64,
            "description": "A unique trace identifier for distributed tracing, logging, and support purposes.\nTypically an uber trace id (hexadecimal string, 16 or 32 characters) matching the regex pattern ^[0-9a-fA-F-]{1,64}$,\nautomatically extracted from the 'uber-trace-id' header when available.\n",
            "example": "1a2b3c4d5e6f7890",
            "x-oapi-codegen-extra-tags": {
              "binding": "omitempty,max=64"
            }
          }
        },
        "required": [
          "code",
          "message"
        ],
        "x-oapi-codegen-extra-tags": {
          "binding": "required"
        }
      },
      "JFErrorDetail": {
        "type": "object",
        "properties": {
          "property": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "The name of the property that failed validation.",
            "x-oapi-codegen-extra-tags": {
              "binding": "required,min=1,max=100"
            }
          },
          "message": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "description": "A human-readable message for this specific error.",
            "x-oapi-codegen-extra-tags": {
              "binding": "required,min=1,max=500"
            }
          }
        },
        "required": [
          "property",
          "message"
        ],
        "example": {
          "property": "password",
          "message": "Password must be at least 8 characters long."
        },
        "x-oapi-codegen-extra-tags": {
          "binding": "required"
        }
      },
      "JFValidationError": {
        "allOf": [
          {
            "$ref": "#/components/schemas/JFBaseError"
          },
          {
            "type": "object",
            "properties": {
              "details": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/JFErrorDetail"
                },
                "minItems": 1,
                "maxItems": 100,
                "x-oapi-codegen-extra-tags": {
                  "binding": "required,min=1,max=100"
                }
              }
            }
          }
        ],
        "example": {
          "code": "validation_error",
          "message": "One or more fields failed validation.",
          "details": [
            {
              "property": "email",
              "message": "Email must be a valid email address."
            },
            {
              "property": "password",
              "message": "Password must be at least 8 characters long."
            }
          ],
          "trace_id": "c9d0e1f2-a3b4-c5d6-e7f8-a9b0c1d2e3f4"
        },
        "x-oapi-codegen-extra-tags": {
          "binding": "required"
        }
      }
    },
    "responses": {
      "RulePaginatedResponse": {
        "description": "The request has succeeded.",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/RuleExpanded"
                      }
                    }
                  }
                },
                {
                  "$ref": "#/components/schemas/PaginationResponse"
                }
              ]
            },
            "examples": {
              "rules": {
                "$ref": "#/components/examples/RulesPaginatedExample"
              },
              "rules_expanded": {
                "$ref": "#/components/examples/RulesExpandedPaginatedExample"
              }
            }
          }
        }
      },
      "BadRequestError": {
        "description": "The request syntax was invalid or malformed, or validation failed.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/JFValidationError"
            },
            "examples": {
              "bad_request": {
                "$ref": "#/components/examples/BadRequestErrorExample"
              }
            }
          }
        }
      },
      "UnauthorizedError": {
        "description": "Authentication credentials are required or invalid.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/JFBaseError"
            },
            "examples": {
              "unauthorized": {
                "$ref": "#/components/examples/UnauthorizedErrorExample"
              }
            }
          }
        }
      },
      "ForbiddenError": {
        "description": "You do not have sufficient permissions to perform this action.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/JFBaseError"
            },
            "examples": {
              "forbidden": {
                "$ref": "#/components/examples/ForbiddenErrorExample"
              }
            }
          }
        }
      },
      "InternalServerError": {
        "description": "An unexpected error occurred. Please contact support.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/JFBaseError"
            },
            "examples": {
              "internal_server_error": {
                "$ref": "#/components/examples/InternalServerErrorExample"
              }
            }
          }
        }
      }
    },
    "examples": {
      "BadRequestErrorExample": {
        "summary": "Bad Request Error",
        "description": "Example of bad request error for invalid query parameters, request syntax, or request body validation",
        "value": {
          "code": "bad_request",
          "message": "One or more fields failed validation.",
          "details": [
            {
              "property": "name",
              "message": "Name must be a string"
            },
            {
              "property": "email",
              "message": "Email must be a valid email address"
            },
            {
              "property": "policy.name",
              "message": "Policy name must be shorter than or equal to 255 characters"
            }
          ],
          "trace_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
        }
      },
      "UnauthorizedErrorExample": {
        "summary": "Unauthorized Error",
        "description": "Example of unauthorized error",
        "value": {
          "code": "unauthorized",
          "message": "Authentication token is required.",
          "trace_id": "c3d4e5f6-7890-9012-cdef-345678901234"
        }
      },
      "ForbiddenErrorExample": {
        "summary": "Forbidden Error",
        "description": "Example of forbidden error",
        "value": {
          "code": "forbidden",
          "message": "You do not have sufficient permissions to perform this action.",
          "trace_id": "e5f6a7b8-7890-1234-efab-567890123456"
        }
      },
      "InternalServerErrorExample": {
        "summary": "Internal Server Error",
        "description": "Example of internal server error",
        "value": {
          "code": "internal_server_error",
          "message": "An unexpected error occurred while processing your request.",
          "trace_id": "c3d4e5f6-a7b8-9012-abcd-345678901234"
        }
      },
      "RulesPaginatedExample": {
        "summary": "Rules List Example",
        "description": "Example response for a rules list without expanded templates",
        "value": {
          "items": [
            {
              "id": "12345",
              "name": "Critical Vulnerability Check",
              "description": "Checks for critical security vulnerabilities in artifacts",
              "created_at": "2024-01-15T10:30:00Z",
              "created_by": "admin",
              "updated_at": "2024-01-15T10:30:00Z",
              "updated_by": "admin",
              "is_custom": false,
              "template_id": "67890",
              "parameters": [
                {
                  "name": "severity_threshold",
                  "value": "critical"
                },
                {
                  "name": "max_vulnerabilities",
                  "value": "5"
                }
              ]
            },
            {
              "id": "67890",
              "name": "Code Coverage Threshold",
              "description": "Ensures minimum code coverage requirements are met",
              "created_at": "2024-01-15T11:00:00Z",
              "created_by": "admin",
              "updated_at": "2024-01-15T11:00:00Z",
              "updated_by": "admin",
              "is_custom": false,
              "template_id": "11111",
              "parameters": [
                {
                  "name": "coverage_threshold",
                  "value": "80"
                },
                {
                  "name": "enforce_coverage",
                  "value": "true"
                }
              ]
            }
          ],
          "page": 1,
          "page_size": 10,
          "limit": 10,
          "offset": 0,
          "total": 2,
          "total_pages": 1
        }
      },
      "RulesExpandedPaginatedExample": {
        "summary": "Rules List with Expanded Templates Example",
        "description": "Example response for a rules list with expanded templates",
        "value": {
          "items": [
            {
              "id": "12345",
              "name": "Critical Vulnerability Check",
              "description": "Checks for critical security vulnerabilities in artifacts",
              "created_at": "2024-01-15T10:30:00Z",
              "created_by": "admin",
              "updated_at": "2024-01-15T10:30:00Z",
              "updated_by": "admin",
              "is_custom": false,
              "template_id": "67890",
              "parameters": [
                {
                  "name": "severity_threshold",
                  "value": "critical"
                },
                {
                  "name": "max_vulnerabilities",
                  "value": "5"
                }
              ],
              "template": {
                "id": "67890",
                "name": "Security Vulnerability Template",
                "description": "Template for creating security vulnerability policies",
                "created_at": "2024-01-10T09:00:00Z",
                "created_by": "system",
                "updated_at": "2024-01-10T09:00:00Z",
                "updated_by": "system",
                "version": "1.0.0",
                "category": "security",
                "scanners": [
                  "sca"
                ],
                "data_source_type": "public_vulnerability",
                "is_custom": false,
                "rego": "package policy\n\ndefault allow = false\n\nallow {\n  input.parameters.severity_threshold == \"critical\"\n  count(input.vulnerabilities) <= input.parameters.max_vulnerabilities\n}\n",
                "parameters": [
                  {
                    "name": "severity_threshold",
                    "type": "string"
                  },
                  {
                    "name": "max_vulnerabilities",
                    "type": "int"
                  }
                ]
              }
            }
          ],
          "page": 1,
          "page_size": 10,
          "limit": 10,
          "offset": 0,
          "total": 1,
          "total_pages": 1
        }
      }
    }
  }
}
```