> For the complete documentation index, see [llms.txt](https://docs.varbase.vardot.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.varbase.vardot.com/developers/understanding-varbase/varbase-ai-recipes/ai-recipe-guardrails-pii.md).

# AI Recipe Guardrails PII

The **AI Recipe Guardrails PII** recipe installs PII (Personally Identifiable Information) protection guardrails for the Drupal AI module. It detects and blocks email addresses, credit card numbers, IBANs, and international phone numbers in both user input to AI agents and AI-generated output.

## Recipe Type

AI

## Drupal.org Project

<https://www.drupal.org/project/ai>

## Overview

When an AI agent processes content on behalf of an editor, sensitive identifiers can leak in two directions: into the prompt sent to the AI provider, or back into the rendered AI output displayed to other users. This recipe enables AI module guardrails that scan both sides of the exchange and block messages containing matched PII patterns.

The bundled patterns cover:

* **Email addresses**
* **Credit card numbers**
* **IBAN (International Bank Account Number) codes**
* **International phone numbers**

## Included Modules

| Module                                           | Purpose                                                                                        |
| ------------------------------------------------ | ---------------------------------------------------------------------------------------------- |
| [**AI Core**](https://www.drupal.org/project/ai) | Provides an abstraction layer for AI services and the guardrail framework used by this recipe. |

## Configuration

The recipe imports the full set of AI module guardrail configurations:

```yaml
config:
  strict: false
  import:
    ai: '*'
```

After install, manage individual PII guardrail rules at **Admin → AI → Configuration → Guardrails**.

## Installation

Apply the recipe using Drush:

```bash
ddev drush recipe ../recipes/ai_recipe_guardrails_pii
```

This recipe is bundled into [**Varbase AI Safety**](/developers/understanding-varbase/varbase-ai-recipes/varbase-ai-safety.md) and is applied automatically when that recipe is used.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.varbase.vardot.com/developers/understanding-varbase/varbase-ai-recipes/ai-recipe-guardrails-pii.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
