Skip to content

Content Moderation

AI Context Items use Drupal's Content Moderation system to provide an editorial workflow. This ensures that context items go through a review process before being made available to AI agents.

Moderation states

Context items support the standard editorial workflow:

  • Draft -- the item is being worked on and is not yet available to agents
  • Published -- the item is live and can be selected by agents

Only published context items are included in agent system prompts. Draft items are invisible to the context selection pipeline.

How it works

The ai_context_item entity extends EditorialContentEntityBase, which provides built-in support for Content Moderation. The module depends on Drupal core's Content Moderation module.

When editing a context item, the moderation state and revision information are grouped together in the sidebar (similar to how nodes behave). This includes:

  • Revision log -- a message describing what changed
  • Moderation state -- select draft or published
  • Publish status -- if Scheduler is configured, the target moderation state for scheduled transitions

Combined with scheduling

Content Moderation integrates with the Scheduler module through the Scheduler Content Moderation Integration module. This allows you to:

  • Schedule a draft item to be published at a future date
  • Schedule a published item to be unpublished at a future date
  • Set the target moderation state for scheduled transitions

See Scheduling for details.

Combined with revisions

Each moderation state change creates a new revision, so you have a complete audit trail of when items moved between states and who made the change. See Revisions for details.