# Types of guardrails

Providers like OpenAI or Anthropic have built-in guardrails for risks like harmful or
malicious content and are generally desirable for the vast majority of users.
The Opik Guardrails aim to cover the residual risks which are often very user specific, and need to be configured with more detail.

## PII guardrail

The PII guardrail checks for sensitive information, such as name, age, address, email, phone number, or credit card details.
The specific entities can be configured in the SDK call, see more in the reference documentation.

*The method used here leverages traditional NLP models for tokenization and named entity recognition.*

## Topic guardrail

The topic guardrail ensures that the inputs and outputs remain on topic.
You can configure the allowed or disallowed topics in the SDK call, see more in the reference documentation.

*This guardrails relies on a small language model, specifically a zero-shot classifier.*

## Custom guardrail

Custom guardrail allows you to define your own guardrails using a custom model, custom library or custom business logic and log the response to Opik. Below is a basic example that filters out competitor brands:

```python
import opik
import opik.opik_context
import traceback