openmoat 0.18.0

Policy checks for AI coding agents: decides allow, defer, review or deny for every tool call from Claude Code, Codex, Cursor, OpenClaw, GitHub Copilot CLI, pi and Gemini CLI, configures Claude Code's, Codex's and Cursor's own OS sandboxes from the same policy, and keeps a local audit log.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! The OS sandbox layer on Linux: Landlock and seccomp under `openmoat run`.

use std::path::Path;

pub const BACKEND: Option<&str> = Some("Landlock + seccomp");

/// Landlock cannot deny inside a tree it grants, and `/tmp` is a read root:
/// a throwaway home there cannot be protected, so `openmoat run` refuses.
pub fn hint(home: &Path) -> String {
    if home.starts_with("/tmp") {
        "; the throwaway home is under /tmp, which the sandbox lets commands read: pass \
         --scratch-dir with a directory outside /tmp"
            .to_owned()
    } else {
        String::new()
    }
}