Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

AI Input Sanitizer

No security coverage Under active development

Part of the AI ecosystem · 361 projects

AI Input Sanitizer detects and removes sensitive identifiers from questions before they reach AI services. It helps website visitors use AI search and chat without sending recognized personal identifiers to an AI provider.

The module checks text locally on your website. It can replace detected identifiers with descriptive placeholders so the question can still be answered, or stop the request and ask the visitor to reformulate. Detection does not require an external service or an AI API call.

Features

  • Detect email addresses, telephone numbers, IBAN bank account numbers and payment card numbers.
  • Optionally detect German health insurance numbers (KVNR).
  • Use international telephone-number metadata and country-specific IBAN validation to reduce false positives.
  • Choose which detectors to enable, set a default telephone region and configure an input-length limit.
  • Choose between redacting detected identifiers and blocking the request.
  • Extend detection through Drupal plugins and use the sanitizer service in custom integrations.
  • Integrate with Drupal AI Guardrails for user chat messages and text embeddings.
  • Integrate with AI Assistant UI to filter selected assistants before conversation storage, response-cache lookup, search retrieval and provider requests.
  • Display translated privacy notices directly in AI Assistant UI responses, without asking an AI model to generate them.
  • Return category counts and match positions without retaining matched values in result metadata. The module does not log original or removed values.

Post-Installation

  1. Install the module with Composer so its telephone-number library is included, then enable AI Input Sanitizer.
  2. Open Configuration → Web services → AI Input Sanitizer at /admin/config/services/ai-input-sanitizer. Select detectors, the telephone region, the action and the maximum input length.
  3. Enable the integration you need. For AI Input Sanitizer Assistant UI, select protected assistants on the Protected assistants configuration page. No assistants are selected automatically.
  4. For AI Input Sanitizer Guardrails, create an AI Input Sanitizer guardrail and add it to a pre-generation guardrail set. Attach that set to the requests you want to protect.
  5. Test representative questions and synthetic identifiers before enabling the policy for visitors.

The module adds configuration and services; it does not create content types or change text formats. Enabling the base module alone does not automatically filter all AI traffic.

Additional Requirements

  • Drupal 10.4 or Drupal 11, with the PHP version required by your Drupal release.
  • giggsey/libphonenumber-for-php 9.x, installed through Composer.
  • The optional Guardrails integration requires the Drupal AI module 1.5 or later within the 1.x series.
  • The optional AI Assistant UI integration requires its early input-preparation API. AI Assistant UI 1.0.0-rc4 does not contain that API; see the README for the companion change and release coordination.

Use Drupal AI for configurable guardrail sets: https://www.drupal.org/project/ai. Use AI Assistant UI for assistant interfaces and early filtering of search and chat requests: https://www.drupal.org/project/ai_assistant_ui.

Similar projects

  • AI Guardrails PII supplies regex-based rules that block matching input and output. AI Input Sanitizer adds a reusable local redaction service, detector plugins, validation and early Assistant UI integration: https://www.drupal.org/project/ai_recipe_guardrails_pii.
  • AI Policy Gateway addresses broader AI governance, including routing, budgets, privacy checks and approval workflows. AI Input Sanitizer focuses on detecting and redacting identifiers in input text: https://www.drupal.org/project/ai_policy_gateway.

Scope and limitations

This module detects selected identifier patterns. It does not provide complete anonymization and does not reliably detect names, postal addresses, personal health narratives or deliberately disguised identifiers. It does not retroactively remove information from existing conversation history, logs, browser history or search URLs. Protection depends on placing the integration before the processing and storage you want to protect.

Ask your assistant about AI Input Sanitizer

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Nov 2026
Latest release
3 hours ago
Releases (12 mo)
2 ▲ from 0
Maintenance
Active

Releases

Version Type Core PHP Release date
1.0.0-rc2 Pre-release 10–11 PHP >=8.1 Nov 30, 2026
1.0.0-rc1 Pre-release 10–11 PHP >=8.1 Nov 30, 2026