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

Interface for creating a custom Topic.

Extends: CustomTopicProps
Used as props by: Topic

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

## Example

```ts
const guardrail = new bedrock.Guardrail(this, 'bedrockGuardrails', {
  guardrailName: 'my-BedrockGuardrails',
  // Configure tier for topic filters (optional)
  topicsTierConfig: bedrock.TierConfig.STANDARD,
});

// Use a predefined topic
guardrail.addDeniedTopicFilter(bedrock.Topic.FINANCIAL_ADVICE);

// Create a custom topic with input/output actions
guardrail.addDeniedTopicFilter(
  bedrock.Topic.custom({
    name: 'Legal_Advice',
    definition: 'Offering guidance or suggestions on legal matters, legal actions, interpretation of laws, or legal rights and responsibilities.',
    examples: [
      'Can I sue someone for this?',
      'What are my legal rights in this situation?',
      'Is this action against the law?',
      'What should I do to file a legal complaint?',
      'Can you explain this law to me?',
    ],
    // props below are optional
    inputAction: bedrock.GuardrailAction.BLOCK,
    inputEnabled: true,
    outputAction: bedrock.GuardrailAction.NONE,
    outputEnabled: true,
  })
);
```

## Properties

- `definition`: string (required) — Provide a clear definition to detect and block user inputs and FM responses that fall into this topic.

  Avoid starting with "don't".

  ```ts
  `Investment advice refers to inquiries, guidance, or recommendations
  regarding the management or allocation of funds or assets with the goal of
  generating returns or achieving specific financial objectives.`
  ```

- `examples`: string[] (required) — Representative phrases that refer to the topic.

  These phrases can represent
  a user input or a model response. Add between 1 and 100 phrases, up to 100 characters
  each.

  ```ts
  "Where should I invest my money?"
  ```

- `inputAction`: [GuardrailAction](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-alpha.GuardrailAction.html) = GuardrailAction.BLOCK — The action to take when a topic is detected in the input.

- `inputEnabled`: boolean = true — Whether the topic filter is enabled for input.

- `name`: string (required) — The name of the topic to deny.

- `outputAction`: [GuardrailAction](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-alpha.GuardrailAction.html) = GuardrailAction.BLOCK — The action to take when a topic is detected in the output.

- `outputEnabled`: boolean = true — Whether the topic filter is enabled for output.
