Part of the AI ecosystem · 343 projects
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.
AI Validations adds AI-powered rules to the Field Validation module. Attach a rule to a text, image or audio field, pick an AI provider from the AI module, and the rule checks the value when the form is saved.
Rules
- Text prompt: your own prompt decides if the text passes.
- Moderation: fails text the provider's moderation flags, for all categories or only the ones you choose.
- Text classification: fails text classified into a category you don't allow.
- Image prompt: your own prompt checks an uploaded image. It can also warn instead of block (see below).
- Image classification: fails images classified into a category you don't allow.
- Object detection: requires or forbids named objects in an image.
- Audio: transcribes the file, then your prompt checks the transcript.
The image rules can use an image style to send a smaller image and save tokens.
New in 1.4
- Warn instead of block. Give an image prompt rule a Warning message and have the prompt answer
XSAFE,XWARNorXBLOCK. Borderline images are saved and the uploader sees a warning. Clear violations are still blocked. - AI Context support. With AI Context installed, the text, image and audio prompt rules can receive site context such as style guides and policies. You don't have to copy that guidance into every prompt.
Use cases
- Block hate speech, violence or spam.
- Enforce your content policy or brand rules with a prompt.
- Block unsafe images, or let borderline ones through with a warning.
- Require or forbid specific objects in images.
- Check what is said in an audio upload.
Requirements
- AI 1.3 or later, with at least one provider set up
- Field Validation 3.x
- Optional: AI Context 1.0.0-beta5 or later. Matching context by entity type, entity or taxonomy needs AI 1.5 or later.
Supported versions
- 1.4.x: current. All new work goes here.
- 1.3.x: security fixes only, until January 2027.
- 1.0.x: not supported.
Upgrading to 1.4
Prompts are now sent as the system prompt, and the model's reply must start with the verdict token, for example XTRUE. Check that your prompts ask for this. See the 1.4.0 release notes.
Ask your assistant about AI Validations
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
- AI (Artificial Intelligence)
- Field Validation
- image Drupal core
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
More in the AI ecosystem
Most installed first