{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-bedrock/json-schema/amazon-bedrock-create-guardrail-request-schema.json",
  "title": "CreateGuardrailRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-bedrock-guardrails-api-openapi.yml#/components/schemas/CreateGuardrailRequest",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "The name to give the guardrail."
    },
    "description": {
      "type": "string",
      "description": "A description of the guardrail."
    },
    "topicPolicyConfig": {
      "$ref": "#/$defs/GuardrailTopicPolicyConfig"
    },
    "contentPolicyConfig": {
      "$ref": "#/$defs/GuardrailContentPolicyConfig"
    },
    "wordPolicyConfig": {
      "$ref": "#/$defs/GuardrailWordPolicyConfig"
    },
    "sensitiveInformationPolicyConfig": {
      "$ref": "#/$defs/GuardrailSensitiveInformationPolicyConfig"
    },
    "contextualGroundingPolicyConfig": {
      "$ref": "#/$defs/GuardrailContextualGroundingPolicyConfig"
    },
    "automatedReasoningPolicyConfig": {
      "$ref": "#/$defs/GuardrailAutomatedReasoningPolicyConfig"
    },
    "crossRegionConfig": {
      "$ref": "#/$defs/GuardrailCrossRegionConfig"
    },
    "blockedInputMessaging": {
      "type": "string",
      "description": "The message to return when the guardrail blocks a prompt."
    },
    "blockedOutputsMessaging": {
      "type": "string",
      "description": "The message to return when the guardrail blocks a model response."
    },
    "kmsKeyId": {
      "type": "string",
      "description": "The ARN of the KMS key that you use to encrypt the guardrail."
    },
    "tags": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Tag"
      },
      "description": "The tags that you want to attach to the guardrail."
    },
    "clientRequestToken": {
      "type": "string",
      "description": "A unique, case-sensitive identifier to ensure that the API request completes no more than once. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see Ensuring idempotency in the Amazon S3 User Guide."
    }
  },
  "required": [
    "name",
    "blockedInputMessaging",
    "blockedOutputsMessaging"
  ],
  "$defs": {
    "GuardrailAutomatedReasoningPolicyConfig": {
      "type": "object",
      "properties": {
        "policies": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The list of Automated Reasoning policy ARNs to include in the guardrail configuration."
        },
        "confidenceThreshold": {
          "type": "number",
          "description": "The confidence threshold for triggering guardrail actions based on Automated Reasoning policy violations."
        }
      },
      "required": [
        "policies"
      ]
    },
    "GuardrailContentFilterConfig": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "SEXUAL",
            "VIOLENCE",
            "HATE",
            "INSULTS",
            "MISCONDUCT",
            "PROMPT_ATTACK"
          ],
          "description": "The harmful category that the content filter is applied to."
        },
        "inputStrength": {
          "type": "string",
          "enum": [
            "NONE",
            "LOW",
            "MEDIUM",
            "HIGH"
          ],
          "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",
          "enum": [
            "NONE",
            "LOW",
            "MEDIUM",
            "HIGH"
          ],
          "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."
        },
        "inputModalities": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "TEXT",
              "IMAGE"
            ]
          },
          "description": "The input modalities selected for the guardrail content filter configuration."
        },
        "outputModalities": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "TEXT",
              "IMAGE"
            ]
          },
          "description": "The output modalities selected for the guardrail content filter configuration."
        },
        "inputAction": {
          "type": "string",
          "enum": [
            "BLOCK",
            "NONE"
          ],
          "description": "Specifies the action to take when harmful content is detected. Supported values include: BLOCK – Block the content and replace it with blocked messaging. NONE – Take no action but return detection information in the trace response."
        },
        "outputAction": {
          "type": "string",
          "enum": [
            "BLOCK",
            "NONE"
          ],
          "description": "Specifies the action to take when harmful content is detected in the output. Supported values include: BLOCK – Block the content and replace it with blocked messaging. NONE – Take no action but return detection information in the trace response."
        },
        "inputEnabled": {
          "type": "boolean",
          "description": "Specifies whether to enable guardrail evaluation on the input. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response."
        },
        "outputEnabled": {
          "type": "boolean",
          "description": "Specifies whether to enable guardrail evaluation on the output. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response."
        }
      },
      "required": [
        "type",
        "inputStrength",
        "outputStrength"
      ]
    },
    "GuardrailContentFiltersTierConfig": {
      "type": "object",
      "properties": {
        "tierName": {
          "type": "string",
          "enum": [
            "CLASSIC",
            "STANDARD"
          ],
          "description": "The tier that your guardrail uses for content filters. Valid values include: CLASSIC tier – Provides established guardrails functionality supporting English, French, and Spanish languages. STANDARD tier – Provides a more robust solution than the CLASSIC tier and has more comprehensive language support. This tier requires that your guardrail use cross-Region inference."
        }
      },
      "required": [
        "tierName"
      ]
    },
    "GuardrailContentPolicyConfig": {
      "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."
        },
        "tierConfig": {
          "$ref": "#/$defs/GuardrailContentFiltersTierConfig"
        }
      },
      "required": [
        "filtersConfig"
      ]
    },
    "GuardrailContextualGroundingFilterConfig": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "GROUNDING",
            "RELEVANCE"
          ],
          "description": "The filter details for the guardrails contextual grounding filter."
        },
        "threshold": {
          "type": "number",
          "description": "The threshold details for the guardrails contextual grounding filter."
        },
        "action": {
          "type": "string",
          "enum": [
            "BLOCK",
            "NONE"
          ],
          "description": "Specifies the action to take when content fails the contextual grounding evaluation. Supported values include: BLOCK – Block the content and replace it with blocked messaging. NONE – Take no action but return detection information in the trace response."
        },
        "enabled": {
          "type": "boolean",
          "description": "Specifies whether to enable contextual grounding evaluation. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response."
        }
      },
      "required": [
        "type",
        "threshold"
      ]
    },
    "GuardrailContextualGroundingPolicyConfig": {
      "type": "object",
      "properties": {
        "filtersConfig": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GuardrailContextualGroundingFilterConfig"
          },
          "description": "The filter configuration details for the guardrails contextual grounding policy."
        },
        "tierConfig": {
          "$ref": "#/$defs/GuardrailContextualGroundingTierConfig"
        }
      },
      "required": [
        "filtersConfig"
      ]
    },
    "GuardrailContextualGroundingTierConfig": {
      "type": "object",
      "properties": {
        "tierName": {
          "type": "string",
          "enum": [
            "CLASSIC",
            "STANDARD"
          ],
          "description": "The tier that your guardrail uses for contextual grounding. Valid values include: CLASSIC tier – Provides established contextual grounding functionality supporting English, French, and Spanish languages. STANDARD tier – Provides a more robust solution than the CLASSIC tier, with support for reasoning, conversational content and more comprehensive language support. This tier requires that your guardrail use cross-Region inference."
        }
      },
      "required": [
        "tierName"
      ]
    },
    "GuardrailCrossRegionConfig": {
      "type": "object",
      "properties": {
        "guardrailProfileIdentifier": {
          "type": "string",
          "description": "The ID or Amazon Resource Name (ARN) of the guardrail profile that your guardrail is using. Guardrail profile availability depends on your current Amazon Web Services Region. For more information, see the Amazon Bedrock User Guide."
        }
      },
      "required": [
        "guardrailProfileIdentifier"
      ]
    },
    "GuardrailManagedWordsConfig": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "PROFANITY"
          ],
          "description": "The managed word type to configure for the guardrail."
        },
        "inputAction": {
          "type": "string",
          "enum": [
            "BLOCK",
            "NONE"
          ],
          "description": "Specifies the action to take when harmful content is detected in the input. Supported values include: BLOCK – Block the content and replace it with blocked messaging. NONE – Take no action but return detection information in the trace response."
        },
        "outputAction": {
          "type": "string",
          "enum": [
            "BLOCK",
            "NONE"
          ],
          "description": "Specifies the action to take when harmful content is detected in the output. Supported values include: BLOCK – Block the content and replace it with blocked messaging. NONE – Take no action but return detection information in the trace response."
        },
        "inputEnabled": {
          "type": "boolean",
          "description": "Specifies whether to enable guardrail evaluation on the input. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response."
        },
        "outputEnabled": {
          "type": "boolean",
          "description": "Specifies whether to enable guardrail evaluation on the output. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response."
        }
      },
      "required": [
        "type"
      ]
    },
    "GuardrailPiiEntityConfig": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "ADDRESS",
            "AGE",
            "AWS_ACCESS_KEY",
            "AWS_SECRET_KEY",
            "CA_HEALTH_NUMBER",
            "CA_SOCIAL_INSURANCE_NUMBER",
            "CREDIT_DEBIT_CARD_CVV",
            "CREDIT_DEBIT_CARD_EXPIRY",
            "CREDIT_DEBIT_CARD_NUMBER",
            "DRIVER_ID",
            "EMAIL",
            "INTERNATIONAL_BANK_ACCOUNT_NUMBER",
            "IP_ADDRESS",
            "LICENSE_PLATE",
            "MAC_ADDRESS",
            "NAME",
            "PASSWORD",
            "PHONE",
            "PIN",
            "SWIFT_CODE",
            "UK_NATIONAL_HEALTH_SERVICE_NUMBER",
            "UK_NATIONAL_INSURANCE_NUMBER",
            "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER",
            "URL",
            "USERNAME",
            "US_BANK_ACCOUNT_NUMBER",
            "US_BANK_ROUTING_NUMBER",
            "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER",
            "US_PASSPORT_NUMBER",
            "US_SOCIAL_SECURITY_NUMBER",
            "VEHICLE_IDENTIFICATION_NUMBER"
          ],
          "description": "Configure 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,\" Guardrails recognizes \"40 years\" as an age. NAME An individual's name. This entity type does not include titles"
        },
        "action": {
          "type": "string",
          "enum": [
            "BLOCK",
            "ANONYMIZE",
            "NONE"
          ],
          "description": "Configure guardrail action when the PII entity is detected."
        },
        "inputAction": {
          "type": "string",
          "enum": [
            "BLOCK",
            "ANONYMIZE",
            "NONE"
          ],
          "description": "Specifies the action to take when harmful content is detected in the input. Supported values include: BLOCK – Block the content and replace it with blocked messaging. ANONYMIZE – Mask the content and replace it with identifier tags. NONE – Take no action but return detection information in the trace response."
        },
        "outputAction": {
          "type": "string",
          "enum": [
            "BLOCK",
            "ANONYMIZE",
            "NONE"
          ],
          "description": "Specifies the action to take when harmful content is detected in the output. Supported values include: BLOCK – Block the content and replace it with blocked messaging. ANONYMIZE – Mask the content and replace it with identifier tags. NONE – Take no action but return detection information in the trace response."
        },
        "inputEnabled": {
          "type": "boolean",
          "description": "Specifies whether to enable guardrail evaluation on the input. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response."
        },
        "outputEnabled": {
          "type": "boolean",
          "description": "Specifies whether to enable guardrail evaluation on the output. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response."
        }
      },
      "required": [
        "type",
        "action"
      ]
    },
    "GuardrailRegexConfig": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the regular expression to configure for the guardrail."
        },
        "description": {
          "type": "string",
          "description": "The description of the regular expression to configure for the guardrail."
        },
        "pattern": {
          "type": "string",
          "description": "The regular expression pattern to configure for the guardrail."
        },
        "action": {
          "type": "string",
          "enum": [
            "BLOCK",
            "ANONYMIZE",
            "NONE"
          ],
          "description": "The guardrail action to configure when matching regular expression is detected."
        },
        "inputAction": {
          "type": "string",
          "enum": [
            "BLOCK",
            "ANONYMIZE",
            "NONE"
          ],
          "description": "Specifies the action to take when harmful content is detected in the input. Supported values include: BLOCK – Block the content and replace it with blocked messaging. NONE – Take no action but return detection information in the trace response."
        },
        "outputAction": {
          "type": "string",
          "enum": [
            "BLOCK",
            "ANONYMIZE",
            "NONE"
          ],
          "description": "Specifies the action to take when harmful content is detected in the output. Supported values include: BLOCK – Block the content and replace it with blocked messaging. NONE – Take no action but return detection information in the trace response."
        },
        "inputEnabled": {
          "type": "boolean",
          "description": "Specifies whether to enable guardrail evaluation on the input. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response."
        },
        "outputEnabled": {
          "type": "boolean",
          "description": "Specifies whether to enable guardrail evaluation on the output. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response."
        }
      },
      "required": [
        "name",
        "pattern",
        "action"
      ]
    },
    "GuardrailSensitiveInformationPolicyConfig": {
      "type": "object",
      "properties": {
        "piiEntitiesConfig": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GuardrailPiiEntityConfig"
          },
          "description": "A list of PII entities to configure to the guardrail."
        },
        "regexesConfig": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GuardrailRegexConfig"
          },
          "description": "A list of regular expressions to configure to the guardrail."
        }
      }
    },
    "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",
          "enum": [
            "DENY"
          ],
          "description": "Specifies to deny the topic."
        },
        "inputAction": {
          "type": "string",
          "enum": [
            "BLOCK",
            "NONE"
          ],
          "description": "Specifies the action to take when harmful content is detected in the input. Supported values include: BLOCK – Block the content and replace it with blocked messaging. NONE – Take no action but return detection information in the trace response."
        },
        "outputAction": {
          "type": "string",
          "enum": [
            "BLOCK",
            "NONE"
          ],
          "description": "Specifies the action to take when harmful content is detected in the output. Supported values include: BLOCK – Block the content and replace it with blocked messaging. NONE – Take no action but return detection information in the trace response."
        },
        "inputEnabled": {
          "type": "boolean",
          "description": "Specifies whether to enable guardrail evaluation on the input. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response."
        },
        "outputEnabled": {
          "type": "boolean",
          "description": "Specifies whether to enable guardrail evaluation on the output. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response."
        }
      },
      "required": [
        "name",
        "definition",
        "type"
      ]
    },
    "GuardrailTopicPolicyConfig": {
      "type": "object",
      "properties": {
        "topicsConfig": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GuardrailTopicConfig"
          },
          "description": "A list of policies related to topics that the guardrail should deny."
        },
        "tierConfig": {
          "$ref": "#/$defs/GuardrailTopicsTierConfig"
        }
      },
      "required": [
        "topicsConfig"
      ]
    },
    "GuardrailTopicsTierConfig": {
      "type": "object",
      "properties": {
        "tierName": {
          "type": "string",
          "enum": [
            "CLASSIC",
            "STANDARD"
          ],
          "description": "The tier that your guardrail uses for denied topic filters. Valid values include: CLASSIC tier – Provides established guardrails functionality supporting English, French, and Spanish languages. STANDARD tier – Provides a more robust solution than the CLASSIC tier and has more comprehensive language support. This tier requires that your guardrail use cross-Region inference."
        }
      },
      "required": [
        "tierName"
      ]
    },
    "GuardrailWordConfig": {
      "type": "object",
      "properties": {
        "text": {
          "type": "string",
          "description": "Text of the word configured for the guardrail to block."
        },
        "inputAction": {
          "type": "string",
          "enum": [
            "BLOCK",
            "NONE"
          ],
          "description": "Specifies the action to take when harmful content is detected in the input. Supported values include: BLOCK – Block the content and replace it with blocked messaging. NONE – Take no action but return detection information in the trace response."
        },
        "outputAction": {
          "type": "string",
          "enum": [
            "BLOCK",
            "NONE"
          ],
          "description": "Specifies the action to take when harmful content is detected in the output. Supported values include: BLOCK – Block the content and replace it with blocked messaging. NONE – Take no action but return detection information in the trace response."
        },
        "inputEnabled": {
          "type": "boolean",
          "description": "Specifies whether to enable guardrail evaluation on the intput. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response."
        },
        "outputEnabled": {
          "type": "boolean",
          "description": "Specifies whether to enable guardrail evaluation on the output. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response."
        }
      },
      "required": [
        "text"
      ]
    },
    "GuardrailWordPolicyConfig": {
      "type": "object",
      "properties": {
        "wordsConfig": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GuardrailWordConfig"
          },
          "description": "A list of words to configure for the guardrail."
        },
        "managedWordListsConfig": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GuardrailManagedWordsConfig"
          },
          "description": "A list of managed words to configure for the guardrail."
        }
      }
    },
    "Tag": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "description": "Key for the tag."
        },
        "value": {
          "type": "string",
          "description": "Value for the tag."
        }
      },
      "required": [
        "key",
        "value"
      ]
    }
  }
}