---
updatedAt: 2026-10-25T15:46:36.000Z
agentTools:
  projectIndex: https://docs.superwise.ai/llms.txt
---

# Get Guardrail Versions

Get all guardrail versions.

Returns guardrail versions. Filter by `guardrail_id` or by a list of version `ids`. Set `with_deleted` to include versions of deleted guardrails, and `model_provider_with_deleted` to include deleted model providers.

## When to use it

Use it to review a guardrail's version history, or to find the version IDs to pass to [Run guardrail versions](https://docs.superwise.ai/reference/run_guardrail_versions).

## Required parameters

This call takes no required parameters.

Optional query parameters: `guardrail_id`, `ids`, `with_deleted`, `model_provider_with_deleted`.

## Response

A successful call returns `200 OK` with a JSON array of `GuardrailVersionSchema` objects, each with its `id`, `guardrail_id`, `name`, and `guardrules`.

**Related:** [Create a guardrail version](https://docs.superwise.ai/reference/create_guardrail_version), [Run guardrail versions](https://docs.superwise.ai/reference/run_guardrail_versions), [Get a guardrail](https://docs.superwise.ai/reference/get_guardrail_by_id)

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "paths": {
    "/v1/guardrails/versions": {
      "get": {
        "tags": [
          "Guardrail Versions"
        ],
        "summary": "Get Guardrail Versions",
        "description": "Get all guardrail versions.",
        "operationId": "get_guardrail_versions",
        "parameters": [
          {
            "name": "guardrail_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Guardrail ID",
              "title": "Guardrail Id"
            },
            "description": "Guardrail ID"
          },
          {
            "name": "ids",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "uniqueItems": true,
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                {
                  "type": "null"
                }
              ],
              "description": "Guardrail version IDs",
              "title": "Ids"
            },
            "description": "Guardrail version IDs"
          },
          {
            "name": "with_deleted",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Include deleted guardrails' versions",
              "default": false,
              "title": "With Deleted"
            },
            "description": "Include deleted guardrails' versions"
          },
          {
            "name": "model_provider_with_deleted",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Include deleted model providers",
              "default": false,
              "title": "Model Provider With Deleted"
            },
            "description": "Include deleted model providers"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GuardrailVersionSchema"
                  },
                  "title": "Response Get Guardrail Versions"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not Found"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    }
  },
  "info": {
    "title": "Superwise Main Entities",
    "description": "API reference",
    "version": "0.1.0"
  },
  "components": {
    "schemas": {
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "AllowedTopicsPayload": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Name",
            "description": "Name of the rule."
          },
          "tags": {
            "items": {
              "type": "string",
              "enum": [
                "input",
                "output"
              ]
            },
            "type": "array",
            "uniqueItems": true,
            "title": "Tags",
            "description": "Specifies what this rule applies to: any combination of 'input' and/or 'output'."
          },
          "type": {
            "type": "string",
            "const": "allowed_topics",
            "title": "Type",
            "default": "allowed_topics"
          },
          "model": {
            "$ref": "#/components/schemas/ModelLLM",
            "description": "Model for topic classification."
          },
          "topics": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "minItems": 1,
            "title": "Topics"
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "name",
          "tags",
          "model",
          "topics"
        ],
        "title": "AllowedTopicsPayload"
      },
      "BlurrinessPayload": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Name",
            "description": "Name of the rule."
          },
          "tags": {
            "items": {
              "type": "string",
              "enum": [
                "input",
                "output"
              ]
            },
            "type": "array",
            "uniqueItems": true,
            "title": "Tags",
            "description": "Specifies what this rule applies to: any combination of 'input' and/or 'output'."
          },
          "type": {
            "type": "string",
            "const": "image_blurriness",
            "title": "Type",
            "default": "image_blurriness"
          },
          "min_variance": {
            "type": "number",
            "exclusiveMinimum": 0,
            "title": "Min Variance",
            "description": "Minimum variance of Laplacian (sharpness). Image must have variance >= this to pass. Must be > 0."
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "name",
          "tags",
          "min_variance"
        ],
        "title": "BlurrinessPayload"
      },
      "CompetitorCheckPayload": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Name",
            "description": "Name of the rule."
          },
          "tags": {
            "items": {
              "type": "string",
              "enum": [
                "input",
                "output"
              ]
            },
            "type": "array",
            "uniqueItems": true,
            "title": "Tags",
            "description": "Specifies what this rule applies to: any combination of 'input' and/or 'output'."
          },
          "type": {
            "type": "string",
            "const": "competitor_check",
            "title": "Type",
            "default": "competitor_check"
          },
          "competitor_names": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 10,
            "minItems": 1,
            "uniqueItems": true,
            "title": "Competitor Names",
            "description": "Set of restricted competitor names."
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "name",
          "tags",
          "competitor_names"
        ],
        "title": "CompetitorCheckPayload"
      },
      "CorrectLanguagePayload": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Name",
            "description": "Name of the rule."
          },
          "tags": {
            "items": {
              "type": "string",
              "enum": [
                "input",
                "output"
              ]
            },
            "type": "array",
            "uniqueItems": true,
            "title": "Tags",
            "description": "Specifies what this rule applies to: any combination of 'input' and/or 'output'."
          },
          "type": {
            "type": "string",
            "const": "correct_language",
            "title": "Type",
            "default": "correct_language"
          },
          "language_codes": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "minItems": 1,
            "uniqueItems": true,
            "title": "Language Codes"
          },
          "filter_mode": {
            "$ref": "#/components/schemas/FilterMode"
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "name",
          "tags",
          "language_codes",
          "filter_mode"
        ],
        "title": "CorrectLanguagePayload"
      },
      "DetectJailbreakPayload": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Name",
            "description": "Name of the rule."
          },
          "tags": {
            "items": {
              "type": "string",
              "const": "input"
            },
            "type": "array",
            "uniqueItems": true,
            "title": "Tags",
            "description": "Specifies what this rule applies to: 'input'."
          },
          "type": {
            "type": "string",
            "const": "detect_jailbreak",
            "title": "Type",
            "default": "detect_jailbreak"
          },
          "threshold": {
            "type": "number",
            "maximum": 1,
            "minimum": 0,
            "title": "Threshold",
            "description": "Threshold for jailbreak detection must be between 0 and 1.",
            "default": 0.7
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "name",
          "tags"
        ],
        "title": "DetectJailbreakPayload"
      },
      "FilterMode": {
        "type": "string",
        "enum": [
          "include",
          "exclude"
        ],
        "title": "FilterMode",
        "description": "Enum for filter modes in language guards."
      },
      "GuardrailVersionSchema": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid4",
            "title": "Id"
          },
          "guardrail_id": {
            "type": "string",
            "format": "uuid4",
            "title": "Guardrail Id"
          },
          "name": {
            "type": "string",
            "maxLength": 95,
            "minLength": 1,
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "guardrules": {
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/AllowedTopicsPayload"
                },
                {
                  "$ref": "#/components/schemas/BlurrinessPayload"
                },
                {
                  "$ref": "#/components/schemas/CorrectLanguagePayload"
                },
                {
                  "$ref": "#/components/schemas/CompetitorCheckPayload"
                },
                {
                  "$ref": "#/components/schemas/DetectJailbreakPayload"
                },
                {
                  "$ref": "#/components/schemas/PiiDetectionPayload"
                },
                {
                  "$ref": "#/components/schemas/RestrictedTopicsPayload"
                },
                {
                  "$ref": "#/components/schemas/ResolutionPayload"
                },
                {
                  "$ref": "#/components/schemas/ImageSemanticsPayload"
                },
                {
                  "$ref": "#/components/schemas/StringCheckPayload"
                },
                {
                  "$ref": "#/components/schemas/ToxicityPayload"
                },
                {
                  "$ref": "#/components/schemas/ImageTamperingPayload"
                },
                {
                  "$ref": "#/components/schemas/ImageLicensePlatePayload"
                },
                {
                  "$ref": "#/components/schemas/ImageFaceDetectionPayload"
                }
              ],
              "discriminator": {
                "propertyName": "type",
                "mapping": {
                  "allowed_topics": "#/components/schemas/AllowedTopicsPayload",
                  "competitor_check": "#/components/schemas/CompetitorCheckPayload",
                  "correct_language": "#/components/schemas/CorrectLanguagePayload",
                  "detect_jailbreak": "#/components/schemas/DetectJailbreakPayload",
                  "image_blurriness": "#/components/schemas/BlurrinessPayload",
                  "image_face_detection": "#/components/schemas/ImageFaceDetectionPayload",
                  "image_license_plate": "#/components/schemas/ImageLicensePlatePayload",
                  "image_resolution": "#/components/schemas/ResolutionPayload",
                  "image_semantics": "#/components/schemas/ImageSemanticsPayload",
                  "image_tampering": "#/components/schemas/ImageTamperingPayload",
                  "pii_detection": "#/components/schemas/PiiDetectionPayload",
                  "restricted_topics": "#/components/schemas/RestrictedTopicsPayload",
                  "string_check": "#/components/schemas/StringCheckPayload",
                  "toxicity": "#/components/schemas/ToxicityPayload"
                }
              }
            },
            "type": "array",
            "title": "Guardrules"
          },
          "created_by": {
            "type": "string",
            "title": "Created By"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "guardrail_id",
          "name",
          "guardrules",
          "created_by"
        ],
        "title": "GuardrailVersionSchema"
      },
      "ImageFaceDetectionPayload": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Name",
            "description": "Name of the rule."
          },
          "tags": {
            "items": {
              "type": "string",
              "enum": [
                "input",
                "output"
              ]
            },
            "type": "array",
            "uniqueItems": true,
            "title": "Tags",
            "description": "Specifies what this rule applies to: any combination of 'input' and/or 'output'."
          },
          "type": {
            "type": "string",
            "const": "image_face_detection",
            "title": "Type",
            "default": "image_face_detection"
          },
          "confidence_threshold": {
            "type": "number",
            "maximum": 1,
            "minimum": 0,
            "title": "Confidence Threshold",
            "description": "Minimum detection confidence for face detection.",
            "default": 0.5
          },
          "min_face_size": {
            "type": "integer",
            "maximum": 100,
            "exclusiveMinimum": 0,
            "title": "Min Face Size",
            "description": "Minimum face size as a percentage of the image's smaller dimension (0–100).",
            "default": 3
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "name",
          "tags"
        ],
        "title": "ImageFaceDetectionPayload"
      },
      "ImageLicensePlatePayload": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Name",
            "description": "Name of the rule."
          },
          "tags": {
            "items": {
              "type": "string",
              "enum": [
                "input",
                "output"
              ]
            },
            "type": "array",
            "uniqueItems": true,
            "title": "Tags",
            "description": "Specifies what this rule applies to: any combination of 'input' and/or 'output'."
          },
          "type": {
            "type": "string",
            "const": "image_license_plate",
            "title": "Type",
            "default": "image_license_plate"
          },
          "confidence_threshold": {
            "type": "number",
            "maximum": 1,
            "minimum": 0,
            "title": "Confidence Threshold",
            "description": "Minimum detection confidence for license plate.",
            "default": 0.5
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "name",
          "tags"
        ],
        "title": "ImageLicensePlatePayload"
      },
      "ImageSemanticsPayload": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Name",
            "description": "Name of the rule."
          },
          "tags": {
            "items": {
              "type": "string",
              "enum": [
                "input",
                "output"
              ]
            },
            "type": "array",
            "uniqueItems": true,
            "title": "Tags",
            "description": "Specifies what this rule applies to: any combination of 'input' and/or 'output'."
          },
          "type": {
            "type": "string",
            "const": "image_semantics",
            "title": "Type",
            "default": "image_semantics"
          },
          "image_categories": {
            "items": {
              "type": "string",
              "enum": [
                "Photograph",
                "Artwork",
                "Document Scan",
                "Screenshot",
                "Diagram",
                "Meme",
                "Other"
              ]
            },
            "type": "array",
            "minItems": 1,
            "title": "Image Categories"
          },
          "filter_mode": {
            "$ref": "#/components/schemas/FilterMode"
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "name",
          "tags",
          "image_categories",
          "filter_mode"
        ],
        "title": "ImageSemanticsPayload"
      },
      "ImageTamperingPayload": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Name",
            "description": "Name of the rule."
          },
          "tags": {
            "items": {
              "type": "string",
              "enum": [
                "input",
                "output"
              ]
            },
            "type": "array",
            "uniqueItems": true,
            "title": "Tags",
            "description": "Specifies what this rule applies to: any combination of 'input' and/or 'output'."
          },
          "type": {
            "type": "string",
            "const": "image_tampering",
            "title": "Type",
            "default": "image_tampering"
          },
          "tamper_threshold": {
            "type": "number",
            "maximum": 1,
            "minimum": 0,
            "title": "Tamper Threshold",
            "description": "Threshold for image tampering detection must be between 0 and 1.",
            "default": 0.65
          },
          "min_tamper_ratio_percent": {
            "type": "number",
            "maximum": 100,
            "minimum": 0,
            "title": "Min Tamper Ratio Percent",
            "description": "Minimum tampered ratio must be between 0% and 100%.",
            "default": 1
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "name",
          "tags"
        ],
        "title": "ImageTamperingPayload"
      },
      "ModelLLM": {
        "properties": {
          "provider_id": {
            "type": "string",
            "title": "Provider Id"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version"
          },
          "parameters": {
            "additionalProperties": true,
            "type": "object",
            "title": "Parameters"
          }
        },
        "type": "object",
        "required": [
          "provider_id"
        ],
        "title": "ModelLLM"
      },
      "ModelName": {
        "type": "string",
        "enum": [
          "original",
          "unbiased",
          "multilingual",
          "original-small",
          "unbiased-small"
        ],
        "title": "ModelName"
      },
      "PiiDetectionPayload": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Name",
            "description": "Name of the rule."
          },
          "tags": {
            "items": {
              "type": "string",
              "enum": [
                "input",
                "output"
              ]
            },
            "type": "array",
            "uniqueItems": true,
            "title": "Tags",
            "description": "Specifies what this rule applies to: any combination of 'input' and/or 'output'."
          },
          "type": {
            "type": "string",
            "const": "pii_detection",
            "title": "Type",
            "default": "pii_detection"
          },
          "categories": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "minItems": 1,
            "uniqueItems": true,
            "title": "Categories",
            "description": "Set of PII categories."
          },
          "threshold": {
            "type": "number",
            "maximum": 1,
            "minimum": 0,
            "title": "Threshold",
            "description": "Threshold for PII detection (must be between 0 and 1)."
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "name",
          "tags",
          "categories",
          "threshold"
        ],
        "title": "PiiDetectionPayload"
      },
      "ResolutionPayload": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Name",
            "description": "Name of the rule."
          },
          "tags": {
            "items": {
              "type": "string",
              "enum": [
                "input",
                "output"
              ]
            },
            "type": "array",
            "uniqueItems": true,
            "title": "Tags",
            "description": "Specifies what this rule applies to: any combination of 'input' and/or 'output'."
          },
          "type": {
            "type": "string",
            "const": "image_resolution",
            "title": "Type",
            "default": "image_resolution"
          },
          "min_width": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "title": "Min Width",
            "description": "Minimum image width in pixels. Must be > 0."
          },
          "min_height": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "title": "Min Height",
            "description": "Minimum image height in pixels. Must be > 0."
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "name",
          "tags",
          "min_width",
          "min_height"
        ],
        "title": "ResolutionPayload"
      },
      "RestrictedTopicsPayload": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Name",
            "description": "Name of the rule."
          },
          "tags": {
            "items": {
              "type": "string",
              "enum": [
                "input",
                "output"
              ]
            },
            "type": "array",
            "uniqueItems": true,
            "title": "Tags",
            "description": "Specifies what this rule applies to: any combination of 'input' and/or 'output'."
          },
          "type": {
            "type": "string",
            "const": "restricted_topics",
            "title": "Type",
            "default": "restricted_topics"
          },
          "model": {
            "$ref": "#/components/schemas/ModelLLM",
            "description": "Model for topic classification."
          },
          "topics": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "minItems": 1,
            "title": "Topics"
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "name",
          "tags",
          "model",
          "topics"
        ],
        "title": "RestrictedTopicsPayload"
      },
      "StringCheckPayload": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Name",
            "description": "Name of the rule."
          },
          "tags": {
            "items": {
              "type": "string",
              "enum": [
                "input",
                "output"
              ]
            },
            "type": "array",
            "uniqueItems": true,
            "title": "Tags",
            "description": "Specifies what this rule applies to: any combination of 'input' and/or 'output'."
          },
          "type": {
            "type": "string",
            "const": "string_check",
            "title": "Type",
            "default": "string_check"
          },
          "regex_pattern": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "minItems": 1,
            "uniqueItems": true,
            "title": "Regex Pattern",
            "description": "set of regex patterns to search for prohibited content"
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "name",
          "tags",
          "regex_pattern"
        ],
        "title": "StringCheckPayload"
      },
      "ToxicityPayload": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Name",
            "description": "Name of the rule."
          },
          "tags": {
            "items": {
              "type": "string",
              "enum": [
                "input",
                "output"
              ]
            },
            "type": "array",
            "uniqueItems": true,
            "title": "Tags",
            "description": "Specifies what this rule applies to: any combination of 'input' and/or 'output'."
          },
          "type": {
            "type": "string",
            "const": "toxicity",
            "title": "Type",
            "default": "toxicity"
          },
          "threshold": {
            "type": "number",
            "maximum": 1,
            "minimum": 0,
            "title": "Threshold",
            "description": "Threshold for toxicity detection must be between 0 and 1.",
            "default": 0.5
          },
          "model_name": {
            "$ref": "#/components/schemas/ModelName",
            "description": "Model name for toxicity detection.",
            "default": "unbiased-small"
          },
          "validation_method": {
            "type": "string",
            "enum": [
              "sentence",
              "full"
            ],
            "title": "Validation Method",
            "description": "Validation method for toxicity detection.",
            "default": "sentence"
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "name",
          "tags"
        ],
        "title": "ToxicityPayload"
      }
    },
    "securitySchemes": {
      "implicit": {
        "type": "oauth2",
        "flows": {
          "implicit": {
            "authorizationUrl": "https://authentication.superwise.ai/identity/resources/auth/v1/api-token",
            "scopes": {}
          }
        }
      }
    }
  },
  "security": [
    {
      "implicit": []
    }
  ],
  "servers": [
    {
      "url": "api.superwise.ai",
      "description": "Superwise Api Gateway"
    }
  ]
}
```