Chirp AI Moderation
Chirp AI Moderation adds an AI-provider moderation check on top of Chirp Moderation, flagging likely toxicity, spam, or harassment before a chirp is even published — soft- or hard-blocking by category into the exact same moderator review queue Chirp Moderation already provides. This module is deliberately thin: it contributes only the AI screening logic itself, and hard-depends on Chirp Moderation for everything else (categories, the keyword vocabulary, the report/hard-block manager, the moderator queue UI). A site can run a fully working, non-AI moderation system without ever installing this module at all.
Features
- Provider-agnostic by design — built against Drupal's AI (AI Core) module's own provider abstraction. Whichever AI provider a site has configured for the "Moderation" operation type is used automatically — Ollama, OpenAI, Anthropic, or any other AI Core-compatible provider — with no provider-specific code in this module at all.
- Fails open, never blocks posting — if no AI provider is configured, or the provider errors or times out, chirps publish normally and are screened by Chirp Moderation's keyword vocabulary alone. AI pre-screening is an enhancement layer on top of a working system, never a required gate.
- Report, don't silently judge — for an ordinary flagged category, the AI never unpublishes or removes a chirp on its own. It creates a report for a human moderator to review, exactly as if a member had reported it — a deliberate choice reflecting that a probabilistic AI judgment is lower-precision than a moderator-curated keyword match.
- Hard-block categories are the one exception — if the AI's response matches a category an administrator has explicitly marked "hard block" (e.g. hate speech, threats of violence), the chirp is rejected immediately and the author notified right away, the same as a hard-block keyword match.
- Per-category AI key mapping — since different AI providers/models don't share a common moderation-category vocabulary, each Chirp Moderation category carries its own comma-separated list of provider-specific keys (e.g. `hate,hate/threatening`) and an optional confidence-threshold override, configured entirely through Chirp Moderation's own admin UI.
- A real plugin, not a hardcoded branch — implemented as a `ChirpModerationScreener` plugin (the same plugin type Chirp Moderation's own keyword screener uses), registered at a lower priority so the cheap, local keyword check always runs first and the AI call only happens on a keyword miss.
Post-Installation
Installing this module only adds one new field (`field_report_ai_detail`, storing the AI provider's raw response for a moderator's own reference) and a site-wide default confidence threshold setting. Everything else — categories, the keyword vocabulary, the moderator queue itself — belongs to Chirp Moderation and is unaffected by whether this module is present.
For the AI check to actually run, configure an AI Core provider under Configuration → AI → Providers and set it as the default provider for the "Moderation" operation type. Until a provider is configured, this is not an error — screening simply falls back to keyword matching alone.
Category-to-AI-key mapping is configured per category via Chirp Moderation's own admin UI at Configuration → Content → Chirp Moderation, not a screen this module owns itself.
Additional Requirements
- Chirp Moderation — hard dependency. This module is an enhancement of it, not a peer, and contributes no moderation infrastructure of its own.
- AI (AI Core) — provides the provider abstraction this module calls; no specific AI provider submodule is a hard dependency.
An actual configured AI provider (e.g. via an AI Core provider submodule) is required for the AI check to do anything, but its absence is handled gracefully rather than treated as a fatal error.
Recommended modules/libraries
Any AI Core-compatible provider submodule supporting the "Moderation" operation type — the specific choice is a site's own decision under AI Core's own Configuration UI, not something this module dictates.
Similar projects
This module is a thin AI-screening layer purpose-built for Chirp's own moderation queue and data model — it isn't a general-purpose AI content-moderation module, and doesn't attempt to work outside Chirp. If you don't need Chirp's own comment-based microblogging model, Chirp Moderation's own README documents the underlying architecture in case it's useful as a reference for a similar integration elsewhere.
Supporting this Module
This module is supported by Lisa Harrison (lisa.rae), an individual contributor and long-time member of the Drupal community.
Community Documentation
See this project's own README.md for full developer documentation — the AI screener plugin's own resolution logic, category/threshold mapping, and the test suite. See Chirp Moderation's own README for the moderation system this module extends.