Downloads
Release notes
AI Image Safety Validation — 1.0.0
First stable release of the AI Image Safety Validation recipe.
This recipe adds AI-powered content moderation to image uploads. Every image uploaded to the Media: Image bundle is analyzed by a vision-capable AI provider and
blocked at upload time if it falls outside the "Safe" tier of Flickr-style safety levels — nudity, sexually suggestive material, gore, graphic violence, and graphic
medical imagery. Validation runs at the entity level, so it catches uploads from the admin UI, JSON:API, and programmatic saves alike.
What the recipe sets up
- Applies core's image_media_type recipe, creating the Media: Image bundle if it doesn't exist.
- Installs the AI, AI Validations, and Field Validation modules.
- Creates a field validation rule set attached to field_media_image running the AI image constraint against the configured provider.
- Verifies before applying that a default model is configured for the chat_with_image_vision operation type — if not, the apply aborts cleanly and rolls back.
Requirements
- Drupal 10.3 or newer / Drupal 11
- AI module ^1.4 with a configured vision-capable provider (e.g. OpenAI, Anthropic, Google Gemini)
- AI Validations ^1.3 (standalone — 1.3.0 or newer, which resolves the recipe's "Default" provider correctly)
- Field Validation ^3.0
Installation
Field Validation 3.0 currently has beta releases only, so projects using the default minimum-stability: stable must allow it explicitly first:
composer require drupal/field_validation:^3.0@beta
composer require drupal/ai_recipe_validations_image_safety
drush recipe ../recipes/ai_recipe_validations_image_safety
drush cache:rebuildThe first command becomes unnecessary once Field Validation tags a stable 3.0.0.
Notes
- Each image upload triggers one vision-model API call; factor provider costs into bulk imports or high-volume upload flows.
- The default threshold blocks everything outside "Safe". See the README for how to relax it to block only "Restricted" content.