{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-q/json-schema/amazon-q-create-aiguardrail-request-schema.json",
  "title": "CreateAIGuardrailRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-q-aiguardrails-api-openapi.yml#/components/schemas/CreateAIGuardrailRequest",
  "type": "object",
  "properties": {
    "clientToken": {
      "type": "string",
      "description": "A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs.."
    },
    "assistantId": {
      "type": "string",
      "description": "The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN."
    },
    "name": {
      "type": "string",
      "description": "The name of the AI Guardrail."
    },
    "blockedInputMessaging": {
      "type": "string",
      "description": "The message to return when the AI Guardrail blocks a prompt."
    },
    "blockedOutputsMessaging": {
      "type": "string",
      "description": "The message to return when the AI Guardrail blocks a model response."
    },
    "visibilityStatus": {
      "type": "string",
      "description": "The visibility status of the AI Guardrail."
    },
    "description": {
      "type": "string",
      "description": "A description of the AI Guardrail."
    },
    "topicPolicyConfig": {
      "$ref": "#/$defs/AIGuardrailTopicPolicyConfig"
    },
    "contentPolicyConfig": {
      "$ref": "#/$defs/AIGuardrailContentPolicyConfig"
    },
    "wordPolicyConfig": {
      "$ref": "#/$defs/AIGuardrailWordPolicyConfig"
    },
    "sensitiveInformationPolicyConfig": {
      "$ref": "#/$defs/AIGuardrailSensitiveInformationPolicyConfig"
    },
    "contextualGroundingPolicyConfig": {
      "$ref": "#/$defs/AIGuardrailContextualGroundingPolicyConfig"
    },
    "tags": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "The tags used to organize, track, or control access for this resource."
    }
  },
  "required": [
    "assistantId",
    "name",
    "blockedInputMessaging",
    "blockedOutputsMessaging",
    "visibilityStatus"
  ],
  "$defs": {
    "AIGuardrailContentPolicyConfig": {
      "type": "object",
      "properties": {
        "filtersConfig": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GuardrailContentFilterConfig"
          },
          "description": "Contains the type of the content filter and how strongly it should apply to prompts and model responses."
        }
      },
      "required": [
        "filtersConfig"
      ]
    },
    "AIGuardrailContextualGroundingPolicyConfig": {
      "type": "object",
      "properties": {
        "filtersConfig": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GuardrailContextualGroundingFilterConfig"
          },
          "description": "The filter configuration details for the AI Guardrails contextual grounding policy."
        }
      },
      "required": [
        "filtersConfig"
      ]
    },
    "AIGuardrailSensitiveInformationPolicyConfig": {
      "type": "object",
      "properties": {
        "piiEntitiesConfig": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GuardrailPiiEntityConfig"
          },
          "description": "A list of PII entities to configure to the AI Guardrail."
        },
        "regexesConfig": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GuardrailRegexConfig"
          },
          "description": "A list of regular expressions to configure to the AI Guardrail."
        }
      }
    },
    "AIGuardrailTopicPolicyConfig": {
      "type": "object",
      "properties": {
        "topicsConfig": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GuardrailTopicConfig"
          },
          "description": "A list of policies related to topics that the AI Guardrail should deny."
        }
      },
      "required": [
        "topicsConfig"
      ]
    },
    "AIGuardrailWordPolicyConfig": {
      "type": "object",
      "properties": {
        "wordsConfig": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GuardrailWordConfig"
          },
          "description": "A list of words to configure for the AI Guardrail."
        },
        "managedWordListsConfig": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GuardrailManagedWordsConfig"
          },
          "description": "A list of managed words to configure for the AI Guardrail."
        }
      }
    },
    "GuardrailContentFilterConfig": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "The harmful category that the content filter is applied to."
        },
        "inputStrength": {
          "type": "string",
          "description": "The strength of the content filter to apply to prompts. As you increase the filter strength, the likelihood of filtering harmful content increases and the probability of seeing harmful content in your application reduces."
        },
        "outputStrength": {
          "type": "string",
          "description": "The strength of the content filter to apply to model responses. As you increase the filter strength, the likelihood of filtering harmful content increases and the probability of seeing harmful content in your application reduces."
        }
      },
      "required": [
        "type",
        "inputStrength",
        "outputStrength"
      ]
    },
    "GuardrailContextualGroundingFilterConfig": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "The filter type for the AI Guardrail's contextual grounding filter."
        },
        "threshold": {
          "type": "number",
          "description": "The threshold details for the AI Guardrail's contextual grounding filter."
        }
      },
      "required": [
        "type",
        "threshold"
      ]
    },
    "GuardrailManagedWordsConfig": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "The managed word type to configure for the AI Guardrail."
        }
      },
      "required": [
        "type"
      ]
    },
    "GuardrailPiiEntityConfig": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "Configure AI Guardrail type when the PII entity is detected. The following PIIs are used to block or mask sensitive information: General ADDRESS A physical address, such as \"100 Main Street, Anytown, USA\" or \"Suite #12, Building 123\". An address can include information such as the street, building, location, city, state, country, county, zip code, precinct, and neighborhood. AGE An individual's age, including the quantity and unit of time. For example, in the phrase \"I am 40 years old,\" Guarrails recognizes \"40 years\" as an age. NAME An individual's name. This entity type does not include titl"
        },
        "action": {
          "type": "string",
          "description": "Configure AI Guardrail's action when the PII entity is detected."
        }
      },
      "required": [
        "type",
        "action"
      ]
    },
    "GuardrailRegexConfig": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the regular expression to configure for the AI Guardrail."
        },
        "description": {
          "type": "string",
          "description": "The description of the regular expression to configure for the AI Guardrail."
        },
        "pattern": {
          "type": "string",
          "description": "The regular expression pattern to configure for the AI Guardrail."
        },
        "action": {
          "type": "string",
          "description": "The AI Guardrail action to configure when matching regular expression is detected."
        }
      },
      "required": [
        "name",
        "pattern",
        "action"
      ]
    },
    "GuardrailTopicConfig": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the topic to deny."
        },
        "definition": {
          "type": "string",
          "description": "A definition of the topic to deny."
        },
        "type": {
          "type": "string",
          "description": "Specifies to deny the topic."
        }
      },
      "required": [
        "name",
        "definition",
        "type"
      ]
    },
    "GuardrailWordConfig": {
      "type": "object",
      "properties": {
        "text": {
          "type": "string",
          "description": "Text of the word configured for the AI Guardrail to block."
        }
      },
      "required": [
        "text"
      ]
    }
  }
}