ai_validations
1 sites
No security coverage
Overview
AI Validations adds AI-powered validation rules to the Field Validation module. You can send text and images to any configured AI provider (via the AI Core module) and automatically pass or fail field values based on the AI response.
Features
- AI text prompt validation — Use a custom prompt with a text field value. The prompt must instruct the model to evaluate the content and return
XTRUEwhen the value passes orXFALSEwhen it fails. - AI image classification validation — Send uploaded images to your AI provider for classification. Validation fails when the image is classified into a category you have marked as disallowed. You can set the classification tag, finder type, and minimum confidence.
- AI image prompt validation — Send an uploaded image plus a custom prompt. The prompt must instruct the model to return
XTRUEorXFALSE(e.g. "contains no explicit content", "shows a person wearing safety equipment"). - AI object detection validation — Validate images using the AI module's object detection operation. Require or forbid specific object names in an image, use AND or OR logic for multiple keywords, and configure when validation passes or fails.
Yet to be merged: https://www.drupal.org/project/ai_validations/issues/3575363
Requirements
- AI Core module and at least one configured AI provider
- Field Validation module
Use cases
- Enforce content policies on user-generated text (e.g. block profanity or unsafe content)
- Reject images that match disallowed categories (e.g. NSFW or off-brand imagery)
- Ensure uploaded media contains required elements (e.g. logo, safety equipment, product shot)
- Require or block specific objects in images (e.g. "must contain person", "must not contain weapon")
How it works
The module exposes Field Validation plugins that you attach to supported fields. Each rule calls your chosen AI provider through AI Core, interprets the model response, and returns pass/fail to Field Validation, so you manage AI-driven checks alongside your existing validation rules in the same UI.