Introduction

AI Site Manager is a Drupal module that lets a site administrator describe a site management task in plain
English — "enable the Metatag module", "clear all caches", "turn on maintenance mode" — using whichever
AI provider the site has configured via the AI (Artificial
Intelligence)
module. Every request is interpreted into one specific, human-readable action and shown to you
for review before anything runs; nothing is ever executed straight from a prompt.

No API key or AI provider is required for this module to work: without one configured, requests fall back to
plain keyword matching against the same fixed set of actions the AI would otherwise choose from.

Project Summary

Turn natural-language requests into a small, fixed set of safe, previewable, audited Drupal admin actions —
never into arbitrary generated code or commands.


Features

  • Chat-style admin console at Configuration → AI → AI Site Manager — describe a task, then review an exact preview (what will happen, and its risk level) before confirming.
  • AI interpretation via AI Core's AiProviderPluginManager (any configured chat-capable provider — OpenAI, Anthropic, Ollama, etc.), with automatic fallback to keyword matching if no provider is configured or the AI isn't confident enough.
  • A safety layer validates every interpreted action and its parameters against a fixed, plugin-declared vocabulary before it ever reaches execution — a hallucinated or malformed AI response is rejected, not executed.
  • Execution requires a second, explicit confirmation and a separate, restricted permission from merely previewing a request.
  • Every interpretation and execution — previewed, executed, failed, or blocked — is written to a full audit log (AI Site Manager → History), including who requested it, which language it was in, and the outcome. Log retention is configurable, with automatic pruning on cron.
  • Built for the multilingual Drupal.org community: on a multilingual site, a "Language" selector lets you tell the AI what language your request is written in, so it interprets it correctly and replies in that language — the chosen action itself is still validated as a literal machine name from the fixed catalog, exactly as with an English request.
  • v1 covers three areas of site administration: enabling/uninstalling modules, clearing caches (all bins, or one named bin), and toggling maintenance mode.
  • Flood control on AI interpretation requests bounds both abuse and AI provider cost.
  • Extensible by design: each admin area is a small plugin declaring its own actions/parameters/preview text; adding a new one requires no changes to the interpretation, safety, or audit pipeline.

Post-Installation

After installing the module:

  1. Go to People → Permissions and grant Access AI Site Manager to roles that should be able to describe and preview requests, and Administer AI Site Manager (a restricted permission) to roles that should be able to execute them and view the full history log.
  2. Go to Configuration → AI → AI Site Manager → Settings
    (/admin/config/ai/site-manager/settings) and choose an AI provider/model — or leave it to use
    the site's default chat provider under AI's own settings.
    Adjust the confidence threshold, generation, and usage-limit defaults as needed.
  3. Go to Configuration → AI → AI Site Manager (/admin/config/ai/site-manager),
    type a request such as "clear all caches", review the preview, and confirm.
  4. Review past activity any time at AI Site Manager → History.

Additional Requirements

A configured AI provider is optional, not required — the module works with keyword matching alone. This
module never talks to any AI provider directly and never stores an API key itself; it delegates entirely to AI
Core, so credentials are managed there.


Similar projects

AI Agents provides a general-purpose, tool-calling agent
framework that can be wired up to perform open-ended sequences of actions. AI Site Manager takes the opposite,
narrower approach on purpose: it only ever chooses from a small, explicitly declared vocabulary of site-management
actions, requires a human to review an exact preview and confirm before anything executes, and writes every
attempt to an audit log. It is a safety-first admin console for a fixed set of tasks, not a general agent runtime.


Supporting this Module

Bug reports, feature requests, patches, and documentation improvements are welcome through the Drupal.org issue
queue.


Community Documentation

Documentation is available in the project repository's README, including a full write-up of the safety model
(interpretation → validation → preview → confirmation → audit log).


Permissions

  • Access AI Site Manager – describe a task and see its preview. Cannot execute anything.
  • Administer AI Site Manager (restricted) – everything above, plus confirming and executing an action, and viewing the full history log and settings. Only grant this to trusted administrator roles: it can install/uninstall modules and take the site into maintenance mode.

Architecture

  • AICommandInterface / AICommandBase – the plugin contract each admin area implements: matches() and guessAction() for the keyword fallback, getActionsSchema() declaring its fixed vocabulary, preview() and execute().
  • ModuleCommand / CacheCommand / MaintenanceModeCommand – the three bundled Plugin/AICommand plugins, discovered automatically via plugin.manager.ai_command.
  • AIInterpreter – sends the prompt and the available command catalog to the configured AI Core provider, and parses its structured JSON response (with a retry on malformed output).
  • SafetyValidator – the enforcement point: rejects any plugin/action/parameter the AI (or keyword match) didn't get from the real schema, before a preview or execution ever happens.
  • CommandManager – orchestrates interpretation (AI first, keyword fallback), validation, preview building, re-validation at confirm time, and execution.
  • PromptHistory – records and retrieves the audit log (ai_site_manager_log table), with cron-based pruning.
  • ChatForm – the two-step describe/confirm form; the confirm/execute step is only shown to users with the Administer AI Site Manager permission.

The module is fully compatible with Drupal 11.

Project information

Releases