Using Azure AI to Safeguard and Moderate Sitecore Forms Submissions
- Yassine Alahyane
- Jan 23
- 2 min read

January 23rd 2025
In this previous blog post I shared how we used Azure AI Speech Service to improve content accessibility and boost user engagement by enabling users to choose between reading articles or listening to them.
In this blog post I will share another practical application of Azure AI Services within Sitecore implementations that I’ve found to be highly effective and valuable: leveraging Azure AI Content Safety with Sitecore Forms.
Azure AI Content Safety identifies and blocks content related to violence, hate, sexual themes, and self-harm. Additionally, it allows you to create custom block lists for specific words you want to restrict.
In a recent Sitecore XM/OrderCloud project, we implemented Product Reviews and wanted to have content moderated before the reviews gets displayed on the website.
Using Sitecore Forms, I developed a custom Submit Action that integrates with Azure AI Content Safety to prevent harmful content from being submitted before pushing the reviews into our system.
The Submit Action is generic enough, that I thought it would be a good idea to share it with the community.
With this blog post, I'm sharing a Sitecore Plugin that includes the Submit Action and the integration with Azure AI.
How to set up Azure AI Content Safety and install the ALYAS plugin:
Add Azure AI Content Safety Resource From Azure Portal.
Depending on your needs, choose between Free and Standard Pricing Tier.
Grab the API Key and Endpoint.
Clone the Repository here. and add the Feature Project: Alyas.Feature.ContentSafety to your XM/XP Solution in Visual Studio.
Download the Sitecore package from the 'Sitecore Packages' folder in the repository and install it using the Sitecore Installation Wizard.
Add the Azure AI Content Safety Endpoint and Api Key to Alyas.Feature.ContentSafety.config

Optionally add you custom Block List. For more details on creating and managing block lists in Azure AI Content Safety, check this link.
How to use the plugin:
After installing the plugin you should see a new Submit Action called 'Ensure Content Safety' in the form builder's submit actions.
Simply add the submit action to your submit button.
I suggest you add it first, to block any further steps in case of harmful content.

Below is an example involving violent content (masked to ensure it does not offend or distress anyone).

The submit action included with this plugin can be used with any Sitecore Form, and with no additional code. However, the code is open-source, so feel free to add or change it to meet your own requirements.
Thank you for reading! If you found this helpful, please share it with your network.
Commentaires