> **Experimental**
>
> `@aws-cdk/aws-bedrock-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# GuardrailProps

Properties for creating a Guardrail.

Extends: GuardrailProps
Used as props by: Guardrail

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`bedrock/guardrails/guardrails.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0-alpha.0/packages/@aws-cdk/aws-bedrock-alpha/bedrock/guardrails/guardrails.ts#L307)

## Example

```ts
const guardrail = new bedrock.Guardrail(this, 'bedrockGuardrails', {
  guardrailName: 'my-BedrockGuardrails',
});
// Add regex filter with input/output actions
guardrail.addRegexFilter({
  name: 'TestRegexFilter',
  pattern: 'test-pattern',
  action: bedrock.GuardrailAction.ANONYMIZE,
  // below props are optional
  description: 'This is a test regex filter',
  inputAction: bedrock.GuardrailAction.BLOCK,
  inputEnabled: true,
  outputAction: bedrock.GuardrailAction.ANONYMIZE,
  outputEnabled: true,
});
```

## Properties

- `blockedInputMessaging`: string — The message to return when the guardrail blocks a prompt.

  **Default:** "Sorry, your query violates our usage policy."

  Must be between 1 and 500 characters.

- `blockedOutputsMessaging`: string — The message to return when the guardrail blocks a model response.

  **Default:** "Sorry, I am unable to answer your question because of our usage policy."

  Must be between 1 and 500 characters.

- `contentFilters`: [ContentFilter](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-alpha.ContentFilter.html)[] = [] — The content filters to apply to the guardrail.

- `contentFiltersTierConfig`: [TierConfig](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-alpha.TierConfig.html) = filters.TierConfig.CLASSIC — The tier configuration to apply to the guardrail.

- `contextualGroundingFilters`: [ContextualGroundingFilter](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-alpha.ContextualGroundingFilter.html)[] = [] — The contextual grounding filters to apply to the guardrail.

- `crossRegionConfig`: [GuardrailCrossRegionConfigProperty](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-alpha.GuardrailCrossRegionConfigProperty.html) — The cross-region configuration for the guardrail.

  **Default:** No cross-region configuration

  This is optional and when provided, it should be of type GuardrailCrossRegionConfigProperty.

- `deniedTopics`: [Topic](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-alpha.Topic.html)[] = [] — A list of policies related to topics that the guardrail should deny.

- `description`: string — The description of the guardrail.

  **Default:** No description

- `guardrailName`: string (required) — The name of the guardrail.

  This will be used as the physical name of the guardrail.

- `kmsKey`: [IKey](/cdk/api/v2/docs/aws-cdk-lib.aws_kms.IKey.html) — A custom KMS key to use for encrypting data.

  **Default:** Data is encrypted by default with a key that AWS owns and manages for you

- `managedWordListFilters`: [ManagedWordFilter](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-alpha.ManagedWordFilter.html)[] = [] — The managed word filters to apply to the guardrail.

- `piiFilters`: [PIIFilter](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-alpha.PIIFilter.html)[] = [] — The PII filters to apply to the guardrail.

- `regexFilters`: [RegexFilter](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-alpha.RegexFilter.html)[] = [] — The regular expression (regex) filters to apply to the guardrail.

- `topicsTierConfig`: [TierConfig](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-alpha.TierConfig.html) = filters.TierConfig.CLASSIC — The tier configuration to apply to the guardrail.

- `wordFilters`: [WordFilter](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-alpha.WordFilter.html)[] = [] — The word filters to apply to the guardrail.
