Maat: AI diagnostics for Ubuntu inside a strict snap, and three questions about interfaces

Hi all,

In April, Canonical wrote in The future of AI in Ubuntu that Ubuntu should expose “the primitives needed for agents to operate within existing boundaries, whether that be read-only analysis, tightly scoped permissions for any actions, and full auditability of decisions and outcomes.” That thread is closed now, so I’m starting a new one. I’ve been building an independent, open-source attempt at those primitives, and I’d like feedback from people who know snapd and Ubuntu security much better than I do.

What maat is

maat is an MCP server that lets an AI agent (through Claude Code, OpenCode or similar, with a hosted model or a local inference snap) troubleshoot an Ubuntu machine without being able to change it:

  • It runs in a strict snap that plugs only log-observe, system-observe and mount-observe, with no network plug. maat selftest shows the confinement holding: the journal and units are readable, internet sockets are refused with EACCES, writes to the home directory are refused, and RestartUnit is refused by AppArmor itself.

  • The model can’t run commands. It can only propose a typed plan, such as restarting one failed .service unit, citing the log lines it relied on.

  • A person applies the plan with a separate, unconfined tool, maatctl, which goes through polkit the same way systemctl does, and then checks the result.

  • Every step goes into a hash-chained audit trail, with checkpoints in the systemd journal.

  • New: one agent can reach many hosts over SSH, using a key that authorized_keys restricts to maat mcp. Each host still runs the confined server.

It’s a developer preview on latest/edge, tested on 24.04 (arm64). 26.04 isn’t tested yet.

What testing taught me

  • network-observe allows outbound TCP and UDP, because it includes the nameservice abstraction, so maat doesn’t plug it. I’ve opened canonical/snap-docs#679 to say this on the interface page.

  • Without it, the /proc/net socket tables are denied, and an early version of maat reported that as “no listening sockets”. It now fails closed and says why.

  • log-observe also makes two kernel settings writable (printk_ratelimit and AppArmor’s audit parameter) and grants dac_override. maat refuses to run as root, so file permissions block those writes, but it surprised me for an “observe” interface.

Three questions

  1. Would snapd consider a way to read socket tables and routes without network access, for example a variant of network-observe without the name-resolution rules? Or is the intended pattern a helper outside the snap?

  2. Would a strictly read-only log-observe make sense for diagnostic tools like this, or is refusing to run as root the expected answer?

  3. Does the permission prompting that landed in 26.04 cover, or plan to cover, interfaces like log-observe? Approving journal access for one agent session would fit this kind of tool better than a permanent connection.

Any other feedback is welcome, especially on the threat model (docs/security-model.md in the repo) and anything I’ve got wrong about snapd.

maat is an independent project, not affiliated with or endorsed by Canonical.

1 Like