openmoat 0.21.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
//! Without Unix modes (Windows) the key file's access is the folder's ACL,
//! which OpenMoat does not read; only that it is a regular file is checked.

use std::fs::Metadata;
use std::path::Path;

use anyhow::{Result, bail};

pub(super) fn check(path: &Path, file: &Metadata, _: Option<&Metadata>) -> Result<()> {
    if !file.is_file() {
        bail!(
            "{} is not a regular file, so it is not used as a key",
            path.display()
        );
    }
    Ok(())
}