MGS2007: exec denied by sandbox
A spell tried to execute a binary whose resolved path is outside every path the policy grants exec on.
[MGS2007] exec denied: /home/user/Downloads/exfil
Why
Exec is a grant of its own: a path the sandbox lets a step read is not
thereby a path it may run. The default policy grants exec on the
workspace, the private temp dir, the system trees (/usr, /bin,
/sbin, /lib*, /opt, /nix/store), each absolute PATH entry
other than $HOME and its ancestors, toolchain install roots (GOROOT,
rustup, cargo's bin, mise, asdf) and the magus binary. This blocks the
attack pattern of dropping a small binary into ~/ and running it.
The binary path is the one exec.LookPath returns, resolved through its
symlinks, so an unqualified curl found at /usr/bin/curl is allowed.
Resolution
-
Built-in spells: should never trigger this. If they do, file a bug.
-
A tool you installed somewhere the default does not cover: grant its directory read and exec:
sandbox: allow: - path: ~/tools/bin mode: rxrois not enough: exec is never implied by read. -
A spell dropping and running a binary: do not extend the allowlist. This is the sandbox working as designed.