Drupal is a registered trademark of Dries Buytaert
Release: Leaflet 10.4.11 Minor update available for module leaflet (10.4.11). Release: Reporting API 2.2.0 Minor update available for module reporting (2.2.0). Release: Session Inspector 1.0.8 Minor update available for module session_inspector (1.0.8). Release: Migrate QA 2.0.4 Minor update available for module migrate_qa (2.0.4). Release: CKEditor Description List 3.0.0 Major update available for module ckeditor_descriptionlist (3.0.0). Release: FlowDrop 2.4.0 Minor update available for module flowdrop (2.4.0). Release: Project Browser Localizer 3.0.10 Minor update available for module pb_localizer (3.0.10). Release: JWT Token Refresh 1.0.4 Minor update available for module jwt_token_refresh (1.0.4). Module Revived: Decoupled Router 2.0.7 Module decoupled_router updated after 11 months of inactivity (2.0.7). Security Coverage: NetStorage Media Module netstorage_media now has official Drupal security advisory coverage.

This Drupal recipe installs AI guardrails that use regular expressions to detect and block personally identifiable information (PII) in AI interactions. It can be applied to any site where AI features process user input or generate output that might contain sensitive personal data, helping to protect user privacy and comply with data protection regulations.

A Drupal recipe that installs a set of regex-based AI guardrails to detect and block personally identifiable information (PII) in AI interactions. Apply this recipe to any site where AI features process user input or generate output that may contain sensitive personal data.

What This Recipe Does

This recipe installs four individual guardrails and one guardrail set into a Drupal site running the AI module.

Each guardrail uses a regular expression to scan text for a specific type of PII. The pii_protection guardrail set applies all four guardrails to both the pre-generate (user input) and post-generate (AI output) phases, so PII is blocked in both directions.

When to use this recipe

  • Any public-facing AI interaction (chatbots, AI assistants, AI-powered search)
  • Sites with GDPR or data protection obligations
  • Environments where user content must not be forwarded to third-party AI providers containing sensitive identifiers

Requirements

How to Apply

Run the following Drush command from your Drupal root:

drush recipe ../recipes/ai_recipe_guardrails_pii

Configuration Installed

Guardrail Set

Machine name Label Description pii_protection PII Protection Applies all four PII guardrails to both pre- and post-generate phases. Stop threshold: 0.8.

Guardrails

Machine name Label Detects pii_email_address PII: Email Address Email addresses pii_credit_card_number PII: Credit Card Number Payment card numbers (Visa, Mastercard, Amex, Discover, etc.) pii_iban PII: IBAN IBAN bank account numbers pii_phone_number PII: Phone Number International phone numbers (E.164 / +XX format)

All guardrails use the regexp_guardrail plugin.

Activity

Tracked releases
1
Tracked since
Mar 2026
Latest release
5 months ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Releases

Version Type Release date
1.0.0 Stable Mar 23, 2026