pub enum Sandbox {
Inherit,
StoreScoped,
Subprocess,
}Expand description
Kernel-sandbox declaration for a tool — the Landlock A→B seam.
v0 (declarative/audit-facing): the serve-level Landlock ruleset
(WM_LANDLOCK=1) confines the whole process’s write-class filesystem
rights to the store root; this field records nothing enforced per tool.
v1 (enforced): tools declaring Sandbox::StoreScoped become eligible
to run on a dedicated Landlock-restricted thread, upgrading the pathway
without reworking tool definitions.
Variants§
Inherit
Tool runs with the process’s ambient filesystem rights (default). The serve-level ruleset still applies process-wide when enabled.
StoreScoped
Tool only touches paths beneath the store root — eligible for the v1 per-tool restricted-thread pathway.
Subprocess
Tool launches external processes — its spawn sites must build
commands through crate::Context::spawn so the OS runner
(mandala-sandbox) can wrap them (B2). Declaring this is the
tool’s assertion that it uses the policy; the dispatcher injects
it and loud-degrades when no runner resolves.