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

Represents predefined topics that can be used to filter content.

- 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#L218)

## 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 — Definition of the topic.

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

- `FINANCIAL_ADVICE`: [Topic](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-alpha.Topic.html) (static) — Filter for financial advice and investment recommendations.

- `INAPPROPRIATE_CONTENT`: [Topic](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-alpha.Topic.html) (static) — Filter for inappropriate or explicit content.

- `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.

- `LEGAL_ADVICE`: [Topic](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-alpha.Topic.html) (static) — Filter for legal advice and recommendations.

- `MEDICAL_ADVICE`: [Topic](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-alpha.Topic.html) (static) — Filter for medical advice and health recommendations.

- `name`: string — 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.

- `POLITICAL_ADVICE`: [Topic](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-alpha.Topic.html) (static) — Filter for political advice and recommendations.

## Methods

- `custom(props: CustomTopicProps): Topic // chainable` (static) — Create a custom topic filter.

  **Parameters**

  - `props` — Properties for the custom topic filter.
