This project is not covered by Drupal’s security advisory policy.
Midgard turns Drupal into a safe, auditable AI operations layer. When an AI agent changes your site, Midgard makes the change reviewable, reversible and recorded — because in Drupal the output that matters is real configuration, not throwaway text.
The output is configuration, not text. Midgard treats AI as a governed operator of your site, not a content generator. Every change it makes is captured as Drupal config you can review, roll back and export.
Drupal already has a rich AI ecosystem — providers, agents, generators, an MCP server. Midgard is the opinionated assembly that makes those pieces feel like a single coherent product, and adds the one thing an operations layer needs: governance. It does not compete with the AI modules that make changes; it governs them.
Four guarantees for every AI-driven change
- 🛡️ Guarded. A Midgard skill that writes or executes must be guarded, so its changes run through a single safety primitive. An unguarded one is already flagged, and will be refused from 1.0.
- 👁️ Observable. A universal configuration-events subscriber captures each change the moment it happens, so you see exactly what the AI touched.
- ↩️ Reversible. Changes are snapshotted before they apply and can be rolled back, through Drupal core's configuration importer.
- 📦 Exportable. The result is standard, version-controllable Drupal configuration — the same YAML your team already reviews and deploys.
How Midgard governs the AI ecosystem
Midgard sits underneath the tools that act on your site and watches the only thing that counts: configuration changes. A guarded skill, or a configuration import, is scored for risk, held for human approval when the impact is high, snapshotted, and written to a tamper-evident audit trail. Every tool call over MCP is audited too, including the ones Bifrost refuses.
Use the agents you like — Midgard governs what they do. Because it governs at the configuration layer rather than inside any one tool, Midgard works with the ecosystem instead of replacing it.
It never calls AI provider APIs directly — it always goes through drupal/ai — and it never reimplements snapshot or rollback — it builds on existing configuration primitives.
What's in the suite
Midgard
The umbrella: AI provider layer, the safety primitive, the admin UI, and the install & diagnostic tooling that ties everything together.
Bifrost
A Model Context Protocol bridge that offers Midgard skills to AI agents as MCP tools: OAuth 2.1 with per-client scopes and PKCE S256, and an audit row for every tool call.
Heimdall
Risk scoring, human-in-the-loop approval for high-impact changes, and a tamper-evident, hash-chained audit log of every resolution.
Eir
An optional gate for file-based configuration imports (drush config:import and the sync UI): every import is risk-scored and snapshotted, and a high-impact one is refused until that exact change list is approved.
Standing on the shoulders of the ecosystem
Midgard's rule is simple: adopt upstream where it exists, wrap it where it doesn't. It is a light governance layer on top of well-maintained projects, with sincere thanks to their maintainers and communities:
- AI (drupal/ai) — the provider abstraction. Midgard never talks to OpenAI, Anthropic, Gemini or Ollama directly — it goes through drupal/ai. Built by FreelyGive and the Drupal AI Initiative.
- MCP Server — the Model Context Protocol transport that Bifrost rides on. Part of the Acquia-sponsored MCP effort.
- Simple OAuth — the OAuth 2.1 layer behind agent access over HTTP, with the MCP Server OAuth companion. Bifrost adds its own PKCE S256 check for its clients.
- Key — secure storage for API keys. Midgard never stores a secret anywhere else.
🛡️ Built on Config Guardian
Midgard's reversibility and audit guarantees are powered by Config Guardian — snapshot, simulate, risk-score, rollback and audit primitives for Drupal configuration. Midgard requires Config Guardian 1.1, which rolls back through Drupal core's configuration importer.
Config Guardian is built by the same author as Midgard, so the integration is deliberate and vertical: Midgard delegates the dangerous parts to a focused module that already carries Drupal Security Team coverage, instead of reinventing them.
Install in minutes
Midgard ships an opinionated installer and a diagnostic command, so a working governed setup is a few lines away:
composer require 'drupal/midgard:^1.0@alpha' 'drupal/mcp_server:2.0.0-beta6@beta' 'drupal/mcp_server_oauth:1.0.0-alpha1@alpha'
drush en midgard midgard_bifrost midgard_heimdall
drush midgard:install
drush midgard:doctor
midgard:install wires the provider, keys, routing and permissions; midgard:doctor reports the health of every part of the suite. The MCP packages are pinned to those exact pre-releases, so a project on the default minimum-stability: stable needs the stability flags shown above.
How it relates to Drupal's direction
Midgard is a complement to Drupal's AI direction and to the broader move toward safer configuration governance — not a competitor. It does not replace Workspaces, Configuration Management, or the official AI modules; it sits beside them and makes AI-driven configuration changes accountable. If the official tooling grows to cover something Midgard wraps today, Midgard happily steps back to the upstream.
Roadmap
Midgard is built as a suite. The current line ships the provider layer, the MCP bridge (Bifrost), governance (Heimdall) and import gating (Eir). On the near-term roadmap:
- Muninn — observability and content/configuration insight across governed changes.
- Guarded skills over MCP — today a skill that needs the safety primitive is not offered over MCP at all; the plan is to run it through the primitive there too, with human approval for high-impact changes.
- Path to a stable 1.0 — moving to a stable MCP Server 2.0 (Bifrost runs on 2.0.0-beta6 today) and opting in to Drupal Security Team coverage. Until both land, releases stay on the alpha/beta line.
- Further submodules for auditing, configuration repair, content QA and design sync are planned as the suite matures.
⚠️ Project status — please read before installing
Midgard is a pre-1.0 alpha. It targets Drupal 11; its own code is already Drupal 12-clean (zero deprecated API calls), and it will declare Drupal 12 support as soon as its AI and OAuth dependencies do. Drupal 11 receives upstream support well into 2027.
It is honest about what it is: a young, actively developed governance layer. Its MCP bridge runs on MCP Server 2.0.0-beta6, pinned to that exact release, so releases remain alpha until MCP Server 2.0 ships stable and Security Team coverage is opted in.
Upgrading from 1.0.0-alpha3? Your project's composer.json pins MCP Server, so the new pin goes in the same command: composer require 'drupal/midgard:^1.0@alpha' 'drupal/mcp_server:2.0.0-beta6@beta' -W, then drush updatedb and drush cache:rebuild. If Composer refuses because your Drupal core is affected by a security advisory, run composer update 'drupal/core-*' -W first. Sites that use Bifrost over HTTP should upgrade.
Upgrading from 1.0.0-alpha1 or alpha2? Those ran on MCP Server 1.x, which is no longer supported. Follow "Upgrading from mcp_server 1.x" in the Bifrost README: it includes a composer reinstall of MCP Server and drush updatedb.
Getting involved & support
Found a bug?
Midgard is alpha — your feedback is the point. Report bugs, request features, or tell us where the governance model gets in your way.
Review the model
Real-world deployments and review of the security and governance model are especially welcome at this stage.
Contribute
Midgard and Drupal are open source, built by the community. Patches, docs and ideas all help.
Project information
- Project categories: Artificial Intelligence (AI), Automation, Security
3 sites report using this module
- Created by andresmoreno28 on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
Releases
Bifrost enforces PKCE S256 itself; MCP Server 2.0.0-beta6 and Config Guardian 1.1. Sites that use Bifrost over HTTP should upgrade.
