This project is not covered by Drupal’s security advisory policy.
Makes every LocalGov Mail email rule go through draft, review and approval before it acts on live mail, and keeps each version, approver and reason so any rule can be rolled back.
Triage Governance is part of LocalGov Mail, an AI-assisted email triage service for UK councils that runs on Drupal and reads Microsoft 365 mailboxes. LocalGov Mail uses rules to decide what happens to incoming mail: mailbox rules describe a resident's need and the action to take, and sender rules skip, notify or forward mail from a particular address. Because these rules change how residents' emails are handled, a council needs to show who wrote each one, who approved it and why. This module turns rules into versioned Drupal content with an approval workflow and a permanent audit trail, so nothing changes live mail handling without a second person agreeing.
Features
- Rules as revisioned content. Mailbox rules (
triage_need_rule) and sender rules (triage_sender_rule) are revisionable content entities, each belonging to one mailbox. They replace the earliertriage_needandtriage_ruleconfiguration entities. - Approval workflow using core Workflows and Content Moderation (workflow
triage_rule): Draft, In review, Approved, Published, Retired. Authors submit rules; the mailbox's team leader or manager approves them, asks for changes or retires them. Approval needs a written reason, and approved rules are published straight away by default. - Only the published version acts on mail. Editing a live rule creates a new draft, and the published version keeps working until the change is approved.
- Permanent audit trail. Every step is saved as a revision and as a row in an append-only audit log (
triage_rule_audit) with who, when, the change of state and the reason. Nobody can edit or delete an audit row, not even the site administrator, and audit rows never hold email addresses. - Rollback. Any earlier version can be restored as a new draft for review. A team leader or manager can also revert straight to the previous published version in an emergency, which is recorded as such.
- Risk checks. A rule classed as high risk cannot be submitted for review. A sender rule that forwards mail outside the council's own email domains is always treated as needing review.
- Quick approval for sender rules. Sender rules created from the mailbox or the assistant go straight into review, so a team leader can approve them in one click.
- Personal data handled properly. Because a sender rule names a person, retired sender rules are deleted after 12 months (configurable). A single call removes every sender rule naming an address when someone asks for their data to be erased.
- Moving rules between sites. Rules are kept out of configuration sync. Drush commands export a mailbox's published rules to JSON and import them elsewhere, where they arrive as drafts that must be approved again.
Use this module if you run LocalGov Mail and need to show your Data Protection Officer, auditors or internal governance board how the automated handling of email is controlled, in line with UK GDPR accountability and the EU AI Act's expectations for human oversight.
Post-Installation
- Install with Composer (
composer require drupal/triage_governance) and enable it withdrush en triage_governance. This also enables core Workflows and Content Moderation and installs the Rule approval workflow. - Set your council's email domains in the
triage_governance.settingsconfiguration (council_domains), for example withdrush config:edit triage_governance.settings. Forwards to any other domain will need review. The same file setspublish_on_approval(default on) andsender_rule_retention_days(default 365). - Give staff the right role on each mailbox. Writing and submitting rules, and approving them, follow the per-mailbox capabilities from Triage Common (author, team leader, manager); there is no new site-wide permission to grant for everyday use.
- Create and approve rules from the existing LocalGov Mail mailbox rules pages and the Triage Mail Assistant rule builder. New rules start as drafts and do nothing until approved.
- To copy rules to another site, run
drush triage:rules-export rules.json --source=MAILBOX_ID(add--sender-rulesto include sender rules) anddrush triage:rules-import rules.jsonon the other site. - Make sure LocalGov Mail's hourly maintenance run is in place, so expired sender rules are deleted on time.
Rules held in the old configuration entities are not migrated: create them again as drafts, or import them from an export. The module adds no content types or text formats.
The Bypass the rule approval workflow permission lets the configuration API publish rules immediately. It exists for automated tests only. Never grant it on a live site.
Additional Requirements
- Drupal 11.3 or later, with the core Workflows, Content Moderation and Datetime modules.
- Triage Common, which provides the rule interfaces, per-mailbox access and the maintenance run.
Recommended modules/libraries
- Triage Mail, which applies the rules to Microsoft 365 mailboxes.
- Triage Mail Assistant, for building rules with AI help.
- Triage Fleet, which records who is accountable for each mailbox and its data protection details.
Similar projects
Drupal core's Content Moderation provides the workflow engine this module builds on. Triage Governance adds what LocalGov Mail rules need on top of it: rules scoped to one mailbox, approval rights taken from each mailbox's team, an audit log that cannot be changed, risk checks before submission, emergency rollback and deletion of personal data in sender rules. It only works with LocalGov Mail.
Supporting this Module
Bug reports, feature requests and patches are welcome in the issue queue. Councils interested in using or funding LocalGov Mail are welcome to get in touch through the project maintainers.
Community Documentation
- The module's
README.mdcovers the workflow, rollback, the rule repository service for developers and personal data handling. - Related projects: Triage Common, Triage Mail, Triage Mail Assistant, Triage Fleet, Mailbox Provider, OAuth Provider.
Project status
Under active development on the 1.0.x branch. Coming next: an automatic risk classifier for rules, routing approvals to the DPO where needed, testing draft rules against past mail before approval, and an oversight log of staff corrections.
Project information
- Project categories: Automation
- Created by david bishop on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
