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

# Create Config

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

Create a new guardrail config.

Reference: https://docs.nvidia.com/nemo-platform/nemo-platform/documentation/reference/api-reference/guardrails/create-config-apis-guardrails-v-2-workspaces-workspace-configs-post

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Nemo Platform API
  version: 1.0.0
paths:
  /apis/guardrails/v2/workspaces/{workspace}/configs:
    post:
      operationId: create-config-apis-guardrails-v-2-workspaces-workspace-configs-post
      summary: Create Config
      description: Create a new guardrail config.
      tags:
        - subpackage_guardrails
      parameters:
        - name: workspace
          in: path
          required: true
          schema:
            type: string
      responses:
        '201':
          description: Config created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GuardrailConfig'
        '409':
          description: Config already exists.
          content:
            application/json:
              schema:
                description: Any type
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                description: Any type
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GuardrailConfigInput'
servers:
  - url: https://host.com
    description: Default
components:
  schemas:
    GuardrailConfigInput:
      type: object
      properties:
        name:
          type: string
          description: The name of the guardrail config
        description:
          type: string
          description: Description of the guardrail config
        data:
          type: object
          additionalProperties:
            description: Any type
          description: Guardrail configuration data
      required:
        - name
      description: Input schema for creating a guardrail config.
      title: GuardrailConfigInput
    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
    PatronusEvaluateConfigOutput:
      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: PatronusEvaluateConfigOutput
    PatronusRailConfigOutput:
      type: object
      properties:
        input:
          $ref: '#/components/schemas/PatronusEvaluateConfigOutput'
          description: Patronus Evaluate API configuration for an Input Guardrail
        output:
          $ref: '#/components/schemas/PatronusEvaluateConfigOutput'
          description: Patronus Evaluate API configuration for an Output Guardrail
      description: Configuration data for the Patronus Evaluate API
      title: PatronusRailConfigOutput
    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
    RailsConfigDataOutput:
      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/PatronusRailConfigOutput'
          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: RailsConfigDataOutput
    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
    RailsOutput:
      type: object
      properties:
        config:
          $ref: '#/components/schemas/RailsConfigDataOutput'
          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: RailsOutput
    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
    RailsConfigOutput:
      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/RailsOutput'
          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: RailsConfigOutput
    GuardrailConfig:
      type: object
      properties:
        name:
          type: string
          default: ''
          description: Entity name within the workspace
        workspace:
          type: string
          description: Workspace identifier
        project:
          type: string
          description: The name of the project associated with this entity.
        description:
          type: string
          description: Description of the guardrail config
        data:
          $ref: '#/components/schemas/RailsConfigOutput'
          description: Guardrail configuration data
        id:
          type: string
        created_at:
          type: string
          format: date-time
        created_by:
          type:
            - string
            - 'null'
        updated_at:
          type: string
          format: date-time
        updated_by:
          type:
            - string
            - 'null'
        entity_id:
          type: string
          description: Alias for id for backwards compatibility.
        parent:
          type: string
          description: Parent entity ID for nested entities.
      required:
        - workspace
        - id
        - created_at
        - created_by
        - updated_at
        - updated_by
        - entity_id
        - parent
      description: A guardrail configuration entity.
      title: GuardrailConfig

```

## Examples



**Request**

```json
{
  "name": "string"
}
```

**Response**

```json
{
  "workspace": "string",
  "id": "string",
  "created_at": "2024-01-15T09:30:00Z",
  "created_by": "string",
  "updated_at": "2024-01-15T09:30:00Z",
  "updated_by": "string",
  "entity_id": "string",
  "parent": "string",
  "name": "",
  "project": "string",
  "description": "string",
  "data": {
    "models": [
      {
        "type": "string",
        "engine": "string",
        "model": "string",
        "parameters": {
          "base_url": "string",
          "default_headers": {}
        },
        "mode": "chat",
        "cache": {
          "enabled": false,
          "maxsize": 50000,
          "stats": {
            "enabled": false,
            "log_interval": 1.1
          }
        }
      }
    ],
    "instructions": [
      {
        "type": "string",
        "content": "string"
      }
    ],
    "actions_server_url": "string",
    "sample_conversation": "user \"Hello there!\"\n  express greeting\nbot express greeting\n  \"Hello! How can I assist you today?\"\nuser \"What can you do for me?\"\n  ask about capabilities\nbot respond about capabilities\n  \"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.\"\nuser \"Tell me a bit about the history of NVIDIA.\"\n  ask general question\nbot response for general question\n  \"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.\"\nuser \"tell me more\"\n  request more information\nbot provide more information\n  \"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.\"\nuser \"thanks\"\n  express appreciation\nbot express appreciation and offer additional help\n  \"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.\"\n",
    "prompts": [
      {
        "task": "string",
        "content": "string",
        "messages": [
          {
            "type": "string",
            "content": "string"
          }
        ],
        "models": [
          "string"
        ],
        "output_parser": "string",
        "max_length": 16000,
        "mode": "standard",
        "stop": [
          "string"
        ],
        "max_tokens": 1
      }
    ],
    "prompting_mode": "standard",
    "lowest_temperature": 0.001,
    "enable_multi_step_generation": false,
    "colang_version": "1.0",
    "custom_data": {},
    "rails": {
      "config": {
        "fact_checking": {
          "parameters": {},
          "fallback_to_self_check": false
        },
        "autoalign": {
          "parameters": {},
          "input": {
            "guardrails_config": {}
          },
          "output": {
            "guardrails_config": {}
          }
        },
        "patronus": {
          "input": {
            "evaluate_config": {
              "success_strategy": "all_pass",
              "params": {}
            }
          },
          "output": {
            "evaluate_config": {
              "success_strategy": "all_pass",
              "params": {}
            }
          }
        },
        "sensitive_data_detection": {
          "recognizers": [
            {}
          ],
          "input": {
            "entities": [
              "string"
            ],
            "mask_token": "*",
            "score_threshold": 0.2
          },
          "output": {
            "entities": [
              "string"
            ],
            "mask_token": "*",
            "score_threshold": 0.2
          },
          "retrieval": {
            "entities": [
              "string"
            ],
            "mask_token": "*",
            "score_threshold": 0.2
          }
        },
        "regex_detection": {
          "input": {
            "patterns": [
              "string"
            ],
            "case_insensitive": false
          },
          "output": {
            "patterns": [
              "string"
            ],
            "case_insensitive": false
          },
          "retrieval": {
            "patterns": [
              "string"
            ],
            "case_insensitive": false
          }
        },
        "jailbreak_detection": {
          "server_endpoint": "string",
          "length_per_perplexity_threshold": 89.79,
          "prefix_suffix_perplexity_threshold": 1845.65,
          "nim_base_url": "string",
          "nim_server_endpoint": "classify",
          "api_key_env_var": "string",
          "nim_url": "string",
          "nim_port": 1,
          "embedding": "string"
        },
        "injection_detection": {
          "injections": [
            "string"
          ],
          "action": "reject",
          "yara_rules": {}
        },
        "privateai": {
          "server_endpoint": "string",
          "input": {
            "entities": [
              "string"
            ]
          },
          "output": {
            "entities": [
              "string"
            ]
          },
          "retrieval": {
            "entities": [
              "string"
            ]
          }
        },
        "gliner": {
          "server_endpoint": "http://localhost:1235/v1/extract",
          "threshold": 0.5,
          "chunk_length": 384,
          "overlap": 128,
          "flat_ner": false,
          "input": {
            "entities": [
              "string"
            ]
          },
          "output": {
            "entities": [
              "string"
            ]
          },
          "retrieval": {
            "entities": [
              "string"
            ]
          }
        },
        "fiddler": {
          "fiddler_endpoint": "http://localhost:8080/process/text",
          "safety_threshold": 0.1,
          "faithfulness_threshold": 0.05
        },
        "clavata": {
          "server_endpoint": "https://gateway.app.clavata.ai:8443",
          "policies": {},
          "label_match_logic": "ANY",
          "input": {
            "policy": "string",
            "labels": [
              "string"
            ]
          },
          "output": {
            "policy": "string",
            "labels": [
              "string"
            ]
          }
        },
        "crowdstrike_aidr": {
          "timeout": 30
        },
        "pangea": {
          "input": {
            "recipe": "string"
          },
          "output": {
            "recipe": "string"
          }
        },
        "guardrails_ai": {
          "validators": [
            {
              "name": "string",
              "parameters": {},
              "metadata": {}
            }
          ]
        },
        "trend_micro": {
          "v1_url": "https://api.xdr.trendmicro.com/v3.0/aiSecurity/applyGuardrails",
          "api_key_env_var": "string",
          "application_name": "nemo-guardrails",
          "detailed_response": false
        },
        "ai_defense": {
          "timeout": 30,
          "fail_open": false
        },
        "content_safety": {
          "multilingual": {
            "enabled": false,
            "refusal_messages": {}
          },
          "reasoning": {
            "enabled": false
          }
        }
      },
      "input": {
        "parallel": false,
        "flows": [
          "string"
        ]
      },
      "output": {
        "parallel": false,
        "flows": [
          "string"
        ],
        "streaming": {
          "enabled": true,
          "chunk_size": 200,
          "context_size": 50,
          "stream_first": true
        },
        "apply_to_reasoning_traces": false
      },
      "retrieval": {
        "flows": [
          "string"
        ]
      },
      "dialog": {
        "single_call": {
          "enabled": false,
          "fallback_to_multiple_calls": true
        },
        "user_messages": {
          "embeddings_only": false,
          "embeddings_only_similarity_threshold": 0.5,
          "embeddings_only_fallback_intent": "string"
        }
      },
      "actions": {
        "instant_actions": [
          "string"
        ]
      },
      "tool_output": {
        "flows": [
          "string"
        ],
        "parallel": false
      },
      "tool_input": {
        "flows": [
          "string"
        ],
        "parallel": false
      }
    },
    "enable_rails_exceptions": false,
    "passthrough": true,
    "tracing": {
      "enabled": false,
      "adapters": [
        {
          "name": "FileSystem"
        }
      ],
      "span_format": "opentelemetry",
      "enable_content_capture": false
    }
  }
}
```

**SDK Code**

```python
import requests

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

payload = { "name": "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/configs';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"name":"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/configs"

	payload := strings.NewReader("{\n  \"name\": \"string\"\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/configs")

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  \"name\": \"string\"\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/configs")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"string\"\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/configs', [
  'body' => '{
  "name": "string"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

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

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = ["name": "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/configs")! 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()
```