AI Validations enhances the Field Validation module by integrating AI-powered checks for various field types. It allows you to leverage AI for tasks like content moderation, text classification, image analysis, and even audio validation based on custom prompts or predefined rules. This enables automatic filtering and validation of user-submitted content through your configured AI providers.
Overview
AI Validations adds AI-powered validation rules to the Field Validation module. Attach any of the seven built-in rules to a text, image, or audio field, point it at an AI provider configured in AI Core, and it will pass or fail the field value automatically.
Features
- AI text prompt validation. Send a custom prompt with a text field value. The prompt must instruct the model to return
XTRUEwhen the value passes orXFALSEwhen it fails. - AI moderation validation. Validate text fields using the AI module's native moderation operation. Content flagged by the provider fails validation. You can restrict failure to specific categories (e.g.
hate,violence,sexual); if left blank, any flagged category causes failure. - AI text classification validation. Send a text field value to your AI provider for classification. Validation fails when the text is classified as the category you configure. You can set the tag, finder type (exact, contains, or case-insensitive), and a minimum confidence threshold.
- AI image classification validation. Send uploaded images to your AI provider for classification. Validation fails when the image is classified into a disallowed category. You can set the tag, finder type, and minimum confidence. An image style can be applied first to reduce token usage.
- AI image prompt validation. Send an uploaded image with a custom prompt. The prompt must instruct the model to return
XTRUEorXFALSE(e.g. "contains no explicit content", "shows a person wearing safety equipment"). Accepts an optional image style to reduce token usage. - AI object detection validation. Validate images using the AI module's object detection operation. Require or forbid specific object names, use AND or OR logic for multiple keywords, and configure whether the rule passes or fails on a match. Accepts an optional image style to reduce token usage.
- AI audio validation. Validate audio file fields. A speech-to-text provider transcribes the uploaded file, then a chat provider evaluates the transcript against your custom prompt. The prompt must instruct the model to return
XTRUEif the value passes orXFALSEif it fails.
Requirements
- AI Core module and at least one configured AI provider
- Field Validation module
Use cases
- Block user-submitted text that fails an AI moderation check (e.g. hate speech, violent content)
- Reject submissions your AI provider classifies as spam or off-topic
- Enforce content policies on text fields with a custom XTRUE/XFALSE prompt
- Reject uploaded images that match a disallowed classification (e.g. NSFW or off-brand imagery)
- Require uploaded photos to contain specific elements (e.g. a logo, safety equipment, a product shot)
- Require or block named objects in images (e.g. "must contain person", "must not contain weapon")
- Validate audio uploads by transcribing them and evaluating the transcript against a custom prompt
How it works
Each rule is a Field Validation plugin. You attach it to a field, choose your AI provider and model through AI Core, and configure the match criteria. On form save the rule calls the provider, interprets the response, and returns pass or fail to Field Validation. All six rules sit alongside your existing validation rules in the same admin UI.