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() -> ShellTool
pub fn new() -> ShellTool
Construct the tool with the real OS spawner, environment, and dir lister,
and the default LimitsPolicy.
Sourcepub fn with_config(limits: LimitsPolicy) -> ShellTool
pub fn with_config(limits: LimitsPolicy) -> ShellTool
Construct with the real seams and a caller-supplied LimitsPolicy — the
configurability seam (agent-bridle#143): tune timeouts / output / glob caps.
Sourcepub fn with_output_observer(
self,
observer: Arc<dyn ShellOutputObserver>,
) -> ShellTool
pub fn with_output_observer( self, observer: Arc<dyn ShellOutputObserver>, ) -> ShellTool
Attach a presentation-only observer for bounded stdout/stderr chunks.
The observer is queued only after leash admission. It receives at most
the configured output cap per stream and cannot change authorization or
the final result envelope. Delivery may finish asynchronously after the
invocation returns; on_finish marks the queue-drained boundary.
Sourcepub fn with_sandbox_policy(self, sandbox: SandboxPolicy) -> ShellTool
pub fn with_sandbox_policy(self, sandbox: SandboxPolicy) -> ShellTool
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.
Sourcepub fn with_private_hosts(
self,
hosts: impl IntoIterator<Item = String>,
) -> Result<ShellTool, Error>
pub fn with_private_hosts( self, hosts: impl IntoIterator<Item = String>, ) -> Result<ShellTool, Error>
Approve exact names for RFC1918/ULA resolution by the existing fenced egress proxy. The owning harness supplies explicit operator approvals; command text and remote metadata are not authority. The invocation’s ordinary network scope must independently allow every requested host.
Empty by default. This does not start a proxy where no kernel fence exists, permit forbidden address ranges, or change filesystem/exec scope.
Trait Implementations§
Source§impl Tool for ShellTool
impl Tool for ShellTool
Source§fn name(&self) -> &str
fn name(&self) -> &str
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 = Result<Value, ToolError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
ShellTool: 'async_trait,
fn invoke<'life0, 'life1, 'async_trait>(
&'life0 self,
args: Value,
cx: &'life1 ToolContext,
) -> Pin<Box<dyn Future<Output = Result<Value, ToolError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
ShellTool: 'async_trait,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, T> ConvertInto<T> for Fwhere
T: ConvertFrom<F>,
impl<F, T> ConvertInto<T> for Fwhere
T: ConvertFrom<F>,
Source§fn convert_into(self) -> T
fn convert_into(self) -> T
Self to a value of type T.Source§impl<F, T> ConvertTryFrom<F> for Twhere
F: ConvertInto<T>,
impl<F, T> ConvertTryFrom<F> for Twhere
F: ConvertInto<T>,
Source§impl<F, T> ConvertTryInto<T> for Fwhere
T: ConvertTryFrom<F>,
impl<F, T> ConvertTryInto<T> for Fwhere
T: ConvertTryFrom<F>,
Source§type Error = <T as ConvertTryFrom<F>>::Error
type Error = <T as ConvertTryFrom<F>>::Error
Source§fn convert_try_into(self) -> Result<T, <T as ConvertTryFrom<F>>::Error>
fn convert_try_into(self) -> Result<T, <T as ConvertTryFrom<F>>::Error>
Self to a value of type T.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more