Skip to main content

Action

Enum Action 

Source
#[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, }, Patch { writes: Vec<String>, }, ReadFiles { paths: Vec<String>, }, McpTool { name: String, reads: Vec<String>, writes: Vec<String>, hosts: 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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Shell

A shell command string as the host would execute it. A shell command line, exactly as the host would run it.

Fields

§command: String

The command line.

§

ForeignShell

A command for a shell the classifier cannot read (Claude Code PowerShell). Never classified, so always unparseable: an ask, never an allow.

Fields

§shell: String

The shell’s name, for reasons and the audit log.

§command: String

The command line.

§

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).

Fields

§path: String

Path as the tool gave it; normalised during classification.

§

FsWrite

A direct file write/edit through a host tool. A file write or edit by a host tool (Edit, Write, NotebookEdit).

Fields

§path: String

Path as the tool gave it; normalised during classification.

§

Net

A network connection a host tool opens and may send data over (Claude Code Monitor WebSocket).

Fields

§url: String

The URL as the tool gave it.

§

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).

Fields

§url: String

The URL as the tool gave it.

§

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).

Fields

§writes: Vec<String>

Every file the patch adds, updates, deletes or moves to.

§

ReadFiles

Files one tool call reads together (Claude Code SendFile, which sends their contents to another session): every path is read.

Fields

§paths: Vec<String>

Every file the call reads.

§

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.

Fields

§name: String

mcp__<server>__<tool>.

§reads: Vec<String>

Paths the call reads, derived from its arguments.

§writes: Vec<String>

Paths the call writes, derived from its arguments.

§hosts: Vec<String>

URLs or hosts the call contacts, derived from its arguments.

§unchecked: Option<String>

The limit that stopped the adapter searching the arguments (nesting depth, number of paths and URLs). What was not searched may name a file or host, so the engine decides the call at least ask.

Implementations§

Source§

impl Action

Source

pub fn kind(&self) -> Kind

The kind of action as a user would describe it (Patch writes files).

Source

pub fn mcp(name: impl Into<String>) -> Self

An MCP call whose arguments are not interpreted.

Trait Implementations§

Source§

impl Clone for Action

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Action

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Action

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for Action

Source§

impl PartialEq for Action

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Action

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Action

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.