Downloads

Download tar.gz 10.28 KB
MD5: e93d76bf8124062bd88c03994fc5c8f5
SHA-1: bc9fa8b7447a367922f8f2c1ce774cb566951181
SHA-256: 9c17e28d0d370beb8b8ab1ec128f4a493c7fa1c19d87e277908057d111109d7c
Download zip 12.24 KB
MD5: cd47e96024df541386f4a9ea87ba52be
SHA-1: c7878edfddfd2b96ee6f4bcf46c5f63a17ae7bf1
SHA-256: c909a39228d80f37aa8fe3b909e18fb492fd6c597f774e7db906bf1f923b6cce

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:rebuild

The 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.

Created by: ahmad-khalil-imagex
Created on: 8 Jul 2026 at 18:25 UTC
Last updated: 8 Jul 2026 at 18:25 UTC
New features

Other releases