#[non_exhaustive]pub enum Action {
Shell {
command: String,
},
ForeignShell {
shell: String,
command: String,
},
FsRead {
path: String,
},
FsWrite {
path: String,
},
Net {
url: String,
},
Fetch {
url: String,
},
WebSearch {
query: String,
},
UnknownTool {
host: String,
tool: String,
reads: Vec<String>,
writes: Vec<String>,
hosts: Vec<String>,
commands: Vec<String>,
},
Unchecked {
action: Box<Action>,
reason: String,
},
Patch {
writes: Vec<String>,
},
ReadFiles {
paths: Vec<String>,
},
McpTool {
name: String,
reads: Vec<String>,
writes: Vec<String>,
hosts: Vec<String>,
commands: Vec<String>,
unchecked: Option<String>,
},
}Expand description
A tool call as seen from a host, before classification.
Host adapters (openmoat-hosts) translate each payload into exactly one of
these. Adapters never decide.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Shell
A shell command string as the host would execute it. A shell command line, exactly as the host would run it.
ForeignShell
A command for a shell the classifier cannot read (Claude Code PowerShell).
Never classified, so always unparseable: an ask, never an allow.
Fields
FsRead
A direct file read through a host tool (e.g. Claude Code Read).
A file read by a host tool (Read, Glob, Grep, LSP, beforeReadFile).
FsWrite
A direct file write/edit through a host tool.
A file write or edit by a host tool (Edit, Write, NotebookEdit).
Net
A network connection a host tool opens and may send data over
(Claude Code Monitor WebSocket).
Fetch
A URL read by a host’s own fetch tool (Claude Code WebFetch): a
request the agent cannot attach a body to, judged by fetch and net
rules (ADR-017).
WebSearch
A query a host’s own web search tool (Claude Code and Cursor WebSearch)
sends to the host’s search provider: judged by defaults.web.search.
UnknownTool
A host tool the adapter cannot classify, judged by defaults.tool.unknown.
What its arguments name is checked as well: every path and URL the
adapter finds in them, and every shell command under a key such as
command, so a tool OpenMoat does not know never runs unchecked.
Fields
Unchecked
A call the hook payload shows only in part: input typed into a shell
that is already running, or a search over directories the payload does
not name. action is decided as usual and the call is at least an
ask (rule UNCHECKED_RULE), since reason names what OpenMoat
cannot see.
Patch
A patch that edits several files in one call (Codex apply_patch):
every path it adds, updates, deletes or moves to is written.
Files changed by one multi-file patch (Codex apply_patch).
ReadFiles
Files one tool call reads together (Claude Code SendFile, which sends
their contents to another session): every path is read.
McpTool
An MCP tool call, mcp__<server>__<tool>. Adapters that understand a
server’s arguments add the paths and hosts the call touches so the
usual fs.* and net rules apply to it as well.
Implementations§
Source§impl Action
impl Action
Sourcepub fn kind(&self) -> Kind
pub fn kind(&self) -> Kind
The kind of action as a user would describe it (Patch writes files).
Sourcepub fn unknown_tool(host: impl Into<String>, tool: impl Into<String>) -> Self
pub fn unknown_tool(host: impl Into<String>, tool: impl Into<String>) -> Self
An unknown tool of host whose arguments name nothing to check.
Sourcepub fn unchecked(action: Self, reason: impl Into<String>) -> Self
pub fn unchecked(action: Self, reason: impl Into<String>) -> Self
action, decided at least ask because reason names what the
payload does not show (Action::Unchecked).
Sourcepub fn shown(&self) -> &Self
pub fn shown(&self) -> &Self
The action itself, without the Action::Unchecked wrapping around it.