Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

AI Webform Guard

13 sites Security covered Drupal 10–11 AI ecosystem
View on drupal.org

This module uses AI to protect your webforms from spam by analyzing submissions in real-time. It can be trained with custom prompts and offers options for human review, submission truncation, and trusted IP bypass to help manage costs and accuracy.

AI Webform Guard is a lightweight Drupal module that protects your Webform submissions from spam using AI-powered classification.

Instead of relying on traditional CAPTCHA mechanisms, this module uses Chat-based AI model (via the AI module) to analyze form submissions in real time and decide whether a message is spam or not — based on your custom prompt.

Features

  • Seamless integration with Webform module
  • Uses LLM-based AI detection to classify submissions
  • Configurable AI model and prompt template via UI
  • Logs blocked spam attempts if enabled
  • Prompt templates support Twig tokens and multilingual rendering
  • Exclude specific Webform fields from AI spam evaluation via UI
  • Human Iteration. If enabled, flagged submissions require manual confirmation before being allowed. The checkbox appears only for submissions flagged as potential spam.
  • Submission Truncation. Maximum words per AI request. Limits how many words from the Webform submission are sent to the AI to reduce token usage. On average, one word equals ~1.3–1.5 tokens. Useful for long forms.
  • New: Spam Confirmation Flow (per Webform). If the message is detected as spam, the user can confirm their email address via a new email handler.
    To do this, you must set up a new email confirmation handler using the Webform Email Confirmation Link module and enable the checkbox under the respective webform in AI Webform Guard Fields Settings.
    See the README for details.
  • New: Protect your custom forms from spam. You can also protect your custom forms against spam using AI by enabling the ai_form_guard submodule.
    After enabling it, you must enter the ID of the corresponding custom form in the AI Webform Guard Settings.
    On the new configuration page AI Form Guard – Custom Form Fields, you can define fields to be excluded from the spam check, with one field ID per line.
  • New:Trusted IPs bypass AI processing via an IP whitelist, repeat spammers are blocked by flood control without AI checks, and configurable token limits reduce API costs.
  • New: Spam Probability Threshold. The spam probability threshold is always active and determines when submissions are blocked based on AI-calculated spam probability.50 = Aggressive (block suspicious content, may have false positives), 70 = Balanced (default), 90 = Permissive (only block obvious spam with high confidence).

Requirements

  • Webform
  • AI module (with a working provider, e.g. OpenAI)

Configuration

  1. Go to Configuration → AI Webform Guard. (/admin/config/ai/ai_webform_guard)
  2. Enter a prompt to guide the AI model (e.g., "Classify the following submission as Spam or Not Spam.").
  3. Select your preferred AI model (optional — uses default otherwise).
  4. Save your settings.
  5. To exclude specific fields from spam detection:
  • Go to Configuration → AI Webform Guard Fields Settings (/admin/config/ai/ai_webform_guard/ai_webform_guard_fields)
  • Select the fields you want to ignore for each Webform

How it works

Each time a Webform is submitted, the module:

  • Renders your AI prompt (with Twig)
  • Appends the form submission data
  • Sends it to the selected AI model via chat interface
  • Parses the response looking for: Classification: Spam or Classification: Not Spam
  • Blocks the submission and logs it if spam is detected

Similar Projects

Depends on

Dependencies of the latest stable release

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
19
Tracked since
May 2025
Latest release
1 week ago
Releases (12 mo)
9 ▼ from 10
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
1.1.7 Stable 10–11 Aug 21, 2026
1.1.6 Stable 10–11 Jan 20, 2026
1.1.5 Stable 10–11 Jan 2, 2026
1.1.4 Stable 10–11 Dec 20, 2025
1.1.3 Stable 10–11 Dec 20, 2025
1.1.1 Stable 10–11 Nov 20, 2025
1.0.10 Stable 10–11 Oct 11, 2025
1.1.0 Stable 10–11 Oct 11, 2025
1.0.9 Stable 10–11 Oct 11, 2025
1.0.8 Stable 10–11 Jun 12, 2025
1.0.7 Stable 10–11 May 28, 2025
1.0.6 Stable 10–11 May 23, 2025
1.0.5 Stable 10–11 May 15, 2025
1.0.4 Stable 10–11 May 12, 2025
1.0.3 Stable 10–11 May 8, 2025
1.0.2 Stable 10–11 May 8, 2025
1.0.1 Stable 10–11 May 8, 2025
1.0.x-dev Dev 10–11 May 8, 2025
1.0.0 Stable 10–11 May 8, 2025