pub struct ShellTool { /* private fields */ }Expand description
The confined shell tool.
Registers under "shell". Accepts either argv form (program + args) or a
free-form cmd string parsed by the safe-subset engine. Leash refusals
(out-of-scope exec/fs, a refused construct) are returned as a structured
denied envelope (denied: true), not a hard error.
Implementations§
Source§impl ShellTool
impl ShellTool
Sourcepub fn new() -> Self
pub fn new() -> Self
Construct the tool with the real OS spawner, environment, and dir lister,
and the default LimitsPolicy.
Sourcepub fn with_config(limits: LimitsPolicy) -> Self
pub fn with_config(limits: LimitsPolicy) -> Self
Construct with the real seams and a caller-supplied LimitsPolicy — the
configurability seam (agent-bridle#143): tune timeouts / output / glob caps.
Sourcepub fn with_sandbox_policy(self, sandbox: SandboxPolicy) -> Self
pub fn with_sandbox_policy(self, sandbox: SandboxPolicy) -> Self
Set the sandbox mechanism policy (read/exec allow-lists, ABI floors) the L3 backend enforces (I5-B, #144). The default is today’s built-in allow-lists.
Trait Implementations§
Source§impl Tool for ShellTool
impl Tool for ShellTool
Source§fn name(&self) -> &str
fn name(&self) -> &str
The dispatch name (the key in
tools/list and in
crate::Registry::dispatch).Source§fn invoke<'life0, 'life1, 'async_trait>(
&'life0 self,
args: Value,
cx: &'life1 ToolContext,
) -> Pin<Box<dyn Future<Output = ToolResult<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn invoke<'life0, 'life1, 'async_trait>(
&'life0 self,
args: Value,
cx: &'life1 ToolContext,
) -> Pin<Box<dyn Future<Output = ToolResult<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Run the tool. The
cx proves the leash was passed; the tool enforces
per-operation policy by calling cx.check_exec, cx.check_path_*, etc.Auto Trait Implementations§
impl !RefUnwindSafe for ShellTool
impl !UnwindSafe for ShellTool
impl Freeze for ShellTool
impl Send for ShellTool
impl Sync for ShellTool
impl Unpin for ShellTool
impl UnsafeUnpin for ShellTool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more