> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://nemo-platform.docs.buildwithfern.com/nemo/platform/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://nemo-platform.docs.buildwithfern.com/nemo/platform/_mcp/server.

# Guardrail check request

POST https://host.com/apis/guardrails/v2/workspaces/{workspace}/checks
Content-Type: application/json

Chat completion for the provided conversation.

Reference: https://nemo-platform.docs.buildwithfern.com/nemo/platform/nemo/platform/documentation/reference/api-reference/guardrails/check-apis-guardrails-v-2-workspaces-workspace-checks-post

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Nemo Platform API
  version: 1.0.0
paths:
  /apis/guardrails/v2/workspaces/{workspace}/checks:
    post:
      operationId: check-apis-guardrails-v-2-workspaces-workspace-checks-post
      summary: Guardrail check request
      description: Chat completion for the provided conversation.
      tags:
        - subpackage_guardrails
      parameters:
        - name: workspace
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GuardrailCheckResponse'
        '400':
          description: Invalid Request Body
          content:
            application/json:
              schema:
                description: Any type
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                description: Any type
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                description: Any type
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GuardrailCheckRequest'
servers:
  - url: https://host.com
    description: Default
components:
  schemas:
    GuardrailCheckRequestStop:
      oneOf:
        - type: string
        - type: array
          items:
            type: string
      description: Up to 4 sequences where the API will stop generating further tokens.
      title: GuardrailCheckRequestStop
    GuardrailCheckRequestFunctionCall:
      oneOf:
        - type: string
        - type: object
          additionalProperties:
            description: Any type
      description: >-
        Deprecated in favor of tool_choice. 'none' means the model will not call
        a function and instead generates a message. 'auto' means the model can
        pick between generating a message or calling a function. Specifying a
        particular function via {'name': 'my_function'} forces the model to call
        that function.
      title: GuardrailCheckRequestFunctionCall
    GuardrailCheckRequestToolChoice:
      oneOf:
        - type: string
        - type: object
          additionalProperties:
            description: Any type
      description: >-
        Controls which (if any) tool is called by the model. 'none' means no
        tool is called, 'auto' lets the model decide, 'required' forces a tool
        call.
      title: GuardrailCheckRequestToolChoice
    ChatCompletionSystemMessageParam:
      type: object
      properties:
        content:
          type: string
          description: The contents of the system message.
        role:
          type: string
          enum:
            - system
          description: The role of the messages author, in this case `system`.
        name:
          type: string
          description: An optional name for the participant.
      required:
        - content
        - role
      description: System message parameter for chat completion.
      title: ChatCompletionSystemMessageParam
    ChatCompletionContentPartTextParam:
      type: object
      properties:
        text:
          type: string
          description: The text content.
        type:
          type: string
          enum:
            - text
          description: The type of the content part.
      required:
        - text
        - type
      description: Text content part for chat messages.
      title: ChatCompletionContentPartTextParam
    ImageUrlDetail:
      type: string
      enum:
        - auto
        - low
        - high
      description: Specifies the detail level of the image.
      title: ImageUrlDetail
    ImageURL:
      type: object
      properties:
        url:
          type: string
          description: Either a URL of the image or the base64 encoded image data.
        detail:
          $ref: '#/components/schemas/ImageUrlDetail'
          description: Specifies the detail level of the image.
      required:
        - url
      description: Image URL for vision requests.
      title: ImageURL
    ChatCompletionContentPartImageParam:
      type: object
      properties:
        image_url:
          $ref: '#/components/schemas/ImageURL'
          description: The image URL information.
        type:
          type: string
          enum:
            - image_url
          description: The type of the content part.
      required:
        - image_url
        - type
      description: Image content part for chat messages.
      title: ChatCompletionContentPartImageParam
    ChatCompletionUserMessageParamContentOneOf1Items:
      oneOf:
        - $ref: '#/components/schemas/ChatCompletionContentPartTextParam'
        - $ref: '#/components/schemas/ChatCompletionContentPartImageParam'
      title: ChatCompletionUserMessageParamContentOneOf1Items
    ChatCompletionUserMessageParamContent1:
      type: array
      items:
        $ref: '#/components/schemas/ChatCompletionUserMessageParamContentOneOf1Items'
      title: ChatCompletionUserMessageParamContent1
    ChatCompletionUserMessageParamContent:
      oneOf:
        - type: string
        - $ref: '#/components/schemas/ChatCompletionUserMessageParamContent1'
      description: The contents of the user message.
      title: ChatCompletionUserMessageParamContent
    ChatCompletionUserMessageParam:
      type: object
      properties:
        content:
          $ref: '#/components/schemas/ChatCompletionUserMessageParamContent'
          description: The contents of the user message.
        role:
          type: string
          enum:
            - user
          description: The role of the messages author, in this case `user`.
        name:
          type: string
          description: An optional name for the participant.
      required:
        - content
        - role
      description: User message parameter for chat completion.
      title: ChatCompletionUserMessageParam
    FunctionCall:
      type: object
      properties:
        arguments:
          type: string
          description: >-
            The arguments to call the function with, as generated by the model
            in JSON format.
        name:
          type: string
          description: The name of the function to call.
      required:
        - arguments
        - name
      description: Function call information.
      title: FunctionCall
    Function:
      type: object
      properties:
        arguments:
          type: string
          description: >-
            The arguments to call the function with, as generated by the model
            in JSON format.
        name:
          type: string
          description: The name of the function to call.
      required:
        - arguments
        - name
      description: Function definition for tool calls.
      title: Function
    ChatCompletionMessageToolCallParam:
      type: object
      properties:
        id:
          type: string
          description: The ID of the tool call.
        function:
          $ref: '#/components/schemas/Function'
          description: The function that the model called.
        type:
          type: string
          enum:
            - function
          description: The type of the tool. Currently, only `function` is supported.
      required:
        - id
        - function
        - type
      description: Tool call parameter for chat completion messages.
      title: ChatCompletionMessageToolCallParam
    ChatCompletionAssistantMessageParam:
      type: object
      properties:
        role:
          type: string
          enum:
            - assistant
          description: The role of the messages author, in this case `assistant`.
        content:
          type: string
          description: The contents of the assistant message.
        function_call:
          $ref: '#/components/schemas/FunctionCall'
          description: Deprecated and replaced by `tool_calls`.
        name:
          type: string
          description: An optional name for the participant.
        tool_calls:
          type: array
          items:
            $ref: '#/components/schemas/ChatCompletionMessageToolCallParam'
          description: The tool calls generated by the model, such as function calls.
      required:
        - role
      description: Assistant message parameter for chat completion.
      title: ChatCompletionAssistantMessageParam
    ChatCompletionToolMessageParam:
      type: object
      properties:
        content:
          type: string
          description: The contents of the tool message.
        role:
          type: string
          enum:
            - tool
          description: The role of the messages author, in this case `tool`.
        tool_call_id:
          type: string
          description: Tool call that this message is responding to.
      required:
        - content
        - role
        - tool_call_id
      description: Tool message parameter for chat completion.
      title: ChatCompletionToolMessageParam
    ChatCompletionFunctionMessageParam:
      type: object
      properties:
        content:
          type: string
          description: The contents of the function message.
        name:
          type: string
          description: The name of the function to call.
        role:
          type: string
          enum:
            - function
          description: The role of the messages author, in this case `function`.
      required:
        - content
        - name
        - role
      description: Function message parameter for chat completion.
      title: ChatCompletionFunctionMessageParam
    GuardrailCheckRequestMessagesItems:
      oneOf:
        - $ref: '#/components/schemas/ChatCompletionSystemMessageParam'
        - $ref: '#/components/schemas/ChatCompletionUserMessageParam'
        - $ref: '#/components/schemas/ChatCompletionAssistantMessageParam'
        - $ref: '#/components/schemas/ChatCompletionToolMessageParam'
        - $ref: '#/components/schemas/ChatCompletionFunctionMessageParam'
      title: GuardrailCheckRequestMessagesItems
    ModelParameters:
      type: object
      properties:
        base_url:
          type: string
          description: The URL to use for inference with this model.
        default_headers:
          type: object
          additionalProperties:
            type: string
          description: >-
            Custom HTTP headers to include in requests to this model. Each
            key-value pair represents a header name (key) and its default value
            (value). You can override the default value for a header by
            populating it in the request headers.
      description: >-
        Parameters for configuring how to interact with a model in a guardrails
        config.
      title: ModelParameters
    ModelMode:
      type: string
      enum:
        - chat
        - text
      default: chat
      description: >-
        Whether the mode is 'text' completion or 'chat' completion. Allowed
        values are 'chat' or 'text'.
      title: ModelMode
    CacheStatsConfig:
      type: object
      properties:
        enabled:
          type: boolean
          default: false
          description: Whether cache statistics tracking is enabled
        log_interval:
          type: number
          format: double
          description: >-
            Seconds between periodic cache stats logging to logs (None disables
            logging)
      description: Configuration for cache statistics tracking and logging.
      title: CacheStatsConfig
    ModelCacheConfig:
      type: object
      properties:
        enabled:
          type: boolean
          default: false
          description: 'Whether caching is enabled (default: False - no caching)'
        maxsize:
          type: integer
          default: 50000
          description: Maximum number of entries in the cache per model
        stats:
          $ref: '#/components/schemas/CacheStatsConfig'
          description: Configuration for cache statistics tracking and logging
      description: Configuration for model caching.
      title: ModelCacheConfig
    Model:
      type: object
      properties:
        type:
          type: string
        engine:
          type: string
        model:
          type: string
          description: >-
            The model name. If using Inference Gateway, this should be the Model
            Entity reference ('workspace/model_name').
        parameters:
          $ref: '#/components/schemas/ModelParameters'
          description: Additional parameters to configure how to interact with the model.
        mode:
          $ref: '#/components/schemas/ModelMode'
          default: chat
          description: >-
            Whether the mode is 'text' completion or 'chat' completion. Allowed
            values are 'chat' or 'text'.
        cache:
          $ref: '#/components/schemas/ModelCacheConfig'
          description: >-
            Cache configuration for this specific model (primarily used for
            content safety models)
      required:
        - type
        - engine
      description: >-
        Configuration of a model used by the rails engine.


        If using Inference Gateway, the `model` field should be a Model Entity
        reference ('workspace/model_name').
      title: Model
    Instruction:
      type: object
      properties:
        type:
          type: string
        content:
          type: string
      required:
        - type
        - content
      description: >-
        Configuration for instructions in natural language that should be passed
        to the LLM.
      title: Instruction
    MessageTemplate:
      type: object
      properties:
        type:
          type: string
          description: The type of message, e.g., 'assistant', 'user', 'system'.
        content:
          type: string
          description: The content of the message.
      required:
        - type
        - content
      description: Template for a message structure.
      title: MessageTemplate
    TaskPromptMessagesItems:
      oneOf:
        - $ref: '#/components/schemas/MessageTemplate'
        - type: string
      title: TaskPromptMessagesItems
    TaskPrompt:
      type: object
      properties:
        task:
          type: string
          description: The id of the task associated with this prompt.
        content:
          type: string
          description: The content of the prompt, if it's a string.
        messages:
          type: array
          items:
            $ref: '#/components/schemas/TaskPromptMessagesItems'
          description: The list of messages included in the prompt. Used for chat models.
        models:
          type: array
          items:
            type: string
          description: >-
            If specified, the prompt will be used only for the given LLM
            engines/models. The format is a list of strings with the format:
            <engine> or <engine>/<model>.
        output_parser:
          type: string
          description: The name of the output parser to use for this prompt.
        max_length:
          type: integer
          default: 16000
          description: The maximum length of the prompt in number of characters.
        mode:
          type: string
          default: standard
          description: >-
            Corresponds to the `prompting_mode` for which this prompt is
            fetched. Default is 'standard'.
        stop:
          type: array
          items:
            type: string
          description: >-
            If specified, will be configure stop tokens for models that support
            this.
        max_tokens:
          type: integer
          description: >-
            The maximum number of tokens that can be generated in the chat
            completion.
      required:
        - task
      description: Configuration for prompts that will be used for a specific task.
      title: TaskPrompt
    FactCheckingRailConfig:
      type: object
      properties:
        parameters:
          type: object
          additionalProperties:
            description: Any type
        fallback_to_self_check:
          type: boolean
          default: false
          description: Whether to fall back to self-check if another method fail.
      description: Configuration data for the fact-checking rail.
      title: FactCheckingRailConfig
    AutoAlignOptions:
      type: object
      properties:
        guardrails_config:
          type: object
          additionalProperties:
            description: Any type
          description: >-
            The guardrails configuration that is passed to the AutoAlign
            endpoint
      description: List of guardrails that are activated
      title: AutoAlignOptions
    AutoAlignRailConfig:
      type: object
      properties:
        parameters:
          type: object
          additionalProperties:
            description: Any type
        input:
          $ref: '#/components/schemas/AutoAlignOptions'
          description: Input configuration for AutoAlign guardrails
        output:
          $ref: '#/components/schemas/AutoAlignOptions'
          description: Output configuration for AutoAlign guardrails
      description: Configuration data for the AutoAlign API
      title: AutoAlignRailConfig
    PatronusEvaluationSuccessStrategy:
      type: string
      enum:
        - all_pass
        - any_pass
      description: |-
        Strategy for determining whether a Patronus Evaluation API
        request should pass, especially when multiple evaluators
        are called in a single request.
        ALL_PASS requires all evaluators to pass for success.
        ANY_PASS requires only one evaluator to pass for success.
      title: PatronusEvaluationSuccessStrategy
    PatronusEvaluateApiParams:
      type: object
      properties:
        success_strategy:
          $ref: '#/components/schemas/PatronusEvaluationSuccessStrategy'
          default: all_pass
          description: >-
            Strategy to determine whether the Patronus Evaluate API Guardrail
            passes or not.
        params:
          type: object
          additionalProperties:
            description: Any type
          description: Parameters to the Patronus Evaluate API
      description: Config to parameterize the Patronus Evaluate API call
      title: PatronusEvaluateApiParams
    PatronusEvaluateConfigInput:
      type: object
      properties:
        evaluate_config:
          $ref: '#/components/schemas/PatronusEvaluateApiParams'
          description: Configuration passed to the Patronus Evaluate API
      description: Config for the Patronus Evaluate API call
      title: PatronusEvaluateConfigInput
    PatronusRailConfigInput:
      type: object
      properties:
        input:
          $ref: '#/components/schemas/PatronusEvaluateConfigInput'
          description: Patronus Evaluate API configuration for an Input Guardrail
        output:
          $ref: '#/components/schemas/PatronusEvaluateConfigInput'
          description: Patronus Evaluate API configuration for an Output Guardrail
      description: Configuration data for the Patronus Evaluate API
      title: PatronusRailConfigInput
    SensitiveDataDetectionOptions:
      type: object
      properties:
        entities:
          type: array
          items:
            type: string
          description: >-
            The list of entities that should be detected. Check out
            https://microsoft.github.io/presidio/supported_entities/ forthe list
            of supported entities.
        mask_token:
          type: string
          default: '*'
          description: The token that should be used to mask the sensitive data.
        score_threshold:
          type: number
          format: double
          default: 0.2
          description: >-
            The score threshold that should be used to detect the sensitive
            data.
      title: SensitiveDataDetectionOptions
    SensitiveDataDetection:
      type: object
      properties:
        recognizers:
          type: array
          items:
            type: object
            additionalProperties:
              description: Any type
          description: >-
            Additional custom recognizers. Check out
            https://microsoft.github.io/presidio/tutorial/08_no_code/ for more
            details.
        input:
          $ref: '#/components/schemas/SensitiveDataDetectionOptions'
          description: Configuration of the entities to be detected on the user input.
        output:
          $ref: '#/components/schemas/SensitiveDataDetectionOptions'
          description: Configuration of the entities to be detected on the bot output.
        retrieval:
          $ref: '#/components/schemas/SensitiveDataDetectionOptions'
          description: >-
            Configuration of the entities to be detected on retrieved relevant
            chunks.
      description: Configuration of what sensitive data should be detected.
      title: SensitiveDataDetection
    RegexDetectionOptions:
      type: object
      properties:
        patterns:
          type: array
          items:
            type: string
          description: List of regex patterns to match against the text.
        case_insensitive:
          type: boolean
          default: false
          description: Whether to perform case-insensitive matching.
      description: Configuration options for regex pattern detection on a specific source.
      title: RegexDetectionOptions
    RegexDetection:
      type: object
      properties:
        input:
          $ref: '#/components/schemas/RegexDetectionOptions'
          description: Configuration for regex patterns to detect on user input.
        output:
          $ref: '#/components/schemas/RegexDetectionOptions'
          description: Configuration for regex patterns to detect on bot output.
        retrieval:
          $ref: '#/components/schemas/RegexDetectionOptions'
          description: >-
            Configuration for regex patterns to detect on retrieved relevant
            chunks.
      description: Configuration for regex pattern detection.
      title: RegexDetection
    JailbreakDetectionConfig:
      type: object
      properties:
        server_endpoint:
          type: string
          description: The endpoint for the jailbreak detection heuristics/model container.
        length_per_perplexity_threshold:
          type: number
          format: double
          default: 89.79
          description: The length/perplexity threshold.
        prefix_suffix_perplexity_threshold:
          type: number
          format: double
          default: 1845.65
          description: The prefix/suffix perplexity threshold.
        nim_base_url:
          type: string
          description: >-
            Base URL for jailbreak detection model. Example:
            http://localhost:8000/v1
        nim_server_endpoint:
          type: string
          default: classify
          description: >-
            Classification path uri. Defaults to 'classify' for NemoGuard
            JailbreakDetect.
        api_key:
          type: string
          format: password
          description: >-
            Secret String with API key for use in Jailbreak requests. Takes
            precedence over api_key_env_var
        api_key_env_var:
          type: string
          description: >-
            Environment variable containing API key for jailbreak detection
            model
        nim_url:
          type: string
          description: 'DEPRECATED: Use nim_base_url instead'
        nim_port:
          type: integer
          description: 'DEPRECATED: Include port in nim_base_url instead'
        embedding:
          type: string
      description: Configuration data for jailbreak detection.
      title: JailbreakDetectionConfig
    InjectionDetection:
      type: object
      properties:
        injections:
          type: array
          items:
            type: string
          description: >-
            The list of injection types to detect. Options are 'sqli',
            'template', 'code', 'xss'.Currently, only SQL injection, template
            injection, code injection, and markdown cross-site scripting are
            supported. Custom rules can be added, provided they are in the
            `yara_path` and have a `.yara` file extension.
        action:
          type: string
          default: reject
          description: >-
            Action to take. Options are 'reject' to offer a rejection message,
            'omit' to mask the offending content, and 'sanitize' to pass the
            content as-is in the safest way. These options are listed in
            descending order of relative safety. 'sanitize' is not implemented
            at this time.
        yara_rules:
          type: object
          additionalProperties:
            type: string
          description: >-
            Dictionary mapping rule names to YARA rule strings. If provided,
            these rules will be used instead of loading rules from yara_path.
            Each rule should be a valid YARA rule string.
      title: InjectionDetection
    PrivateAIDetectionOptions:
      type: object
      properties:
        entities:
          type: array
          items:
            type: string
          description: The list of entities that should be detected.
      description: Configuration options for Private AI.
      title: PrivateAIDetectionOptions
    PrivateAIDetection:
      type: object
      properties:
        server_endpoint:
          type: string
          description: The endpoint for the private AI detection server.
        input:
          $ref: '#/components/schemas/PrivateAIDetectionOptions'
          description: Configuration of the entities to be detected on the user input.
        output:
          $ref: '#/components/schemas/PrivateAIDetectionOptions'
          description: Configuration of the entities to be detected on the bot output.
        retrieval:
          $ref: '#/components/schemas/PrivateAIDetectionOptions'
          description: >-
            Configuration of the entities to be detected on retrieved relevant
            chunks.
      description: Configuration for Private AI.
      title: PrivateAIDetection
    GLiNERDetectionOptions:
      type: object
      properties:
        entities:
          type: array
          items:
            type: string
          description: >-
            The list of entity labels to detect (e.g., 'email', 'phone_number',
            'ssn').
      description: Configuration options for GLiNER.
      title: GLiNERDetectionOptions
    GLiNERDetection:
      type: object
      properties:
        server_endpoint:
          type: string
          default: http://localhost:1235/v1/extract
          description: The endpoint for the GLiNER detection server.
        threshold:
          type: number
          format: double
          default: 0.5
          description: Confidence threshold for entity detection (0.0 to 1.0).
        chunk_length:
          type: integer
          default: 384
          description: Length of text chunks for processing.
        overlap:
          type: integer
          default: 128
          description: Overlap between chunks.
        flat_ner:
          type: boolean
          default: false
          description: >-
            Whether to use flat NER mode. Setting to False allows for nested
            entities.
        input:
          $ref: '#/components/schemas/GLiNERDetectionOptions'
          description: Configuration of the entities to be detected on the user input.
        output:
          $ref: '#/components/schemas/GLiNERDetectionOptions'
          description: Configuration of the entities to be detected on the bot output.
        retrieval:
          $ref: '#/components/schemas/GLiNERDetectionOptions'
          description: >-
            Configuration of the entities to be detected on retrieved relevant
            chunks.
      description: Configuration for GLiNER PII detection.
      title: GLiNERDetection
    FiddlerGuardrails:
      type: object
      properties:
        fiddler_endpoint:
          type: string
          default: http://localhost:8080/process/text
          description: The global endpoint for Fiddler Guardrails requests.
        safety_threshold:
          type: number
          format: double
          default: 0.1
          description: Fiddler Guardrails safety detection threshold.
        faithfulness_threshold:
          type: number
          format: double
          default: 0.05
          description: Fiddler Guardrails faithfulness detection threshold.
      description: Configuration for Fiddler Guardrails.
      title: FiddlerGuardrails
    ClavataRailConfigLabelMatchLogic:
      type: string
      enum:
        - ANY
        - ALL
      default: ANY
      description: |-
        The logic to use when deciding whether the evaluation matched.
                If ANY, only one of the configured labels needs to be found in the input or output.
                If ALL, all configured labels must be found in the input or output.
      title: ClavataRailConfigLabelMatchLogic
    ClavataRailOptions:
      type: object
      properties:
        policy:
          type: string
          description: The policy alias to use when evaluating inputs or outputs.
        labels:
          type: array
          items:
            type: string
          description: |-
            A list of labels to match against the policy.
                    If no labels are provided, the overall policy result will be returned.
                    If labels are provided, only hits on the provided labels will be considered a hit.
      required:
        - policy
      description: Configuration data for the Clavata API
      title: ClavataRailOptions
    ClavataRailConfig:
      type: object
      properties:
        server_endpoint:
          type: string
          default: https://gateway.app.clavata.ai:8443
          description: The endpoint for the Clavata API
        policies:
          type: object
          additionalProperties:
            type: string
          description: A dictionary of policy aliases and their corresponding IDs.
        label_match_logic:
          $ref: '#/components/schemas/ClavataRailConfigLabelMatchLogic'
          default: ANY
          description: |-
            The logic to use when deciding whether the evaluation matched.
                    If ANY, only one of the configured labels needs to be found in the input or output.
                    If ALL, all configured labels must be found in the input or output.
        input:
          $ref: '#/components/schemas/ClavataRailOptions'
          description: Clavata configuration for an Input Guardrail
        output:
          $ref: '#/components/schemas/ClavataRailOptions'
          description: Clavata configuration for an Output Guardrail
      description: Configuration data for the Clavata API
      title: ClavataRailConfig
    CrowdStrikeAIDRRailConfig:
      type: object
      properties:
        timeout:
          type: number
          format: double
          default: 30
          description: Timeout in seconds for API requests to CrowdStrike AIDR
      description: Configuration data for the CrowdStrike AIDR API
      title: CrowdStrikeAIDRRailConfig
    PangeaRailOptions:
      type: object
      properties:
        recipe:
          type: string
          description: >-
            Recipe key of a configuration of data types and settings defined in
            the Pangea User Console. It
                    specifies the rules that are to be applied to the text, such as defang malicious URLs.
      required:
        - recipe
      description: Configuration data for the Pangea AI Guard API
      title: PangeaRailOptions
    PangeaRailConfig:
      type: object
      properties:
        input:
          $ref: '#/components/schemas/PangeaRailOptions'
          description: Pangea configuration for an Input Guardrail
        output:
          $ref: '#/components/schemas/PangeaRailOptions'
          description: Pangea configuration for an Output Guardrail
      description: Configuration data for the Pangea AI Guard API
      title: PangeaRailConfig
    GuardrailsAIValidatorConfig:
      type: object
      properties:
        name:
          type: string
          description: >-
            Unique identifier or import path for the Guardrails AI validator
            (e.g., 'toxic_language', 'pii', 'regex_match', or
            'guardrails/competitor_check').
        parameters:
          type: object
          additionalProperties:
            description: Any type
          description: >-
            Parameters to pass to the validator during initialization (e.g.,
            threshold, regex pattern).
        metadata:
          type: object
          additionalProperties:
            description: Any type
          description: >-
            Metadata to pass to the validator during validation (e.g.,
            valid_topics, context).
      required:
        - name
      description: Configuration for a single Guardrails AI validator.
      title: GuardrailsAIValidatorConfig
    GuardrailsAIRailConfig:
      type: object
      properties:
        validators:
          type: array
          items:
            $ref: '#/components/schemas/GuardrailsAIValidatorConfig'
          description: >-
            List of Guardrails AI validators to apply. Each validator can have
            its own parameters and metadata.
      description: Configuration data for Guardrails AI integration.
      title: GuardrailsAIRailConfig
    TrendMicroRailConfig:
      type: object
      properties:
        v1_url:
          type: string
          default: https://api.xdr.trendmicro.com/v3.0/aiSecurity/applyGuardrails
          description: >-
            The endpoint for the Trend Micro AI Guard API. For other regions,
            use:
            https://api.{region}.xdr.trendmicro.com/v3.0/aiSecurity/applyGuardrails
            where region is eu, jp, au, in, sg, or mea.
        api_key_env_var:
          type: string
          description: Environment variable containing API key for Trend Micro AI Guard
        application_name:
          type: string
          default: nemo-guardrails
          description: >-
            Application name for TMV1-Application-Name header (REQUIRED). Must
            contain only letters, numbers, hyphens, and underscores, with a
            maximum length of 64 characters.
        detailed_response:
          type: boolean
          default: false
          description: >-
            If True, returns detailed AI Guard results with confidence scores
            (Prefer: return=representation). If False, returns minimal response
            with only action and reasons (Prefer: return=minimal).
      description: Configuration data for the Trend Micro AI Guard API
      title: TrendMicroRailConfig
    AIDefenseRailConfig:
      type: object
      properties:
        timeout:
          type: number
          format: double
          default: 30
          description: Timeout in seconds for API requests to AI Defense service
        fail_open:
          type: boolean
          default: false
          description: >-
            If True, allow content when AI Defense API call fails (fail open).
            If False, block content when API call fails (fail closed). Does not
            affect missing configuration validation.
      description: Configuration data for the Cisco AI Defense API
      title: AIDefenseRailConfig
    MultilingualConfig:
      type: object
      properties:
        enabled:
          type: boolean
          default: false
          description: >-
            If True, detect the language of user input and return refusal
            messages in the same language. Supported languages: en (English), es
            (Spanish), zh (Chinese), de (German), fr (French), hi (Hindi), ja
            (Japanese), ar (Arabic), th (Thai).
        refusal_messages:
          type: object
          additionalProperties:
            type: string
          description: >-
            Custom refusal messages per language code. If not specified,
            built-in defaults are used. Example: {'en': 'Sorry, I cannot help.',
            'es': 'Lo siento, no puedo ayudar.'}
      description: Configuration for multilingual refusal messages.
      title: MultilingualConfig
    ReasoningConfig:
      type: object
      properties:
        enabled:
          type: boolean
          default: false
          description: >-
            If True, enable reasoning mode (with <think> traces) for content
            safety models. If False, use low-latency mode without reasoning
            traces.
      description: Configuration for reasoning mode in content safety models.
      title: ReasoningConfig
    ContentSafetyConfig:
      type: object
      properties:
        multilingual:
          $ref: '#/components/schemas/MultilingualConfig'
        reasoning:
          $ref: '#/components/schemas/ReasoningConfig'
      description: Configuration data for content safety rails.
      title: ContentSafetyConfig
    RailsConfigDataInput:
      type: object
      properties:
        fact_checking:
          $ref: '#/components/schemas/FactCheckingRailConfig'
          description: Configuration data for the fact-checking rail.
        autoalign:
          $ref: '#/components/schemas/AutoAlignRailConfig'
          description: Configuration data for the AutoAlign guardrails API.
        patronus:
          $ref: '#/components/schemas/PatronusRailConfigInput'
          description: Configuration data for the Patronus Evaluate API.
        sensitive_data_detection:
          $ref: '#/components/schemas/SensitiveDataDetection'
          description: Configuration for detecting sensitive data.
        regex_detection:
          $ref: '#/components/schemas/RegexDetection'
          description: Configuration for regex pattern detection.
        jailbreak_detection:
          $ref: '#/components/schemas/JailbreakDetectionConfig'
          description: Configuration for jailbreak detection.
        injection_detection:
          $ref: '#/components/schemas/InjectionDetection'
          description: Configuration for injection detection.
        privateai:
          $ref: '#/components/schemas/PrivateAIDetection'
          description: Configuration for Private AI.
        gliner:
          $ref: '#/components/schemas/GLiNERDetection'
          description: Configuration for GLiNER PII detection.
        fiddler:
          $ref: '#/components/schemas/FiddlerGuardrails'
          description: Configuration for Fiddler Guardrails.
        clavata:
          $ref: '#/components/schemas/ClavataRailConfig'
          description: Configuration for Clavata.
        crowdstrike_aidr:
          $ref: '#/components/schemas/CrowdStrikeAIDRRailConfig'
          description: Configuration for CrowdStrike AIDR.
        pangea:
          $ref: '#/components/schemas/PangeaRailConfig'
          description: Configuration for Pangea.
        guardrails_ai:
          $ref: '#/components/schemas/GuardrailsAIRailConfig'
          description: Configuration for Guardrails AI validators.
        trend_micro:
          $ref: '#/components/schemas/TrendMicroRailConfig'
          description: Configuration for Trend Micro.
        ai_defense:
          $ref: '#/components/schemas/AIDefenseRailConfig'
          description: Configuration for Cisco AI Defense.
        content_safety:
          $ref: '#/components/schemas/ContentSafetyConfig'
          description: Configuration for content safety rails.
      description: Configuration data for specific rails that are supported out-of-the-box.
      title: RailsConfigDataInput
    InputRails:
      type: object
      properties:
        parallel:
          type: boolean
          default: false
          description: If True, the input rails are executed in parallel.
        flows:
          type: array
          items:
            type: string
          description: The names of all the flows that implement input rails.
      description: Configuration of input rails.
      title: InputRails
    OutputRailsStreamingConfig:
      type: object
      properties:
        enabled:
          type: boolean
          default: true
          description: Enables streaming mode when True.
        chunk_size:
          type: integer
          default: 200
          description: >-
            The number of tokens in each processing chunk. This is the size of
            the token block on which output rails are applied.
        context_size:
          type: integer
          default: 50
          description: >-
            The number of tokens carried over from the previous chunk to provide
            context for continuity in processing.
        stream_first:
          type: boolean
          default: true
          description: >-
            If True, token chunks are streamed immediately before output rails
            are applied.
      description: Configuration for managing streaming output of LLM tokens.
      title: OutputRailsStreamingConfig
    OutputRails:
      type: object
      properties:
        parallel:
          type: boolean
          default: false
          description: If True, the output rails are executed in parallel.
        flows:
          type: array
          items:
            type: string
          description: The names of all the flows that implement output rails.
        streaming:
          $ref: '#/components/schemas/OutputRailsStreamingConfig'
          description: Configuration for streaming output rails.
        apply_to_reasoning_traces:
          type: boolean
          default: false
          description: >-
            If True, output rails will apply guardrails to both reasoning traces
            and output response. If False, output rails will only apply
            guardrails to the output response excluding the reasoning traces,
            thus keeping reasoning traces unaltered.
      description: Configuration of output rails.
      title: OutputRails
    RetrievalRails:
      type: object
      properties:
        flows:
          type: array
          items:
            type: string
          description: The names of all the flows that implement retrieval rails.
      description: Configuration of retrieval rails.
      title: RetrievalRails
    SingleCallConfig:
      type: object
      properties:
        enabled:
          type: boolean
          default: false
        fallback_to_multiple_calls:
          type: boolean
          default: true
          description: >-
            Whether to fall back to multiple calls if a single call is not
            possible.
      description: Configuration for the single LLM call option for topical rails.
      title: SingleCallConfig
    UserMessagesConfig:
      type: object
      properties:
        embeddings_only:
          type: boolean
          default: false
          description: >-
            Whether to use only embeddings for computing the user canonical form
            messages.
        embeddings_only_similarity_threshold:
          type: number
          format: double
          description: >-
            The similarity threshold to use when using only embeddings for
            computing the user canonical form messages.
        embeddings_only_fallback_intent:
          type: string
          description: >-
            Defines the fallback intent when the similarity is below the
            threshold. If set to None, the user intent is computed normally
            using the LLM. If set to a string value, that string is used as the
            intent.
      description: Configuration for how the user messages are interpreted.
      title: UserMessagesConfig
    DialogRails:
      type: object
      properties:
        single_call:
          $ref: '#/components/schemas/SingleCallConfig'
          description: Configuration for the single LLM call option.
        user_messages:
          $ref: '#/components/schemas/UserMessagesConfig'
      description: Configuration of topical rails.
      title: DialogRails
    ActionRails:
      type: object
      properties:
        instant_actions:
          type: array
          items:
            type: string
          description: The names of all actions which should finish instantly.
      description: >-
        Configuration of action rails.


        Action rails control various options related to the execution of
        actions.

        Currently, only


        In the future multiple options will be added, e.g., what input
        validation should be

        performed per action, output validation, throttling, disabling, etc.
      title: ActionRails
    ToolOutputRails:
      type: object
      properties:
        flows:
          type: array
          items:
            type: string
          description: The names of all the flows that implement tool output rails.
        parallel:
          type: boolean
          default: false
          description: If True, the tool output rails are executed in parallel.
      description: >-
        Configuration of tool output rails.

        Tool output rails are applied to tool calls before they are executed.

        They can validate tool names, parameters, and context to ensure safe
        tool usage.
      title: ToolOutputRails
    ToolInputRails:
      type: object
      properties:
        flows:
          type: array
          items:
            type: string
          description: The names of all the flows that implement tool input rails.
        parallel:
          type: boolean
          default: false
          description: If True, the tool input rails are executed in parallel.
      description: >-
        Configuration of tool input rails.

        Tool input rails are applied to tool results before they are processed.

        They can validate, filter, or transform tool outputs for security and
        safety.
      title: ToolInputRails
    RailsInput:
      type: object
      properties:
        config:
          $ref: '#/components/schemas/RailsConfigDataInput'
          description: >-
            Configuration data for specific rails that are supported
            out-of-the-box.
        input:
          $ref: '#/components/schemas/InputRails'
          description: Configuration of the input rails.
        output:
          $ref: '#/components/schemas/OutputRails'
          description: Configuration of the output rails.
        retrieval:
          $ref: '#/components/schemas/RetrievalRails'
          description: Configuration of the retrieval rails.
        dialog:
          $ref: '#/components/schemas/DialogRails'
          description: Configuration of the dialog rails.
        actions:
          $ref: '#/components/schemas/ActionRails'
          description: Configuration of action rails.
        tool_output:
          $ref: '#/components/schemas/ToolOutputRails'
          description: Configuration of tool output rails.
        tool_input:
          $ref: '#/components/schemas/ToolInputRails'
          description: Configuration of tool input rails.
      description: Configuration of specific rails.
      title: RailsInput
    LogAdapterConfig:
      type: object
      properties:
        name:
          type: string
          default: FileSystem
          description: The name of the adapter.
      title: LogAdapterConfig
    TracingConfig:
      type: object
      properties:
        enabled:
          type: boolean
          default: false
        adapters:
          type: array
          items:
            $ref: '#/components/schemas/LogAdapterConfig'
          description: >-
            The list of tracing adapters to use. If not specified, the default
            adapters are used.
        span_format:
          type: string
          default: opentelemetry
          description: >-
            The span format to use. Options are 'legacy' (simple metrics) or
            'opentelemetry' (OpenTelemetry semantic conventions).
        enable_content_capture:
          type: boolean
          default: false
          description: >-
            Capture prompts and responses (user/assistant/tool message content)
            in tracing/telemetry events. Disabled by default for privacy and
            alignment with OpenTelemetry GenAI semantic conventions. WARNING:
            Enabling this may include PII and sensitive data in your telemetry
            backend.
      title: TracingConfig
    RailsConfigInput:
      type: object
      properties:
        models:
          type: array
          items:
            $ref: '#/components/schemas/Model'
          description: The list of models used by the rails configuration.
        instructions:
          type: array
          items:
            $ref: '#/components/schemas/Instruction'
          default:
            - type: general
              content: >-
                Below is a conversation between a helpful AI assistant and a
                user. The bot is designed to generate human-like text based on
                the input that it receives. The bot is talkative and provides
                lots of specific details. If the bot does not know the answer to
                a question, it truthfully says it does not know.
          description: List of instructions in natural language that the LLM should use.
        actions_server_url:
          type: string
          description: The URL of the actions server that should be used for the rails.
        sample_conversation:
          type: string
          default: |
            user "Hello there!"
              express greeting
            bot express greeting
              "Hello! How can I assist you today?"
            user "What can you do for me?"
              ask about capabilities
            bot respond about capabilities
              "As an AI assistant, I can help you with a wide range of tasks. This includes question answering on various topics, generating text for various purposes and providing suggestions based on your preferences."
            user "Tell me a bit about the history of NVIDIA."
              ask general question
            bot response for general question
              "NVIDIA is a technology company that specializes in designing and manufacturing graphics processing units (GPUs) and other computer hardware. The company was founded in 1993 by Jen-Hsun Huang, Chris Malachowsky, and Curtis Priem."
            user "tell me more"
              request more information
            bot provide more information
              "Initially, the company focused on developing 3D graphics processing technology for the PC gaming market. In 1999, NVIDIA released the GeForce 256, the world's first GPU, which was a major breakthrough for the gaming industry. The company continued to innovate in the GPU space, releasing new products and expanding into other markets such as professional graphics, mobile devices, and artificial intelligence."
            user "thanks"
              express appreciation
            bot express appreciation and offer additional help
              "You're welcome. If you have any more questions or if there's anything else I can help you with, please don't hesitate to ask."
          description: The sample conversation that should be used inside the prompts.
        prompts:
          type: array
          items:
            $ref: '#/components/schemas/TaskPrompt'
          description: The prompts that should be used for the various LLM tasks.
        prompting_mode:
          type: string
          default: standard
          description: Allows choosing between different prompting strategies.
        lowest_temperature:
          type: number
          format: double
          default: 0.001
          description: The lowest temperature that should be used for the LLM.
        enable_multi_step_generation:
          type: boolean
          default: false
          description: Whether to enable multi-step generation for the LLM.
        colang_version:
          type: string
          default: '1.0'
          description: The Colang version to use.
        custom_data:
          type: object
          additionalProperties:
            description: Any type
          description: Any custom configuration data that might be needed.
        rails:
          $ref: '#/components/schemas/RailsInput'
          description: Configuration for the various rails (input, output, etc.).
        enable_rails_exceptions:
          type: boolean
          default: false
          description: >-
            If set, the pre-defined guardrails raise exceptions instead of
            returning pre-defined messages.
        passthrough:
          type: boolean
          description: >-
            Whether the original prompt should pass through the guardrails
            configuration as is. This means it will not be altered in any way. 
        tracing:
          $ref: '#/components/schemas/TracingConfig'
          description: Configuration for tracing.
      description: Configuration object for the models and the rails.
      title: RailsConfigInput
    GuardrailsDataInputConfig:
      oneOf:
        - type: string
        - $ref: '#/components/schemas/RailsConfigInput'
      description: The id of the configuration or its dict representation to be used.
      title: GuardrailsDataInputConfig
    GenerationRailsOptionsInput:
      oneOf:
        - type: boolean
        - type: array
          items:
            type: string
      description: >-
        Whether the input rails are enabled or not. If a list of names is
        specified, then only the specified input rails will be applied.
      title: GenerationRailsOptionsInput
    GenerationRailsOptionsOutput:
      oneOf:
        - type: boolean
        - type: array
          items:
            type: string
      description: >-
        Whether the output rails are enabled or not. If a list of names is
        specified, then only the specified output rails will be applied.
      title: GenerationRailsOptionsOutput
    GenerationRailsOptionsRetrieval:
      oneOf:
        - type: boolean
        - type: array
          items:
            type: string
      description: >-
        Whether the retrieval rails are enabled or not. If a list of names is
        specified, then only the specified retrieval rails will be applied.
      title: GenerationRailsOptionsRetrieval
    GenerationRailsOptions:
      type: object
      properties:
        input:
          $ref: '#/components/schemas/GenerationRailsOptionsInput'
          default: true
          description: >-
            Whether the input rails are enabled or not. If a list of names is
            specified, then only the specified input rails will be applied.
        output:
          $ref: '#/components/schemas/GenerationRailsOptionsOutput'
          default: true
          description: >-
            Whether the output rails are enabled or not. If a list of names is
            specified, then only the specified output rails will be applied.
        retrieval:
          $ref: '#/components/schemas/GenerationRailsOptionsRetrieval'
          default: true
          description: >-
            Whether the retrieval rails are enabled or not. If a list of names
            is specified, then only the specified retrieval rails will be
            applied.
        dialog:
          type: boolean
          default: true
          description: Whether the dialog rails are enabled or not.
      description: Options for what rails should be used during the generation.
      title: GenerationRailsOptions
    GenerationOptionsOutputVars:
      oneOf:
        - type: boolean
        - type: array
          items:
            type: string
      description: >-
        Whether additional context information should be returned. When True is
        specified, the whole context is returned. Otherwise, a list of key names
        can be specified.
      title: GenerationOptionsOutputVars
    GenerationLogOptions:
      type: object
      properties:
        activated_rails:
          type: boolean
          default: false
          description: >-
            Include detailed information about the rails that were activated
            during generation.
        llm_calls:
          type: boolean
          default: false
          description: >-
            Include information about all the LLM calls that were made. This
            includes: prompt, completion, token usage, raw response, etc.
        internal_events:
          type: boolean
          default: false
          description: Include the array of internal generated events.
        colang_history:
          type: boolean
          default: false
          description: Include the history of the conversation in Colang format.
        stats:
          type: boolean
          default: false
          description: >-
            Include generation statistics — rail durations, LLM call counts, and
            token usage.
      description: Options for what should be included in the generation log.
      title: GenerationLogOptions
    GenerationOptions:
      type: object
      properties:
        rails:
          $ref: '#/components/schemas/GenerationRailsOptions'
          description: >-
            Options for which rails should be applied for the generation. By
            default, all rails are enabled.
        llm_params:
          type: object
          additionalProperties:
            description: Any type
          description: Additional parameters that should be used for the LLM call
        llm_output:
          type: boolean
          default: false
          description: Whether the response should also include any custom LLM output.
        output_vars:
          $ref: '#/components/schemas/GenerationOptionsOutputVars'
          description: >-
            Whether additional context information should be returned. When True
            is specified, the whole context is returned. Otherwise, a list of
            key names can be specified.
        log:
          $ref: '#/components/schemas/GenerationLogOptions'
          description: >-
            Options about what to include in the log. By default, nothing is
            included. 
      description: >-
        A set of options that should be applied during a generation.


        The GenerationOptions control various things such as what rails are
        enabled,

        additional parameters for the main LLM, whether the rails should be
        enforced or

        ran in parallel, what to be included in the generation log, etc.
      title: GenerationOptions
    GuardrailsDataInput:
      type: object
      properties:
        config:
          $ref: '#/components/schemas/GuardrailsDataInputConfig'
          default: system/default
          description: The id of the configuration or its dict representation to be used.
        config_id:
          type: string
          default: system/default
          description: The id of the configuration to be used.
        config_ids:
          type: array
          items:
            type: string
          description: >-
            The list of configuration ids to be used. If set, the configurations
            will be combined.
        return_choice:
          type: boolean
          default: false
          description: >-
            If set, guardrails data will be included as a JSON in the choices
            array.
        context:
          type: object
          additionalProperties:
            description: Any type
          description: Additional context data to be added to the conversation.
        stream:
          type: boolean
          default: false
          description: >-
            If set, partial message deltas will be sent, like in ChatGPT. Tokens
            will be sent as data-only server-sent events as they become
            available, with the stream terminated by a data: [DONE] message.
        options:
          $ref: '#/components/schemas/GenerationOptions'
          description: Additional options for controlling the generation.
        state:
          type: object
          additionalProperties:
            description: Any type
          description: A state object that should be used to continue the interaction.
      title: GuardrailsDataInput
    GuardrailCheckRequest:
      type: object
      properties:
        model:
          type: string
          description: >-
            The model to use for completion. Must be one of the available
            models.
        response_format:
          type: object
          additionalProperties:
            description: Any type
          description: >-
            Format of the response. Use {'type': 'json_object'} for JSON mode or
            {'type': 'json_schema', 'json_schema': {...}} for structured
            outputs.
        max_tokens:
          type: integer
          description: >-
            The maximum number of tokens that can be generated in the chat
            completion.
        'n':
          type: integer
          description: How many chat completion choices to generate for each input message.
        stream:
          type: boolean
          default: false
          description: If set, partial message deltas will be sent, like in ChatGPT.
        temperature:
          type: number
          format: double
          description: What sampling temperature to use, between 0 and 2.
        top_p:
          type: number
          format: double
          description: >-
            An alternative to sampling with temperature, called nucleus
            sampling.
        stop:
          $ref: '#/components/schemas/GuardrailCheckRequestStop'
          description: Up to 4 sequences where the API will stop generating further tokens.
        frequency_penalty:
          type: number
          format: double
          description: >-
            Positive values penalize new tokens based on their existing
            frequency in the text.
        presence_penalty:
          type: number
          format: double
          description: >-
            Positive values penalize new tokens based on whether they appear in
            the text so far.
        function_call:
          $ref: '#/components/schemas/GuardrailCheckRequestFunctionCall'
          description: >-
            Deprecated in favor of tool_choice. 'none' means the model will not
            call a function and instead generates a message. 'auto' means the
            model can pick between generating a message or calling a function.
            Specifying a particular function via {'name': 'my_function'} forces
            the model to call that function.
        seed:
          type: integer
          description: If specified, attempts to sample deterministically.
        logit_bias:
          type: object
          additionalProperties:
            type: number
            format: double
          description: >-
            Modify the likelihood of specified tokens appearing in the
            completion. Maps token IDs (as strings) to bias values from -100 to
            100.
        top_logprobs:
          type: integer
          description: The number of most likely tokens to return at each token position.
        logprobs:
          type: boolean
          description: >-
            Whether to return log probabilities of the output tokens or not. If
            true, returns the log probabilities of each output token returned in
            the content of message
        tool_choice:
          $ref: '#/components/schemas/GuardrailCheckRequestToolChoice'
          description: >-
            Controls which (if any) tool is called by the model. 'none' means no
            tool is called, 'auto' lets the model decide, 'required' forces a
            tool call.
        user:
          type: string
          description: >-
            A unique identifier representing your end-user, used by some
            providers for abuse monitoring.
        tools:
          type: array
          items:
            type: object
            additionalProperties:
              description: Any type
          description: >-
            A list of tools the model may call. Each tool is an object with a
            'type' field and a 'function' definition.
        ignore_eos:
          type: boolean
          description: Ignore the eos when running
        reasoning_effort:
          type: string
          description: >-
            Constrains effort on reasoning for reasoning models. Reducing
            reasoning effort can result in faster responses and fewer tokens
            used on reasoning in a response.
        max_completion_tokens:
          type: integer
          description: >-
            An upper bound for the number of tokens that can be generated for a
            completion, including visible output tokens and reasoning tokens.
            Preferred over max_tokens for reasoning models.
        stream_options:
          type: object
          additionalProperties:
            type: boolean
          description: >-
            Options for streaming response. Only set this when stream=True.
            Supports include_usage to receive token usage in the final stream
            chunk.
        messages:
          type: array
          items:
            $ref: '#/components/schemas/GuardrailCheckRequestMessagesItems'
          description: A list of messages comprising the conversation so far
        vision:
          type: boolean
          description: Whether this is a vision-capable request with image inputs.
        guardrails:
          $ref: '#/components/schemas/GuardrailsDataInput'
          description: Guardrails specific options for the request.
      required:
        - model
        - messages
      description: Currently only inherits, in the future we might add new fields.
      title: GuardrailCheckRequest
    StatusEnum:
      type: string
      enum:
        - blocked
        - success
        - unknown
      title: StatusEnum
    RailStatus:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/StatusEnum'
          description: Status of the individual rail.
      required:
        - status
      title: RailStatus
    LLMCallInfo:
      type: object
      properties:
        task:
          type: string
          description: The internal task that made the call.
        duration:
          type: number
          format: double
          description: The duration in seconds.
        total_tokens:
          type: integer
          description: The total number of used tokens.
        prompt_tokens:
          type: integer
          description: The number of input tokens.
        completion_tokens:
          type: integer
          description: The number of output tokens.
        started_at:
          type: number
          format: double
          default: 0
          description: The timestamp for when the LLM call started.
        finished_at:
          type: number
          format: double
          default: 0
          description: The timestamp for when the LLM call finished.
        id:
          type: string
          description: The unique prompt identifier.
        prompt:
          type: string
          description: The prompt that was used for the LLM call.
        completion:
          type: string
          description: The completion generated by the LLM.
        raw_response:
          type: object
          additionalProperties:
            description: Any type
          description: >-
            The raw response received from the LLM. May contain additional
            information, e.g. logprobs.
        llm_model_name:
          type: string
          default: unknown
          description: The name of the model use for the LLM call.
      title: LLMCallInfo
    ExecutedAction:
      type: object
      properties:
        action_name:
          type: string
          description: The name of the action that was executed.
        action_params:
          type: object
          additionalProperties:
            description: Any type
          description: The parameters for the action.
        return_value:
          description: The value returned by the action.
        llm_calls:
          type: array
          items:
            $ref: '#/components/schemas/LLMCallInfo'
          description: Information about the LLM calls made by the action.
        started_at:
          type: number
          format: double
          description: Timestamp for when the action started.
        finished_at:
          type: number
          format: double
          description: Timestamp for when the action finished.
        duration:
          type: number
          format: double
          description: How long the action took to execute, in seconds.
      required:
        - action_name
      description: Information about an action that was executed.
      title: ExecutedAction
    ActivatedRail:
      type: object
      properties:
        type:
          type: string
          description: >-
            The type of the rail that was activated, e.g., input, output,
            dialog.
        name:
          type: string
          description: >-
            The name of the rail, i.e., the name of the flow implementing the
            rail.
        decisions:
          type: array
          items:
            type: string
          description: >-
            A sequence of decisions made by the rail, e.g., 'bot refuse to
            respond', 'stop', 'continue'.
        executed_actions:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedAction'
          description: The list of actions executed by the rail.
        stop:
          type: boolean
          default: false
          description: Whether the rail decided to stop any further processing.
        additional_info:
          type: object
          additionalProperties:
            description: Any type
          description: Additional information coming from rail.
        started_at:
          type: number
          format: double
          description: Timestamp for when the rail started.
        finished_at:
          type: number
          format: double
          description: Timestamp for when the rail finished.
        duration:
          type: number
          format: double
          description: >-
            The duration in seconds for applying the rail. Some rails are
            applied instantly, e.g., dialog rails, so they don't have a
            duration.
      required:
        - type
        - name
      description: A rail that was activated during the generation.
      title: ActivatedRail
    GenerationStats:
      type: object
      properties:
        input_rails_duration:
          type: number
          format: double
          description: The time in seconds spent in processing the input rails.
        dialog_rails_duration:
          type: number
          format: double
          description: The time in seconds spent in processing the dialog rails.
        generation_rails_duration:
          type: number
          format: double
          description: The time in seconds spent in generation rails.
        output_rails_duration:
          type: number
          format: double
          description: The time in seconds spent in processing the output rails.
        total_duration:
          type: number
          format: double
          description: The total time in seconds.
        llm_calls_duration:
          type: number
          format: double
          default: 0
          description: The time in seconds spent in LLM calls.
        llm_calls_count:
          type: integer
          default: 0
          description: The number of LLM calls in total.
        llm_calls_total_prompt_tokens:
          type: integer
          default: 0
          description: The total number of prompt tokens.
        llm_calls_total_completion_tokens:
          type: integer
          default: 0
          description: The total number of completion tokens.
        llm_calls_total_tokens:
          type: integer
          default: 0
          description: The total number of tokens.
      description: General stats about the generation.
      title: GenerationStats
    GenerationLog:
      type: object
      properties:
        activated_rails:
          type: array
          items:
            $ref: '#/components/schemas/ActivatedRail'
          description: The list of rails that were activated during generation.
        stats:
          $ref: '#/components/schemas/GenerationStats'
          description: General stats about the generation process.
        llm_calls:
          type: array
          items:
            $ref: '#/components/schemas/LLMCallInfo'
          description: >-
            The list of LLM calls that have been made to fulfill the generation
            request. 
        internal_events:
          type: array
          items:
            type: object
            additionalProperties:
              description: Any type
          description: The complete sequence of internal events generated.
        colang_history:
          type: string
          description: The Colang history associated with the generation.
      description: >-
        Contains additional logging information associated with a generation
        call.
      title: GenerationLog
    GuardrailsDataOutput:
      type: object
      properties:
        llm_output:
          type: object
          additionalProperties:
            description: Any type
          description: Contains any additional output coming from the LLM.
        config_ids:
          type: array
          items:
            type: string
          description: The list of configuration ids that were used.
        output_data:
          type: object
          additionalProperties:
            description: Any type
          description: >-
            The output data, i.e. a dict with the values corresponding to the
            `output_vars`.
        log:
          $ref: '#/components/schemas/GenerationLog'
          description: Additional logging information.
      title: GuardrailsDataOutput
    GuardrailCheckResponse:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/StatusEnum'
          description: Overall status indicating if all rails passed or if any failed.
        rails_status:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/RailStatus'
          description: Dictionary mapping each rail to its status.
        guardrails_data:
          $ref: '#/components/schemas/GuardrailsDataOutput'
          description: Additional data related to guardrails.
      required:
        - status
        - rails_status
      title: GuardrailCheckResponse

```

## Examples



**Request**

```json
{
  "model": "string",
  "messages": [
    {
      "content": "string",
      "role": "string"
    }
  ]
}
```

**Response**

```json
{
  "status": "blocked",
  "rails_status": {},
  "guardrails_data": {
    "llm_output": {},
    "config_ids": [
      "string"
    ],
    "output_data": {},
    "log": {
      "activated_rails": [
        {
          "type": "string",
          "name": "string",
          "decisions": [
            "string"
          ],
          "executed_actions": [
            {
              "action_name": "string",
              "action_params": {},
              "return_value": null,
              "llm_calls": [
                {
                  "task": "string",
                  "duration": 1.1,
                  "total_tokens": 1,
                  "prompt_tokens": 1,
                  "completion_tokens": 1,
                  "started_at": 0,
                  "finished_at": 0,
                  "id": "string",
                  "prompt": "string",
                  "completion": "string",
                  "raw_response": {},
                  "llm_model_name": "unknown"
                }
              ],
              "started_at": 1.1,
              "finished_at": 1.1,
              "duration": 1.1
            }
          ],
          "stop": false,
          "additional_info": {},
          "started_at": 1.1,
          "finished_at": 1.1,
          "duration": 1.1
        }
      ],
      "stats": {
        "input_rails_duration": 1.1,
        "dialog_rails_duration": 1.1,
        "generation_rails_duration": 1.1,
        "output_rails_duration": 1.1,
        "total_duration": 1.1,
        "llm_calls_duration": 0,
        "llm_calls_count": 0,
        "llm_calls_total_prompt_tokens": 0,
        "llm_calls_total_completion_tokens": 0,
        "llm_calls_total_tokens": 0
      },
      "llm_calls": [
        {
          "task": "string",
          "duration": 1.1,
          "total_tokens": 1,
          "prompt_tokens": 1,
          "completion_tokens": 1,
          "started_at": 0,
          "finished_at": 0,
          "id": "string",
          "prompt": "string",
          "completion": "string",
          "raw_response": {},
          "llm_model_name": "unknown"
        }
      ],
      "internal_events": [
        {}
      ],
      "colang_history": "string"
    }
  }
}
```

**SDK Code**

```python
import requests

url = "https://host.com/apis/guardrails/v2/workspaces/workspace/checks"

payload = {
    "model": "string",
    "messages": [
        {
            "content": "string",
            "role": "string"
        }
    ]
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://host.com/apis/guardrails/v2/workspaces/workspace/checks';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"model":"string","messages":[{"content":"string","role":"string"}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://host.com/apis/guardrails/v2/workspaces/workspace/checks"

	payload := strings.NewReader("{\n  \"model\": \"string\",\n  \"messages\": [\n    {\n      \"content\": \"string\",\n      \"role\": \"string\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://host.com/apis/guardrails/v2/workspaces/workspace/checks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"model\": \"string\",\n  \"messages\": [\n    {\n      \"content\": \"string\",\n      \"role\": \"string\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://host.com/apis/guardrails/v2/workspaces/workspace/checks")
  .header("Content-Type", "application/json")
  .body("{\n  \"model\": \"string\",\n  \"messages\": [\n    {\n      \"content\": \"string\",\n      \"role\": \"string\"\n    }\n  ]\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://host.com/apis/guardrails/v2/workspaces/workspace/checks', [
  'body' => '{
  "model": "string",
  "messages": [
    {
      "content": "string",
      "role": "string"
    }
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://host.com/apis/guardrails/v2/workspaces/workspace/checks");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"model\": \"string\",\n  \"messages\": [\n    {\n      \"content\": \"string\",\n      \"role\": \"string\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "model": "string",
  "messages": [
    [
      "content": "string",
      "role": "string"
    ]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://host.com/apis/guardrails/v2/workspaces/workspace/checks")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```