openmoat 0.23.1

Policy checks for AI coding agents: decides allow, defer, review or deny for each tool call the hook of Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot CLI and seven more agents reports, 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
use std::os::windows::process::CommandExt as _;
use std::process::Command;

/// `DETACHED_PROCESS`: no console of the hook's.
const DETACHED_PROCESS: u32 = 0x0000_0008;
/// `CREATE_NEW_PROCESS_GROUP`: not ended with the hook's group.
const CREATE_NEW_PROCESS_GROUP: u32 = 0x0000_0200;

/// A process group of its own and no console.
pub fn own_group(command: &mut Command) {
    command.creation_flags(DETACHED_PROCESS | CREATE_NEW_PROCESS_GROUP);
}