Skip to content

Evaluating and Governing AI‑Generated Content in Strapi 5

Learn a step‑by‑step process to audit, review, and retain AI‑generated content in Strapi 5, using Revisionary and best‑practice governance to stay compliant with emerging regulations.

By the Revisionary team · · 6 min read

man in black crew neck t-shirt using macbook
Photo by Anthony Riera on Unsplash

Answer: Use Revisionary’s versioning, review space, audit log, and retention settings to create a repeatable workflow that captures every AI‑generated change, routes it through a human‑in‑the‑loop review, and stores evidence for compliance.


Why AI‑Generated Content Needs Governance

Large language models (LLMs) can create copy, code snippets, and metadata instantly, but they also introduce:

  • Legal risk – Mis‑attribution, copyrighted excerpts, or prohibited content.
  • Quality risk – Hallucinations, bias, or tone that does not match brand guidelines.
  • Operational risk – Unexpected changes to published content that break downstream integrations.

A headless CMS like Strapi already records who edited what and when. Extending that record to include how the content was created (human vs. AI) gives teams the visibility needed for audits, compliance, and continuous improvement.

a group of people sitting around a table with laptops
Photo by Lyubomyr Reverchuk on Unsplash

Quick Governance Checklist

✅Action
1Enable Revisionary on every content type that may receive AI output.
2Add a hidden metadata field (e.g., generated_by) to capture the LLM name and request ID.
3Configure the Review space to require a human sign‑off before publishing AI drafts.
4Log every AI request in the audit log via a custom Strapi lifecycle hook.
5Set retention policies that keep AI‑generated versions for the period required by your jurisdiction.
6Define role‑based permissions so only approved editors can publish AI content.
7Periodically run quality‑checks (e.g., plagiarism, policy compliance) on the version history.

Regulators in several regions are drafting rules that directly affect AI‑generated media. While specifics evolve, common themes include:

  • Transparency – Publishers must disclose when content is AI‑generated.
  • Traceability – Organizations need to retain records of the model version and prompt used.
  • Safety – Prohibited content (e.g., hate speech, disallowed political persuasion) must be filtered.

Staying compliant therefore means capturing provenance at the moment of generation and preserving it for the required retention period. Strapi’s audit log and Revisionary’s version history give you a built‑in, tamper‑evident trail.

Setting Up a Safe Generation Workflow in Strapi

1. Install Revisionary and Mark Content Types as Versioned

bash
# Assuming you have Strapi 5 installed
unzip revisionary.zip -d ./src/plugins
npm run build && npm run develop

After installation, navigate to Settings → Plugins → Revisionary and enable versioning for any collection types that will receive AI‑generated data (e.g., article, blogPost, productDescription). This adds a Version history panel on the right side of the Content Manager, as described in the user guide [/docs/everyday-use/panel].

2. Add a Metadata Field for AI Provenance

Create a hidden JSON field called generated_by on the selected content types. Example schema fragment:

json
{
  "kind": "collectionType",
  "collectionName": "articles",
  "info": {"singularName": "article", "pluralName": "articles"},
  "options": {"draftAndPublish": true},
  "attributes": {
    "title": {"type": "string"},
    "body": {"type": "richtext"},
    "generated_by": {"type": "json", "private": true}
  }
}

The field will be populated automatically by a small lifecycle hook that runs after an AI request finishes.

3. Hook Into the AI Generation Process

Assuming you call OpenAI’s chat/completions endpoint from a custom Strapi service, add a hook to store provenance:

js
// src/api/article/services/article.js
const { createCoreService } = require('@strapi/strapi').factories;

module.exports = createCoreService('api::article.article', ({ strapi }) => ({
  async generateFromAI(entryId, prompt) {
    const response = await strapi.plugin('openai').service('client').createChatCompletion({
      model: 'gpt-4',
      messages: [{ role: 'user', content: prompt }],
    });

    // Save AI output and provenance
    const updated = await strapi.entityService.update('api::article.article', entryId, {
      data: {
        body: response.choices[0].message.content,
        generated_by: {
          model: 'gpt-4',
          requestId: response.id,
          timestamp: new Date().toISOString(),
          prompt,
        },
      },
    });

    // Record a custom audit entry (see next section)
    await strapi.service('api::audit.audit').logAIAction(entryId, response.id);
    return updated;
  },
}));

The generated_by field is stored alongside the content version, so every change can be inspected later via the Version history panel.

4. Force Human Review Before Publication

Revisionary provides a Review space (/docs/teamwork/review) that aggregates entries awaiting approval. Configure the workflow:

  1. In Settings → Plugins → Revisionary → Review, set the default state for new drafts to "Needs Review".
  2. Assign the "Reviewer" role the permission review:read and review:update.
  3. When an editor saves an AI‑generated draft, it automatically appears in the Review queue.
  4. The reviewer opens the version, checks the generated_by metadata, runs any external compliance checks (e.g., plagiarism), and either Approve (publishes) or Reject (returns to draft).

Because Revisionary records every state transition, the audit log will show who approved the AI content and when.

5. Log AI‑Specific Actions in the Audit Log

Strapi’s built‑in audit log captures generic actions like create, update, delete. To add AI‑specific entries, create a lightweight plugin or use a custom service:

js
// src/api/audit/services/audit.js
module.exports = ({ strapi }) => ({
  async logAIAction(entryId, requestId) {
    await strapi.entityService.create('plugin::audit.audit-log', {
      data: {
        action: 'ai_generate',
        entity: 'article',
        entityId: entryId,
        details: { requestId },
        user: strapi.admin.getCurrentAdmin().id,
      },
    });
  },
});

These entries appear alongside the standard audit trail, providing a complete forensic record for regulators.

Retention and Storage Policies

Different jurisdictions prescribe how long AI‑generated content must be kept. Revisionary’s Retention and storage settings (/docs/settings/retention) let you define a global rule (e.g., 24 months) or per‑content‑type overrides.

  1. Go to Settings → Plugins → Revisionary → Retention.
  2. Choose "Keep all versions for" and set the desired number of days.
  3. Enable "Purge automatically" so older versions are removed without manual intervention.

When a version is purged, the audit log entry remains, preserving the proof of generation while freeing storage.

Permissions: Who Can Generate, Review, and Publish?

Granular role‑based access is essential to prevent unauthorized AI usage. Strapi’s permission matrix (/docs/getting-started/permissions) lets you:

  • Create a dedicated "AI‑Operator" role that can call the generation service but cannot publish directly.
  • Grant the "Reviewer" role the ability to change a draft’s status from Needs Review to Approved.
  • Restrict the "Publisher" role to only publish content that has passed review.

By separating these duties, you enforce a four‑eye principle and satisfy many compliance frameworks.

Practical Quality‑Control Steps

StepTool/FeatureWhat to Check
1Revisionary version diffCompare AI‑generated fields with the previous version to spot hallucinations.
2Custom linting scriptRun a grammar/spell check on the body field before it enters Review.
3Plagiarism APIValidate that the AI output does not reproduce copyrighted text.
4Policy filterIf you already use OpenAI Moderation, feed the generated text through it and store the moderation result in generated_by.moderation.
5Human reviewer checklistConfirm tone, brand voice, and legal disclaimer presence.

All of these steps can be automated as part of a CI/CD pipeline that pulls the latest draft via the Content API (/docs/reference/content-api) and runs tests before the Review stage.

Example End‑to‑End Flow

  1. Content editor clicks "Generate with AI" button in the Strapi UI (custom button that triggers the service shown earlier).
  2. Service returns text, stores it, and records provenance.
  3. Revisionary creates a new draft version with status "Needs Review".
  4. Reviewer opens the Review space, inspects the version diff, runs external checks, and clicks Approve.
  5. Approval changes the status to "Ready to Publish"; the Publisher role can now make the content live.
  6. Every transition (generate, review, approve, publish) appears in the audit log, and the full version chain is retained for the configured retention period.

Aligning with AI Regulation

RegulationCore RequirementHow Revisionary Helps
EU AI Act (proposed)Transparency of AI‑generated mediagenerated_by field stores model name & request ID; visible in version history.
US FTC Guidance (AI disclosures)Clear labelingAdd a computed is_ai_generated boolean that the front‑end can read from the Content API.
UK Online Safety BillRecord‑keeping for harmful contentAudit log captures moderation outcomes and reviewer decisions.

By mapping each regulatory clause to a concrete Strapi feature, you can build a compliance matrix that stays up‑to‑date as laws evolve.

Checklist for Ongoing Governance

  • Enable Revisionary on all AI‑eligible content types.
  • Add provenance metadata (generated_by).
  • Force Review before publishing AI drafts.
  • Log AI actions in the audit log.
  • Set retention to meet legal requirements.
  • Define roles: AI‑Operator, Reviewer, Publisher.
  • Integrate external quality checks (plagiarism, moderation).
  • Periodically audit the audit log for missing entries.
  • Update policies when new regulations appear.

Following this checklist turns AI‑generated content from a risky shortcut into a controlled, auditable asset.


Server rack with blinking green lights
Photo by Domaintechnik on Unsplash

Conclusion

AI can accelerate content creation, but without a structured governance layer teams expose themselves to legal, quality, and operational risk. Strapi 5 combined with the Revisionary plugin gives you a complete provenance chain: every AI‑generated edit is versioned, reviewed, logged, and retained according to policy. By wiring a small provenance field, enforcing a Review workflow, and configuring retention and permissions, you satisfy emerging AI regulations while keeping the editorial experience fast and collaborative.

TagsAIcontent governanceStrapiRevisionaryLLMheadless CMS

The Revisionary team

Developers who build Revisionary, a version history plugin for Strapi 5. We write about Strapi, web development, AI and application security.

This article was written with the help of AI.

All articles