magus v0.4.3 is out. See what's new
¶ View markdown source · ✎ Suggest an edit
1 min read

MGS2002: path write denied

A spell tried to write to a file outside the workspace and outside the configured allowlist.

[MGS2002] fs write denied: /home/user/.bashrc

Why

The sandbox denies writes outside the workspace, its private temp dir, and the caches of the tools magus drives. This blocks the supply-chain attack pattern of modifying shell startup files, sudoers, or cron tables for persistence.

Resolution

  1. If the write target is a legitimate cache the default footprint does not know (a Bazel spell writing to ~/.cache/bazel): add it to magus.yaml:

    sandbox:
      allow:
        - path: ~/.cache/bazel
          mode: rw
    
  2. If the spell should be writing inside the workspace but is using an absolute path: the spell has a bug. File an issue with the spell author; in the meantime grant the path explicitly or disable sandbox mode.

  3. If this is a malicious spell, do not grant the path. Uninstall.

MGS2002sandboxsecuritypermissionswriteallowlistpersistence
Last updated (353014be)
Earlier changes on this page (3)

Full history ↗ · Blame source ↗

Glossary

Workspace

The magus root directory that owns a set of projects and shared config; the unit magus operates over. Workspace in full.

Target

A named operation (build, test, ...) you invoke with magus run <target>; it may compose a spell's tool-native operations and depend on other targets. Target in full.

Op

A single tool-native command a target composes (long form: operation); the middle of the work hierarchy (Spell to Op to Target). Op in full.

Spell

A language/runtime adapter (e.g. go, md) that maps generic targets onto a toolchain's real commands. Spell in full.

Cache

The content-addressed store magus consults before running a target, so unchanged work is skipped. Cache in full.

Sandbox

The restricted filesystem and environment a target runs in, so builds stay reproducible and side-effect-free. Sandbox in full.

CI

An ordinary target you compose yourself with ctx.needs; magus does not hardcode its stages. It is the anchor magus affected ci keys off, and ci strips the rw charm. CI in full.

Tool

An action a model can call through its host: a name, a description, a typed input and a result. magus serves its tools over MCP, each a read of the workspace model or a run of the CLI it already has. Tool in full.

Conventions

This page uses none of the site's convention markers. The full set is on the conventions page.