pub struct NetworkDenyToolExecutor { /* private fields */ }Expand description
Blocks network-egress tool calls for a single sub-agent spawn.
Wraps an ErasedToolExecutor and rejects two classes of call with
ToolError::Blocked:
- Any call to a network-only tool (
web_scrape,fetch,web_search) — blocked unconditionally, since these tools have no non-network purpose. bashtool calls whose command matcheszeph_tools::NETWORK_COMMANDS(curl,wget,nc/ncat/netcat,ssh/scp/rsync,openssl s_client,socat,python3 -c/python -c/perl -e/ruby -eone-liners, and the/dev/tcp//dev/udpbash pseudo-devices).
All other tool calls pass through unchanged. Known gaps: MCP-provided tools (which may
perform their own HTTP egress) are not inspected — see specs/069-threat-model/spec.md
INVARIANT-5. The bash command match is a name/prefix blocklist (see
zeph_tools::NETWORK_COMMANDS doc for its own residual gaps — flag insertion before
-c/-e, versioned/alternate interpreter names, non-transparent wrapper commands like
busybox) — this is a best-effort, tool/command-identity block, not a sandbox boundary.
Installed by build_filtered_executor (crate::manager::spawn) when the spawning
task carries NetworkScope::Deny (spec 069-threat-model OQ-1). Unlike mutating
ShellConfig’s allow_network field directly, this
wrapper scopes the restriction to a single spawn without affecting the shared
tool_executor used by the parent agent and sibling tasks.
Implementations§
Source§impl NetworkDenyToolExecutor
impl NetworkDenyToolExecutor
Sourcepub fn new(inner: Arc<dyn ErasedToolExecutor>) -> Self
pub fn new(inner: Arc<dyn ErasedToolExecutor>) -> Self
Wrap inner, blocking network-egress tool calls for every call.
Trait Implementations§
Source§impl ErasedToolExecutor for NetworkDenyToolExecutor
impl ErasedToolExecutor for NetworkDenyToolExecutor
fn execute_erased<'a>( &'a self, response: &'a str, ) -> Pin<Box<dyn Future<Output = Result<Option<ToolOutput>, ToolError>> + Send + 'a>>
fn execute_confirmed_erased<'a>( &'a self, response: &'a str, ) -> Pin<Box<dyn Future<Output = Result<Option<ToolOutput>, ToolError>> + Send + 'a>>
fn tool_definitions_erased(&self) -> Vec<ToolDef>
fn execute_tool_call_erased<'a>( &'a self, call: &'a ToolCall, ) -> Pin<Box<dyn Future<Output = Result<Option<ToolOutput>, ToolError>> + Send + 'a>>
Source§fn execute_tool_call_confirmed_erased<'a>(
&'a self,
call: &'a ToolCall,
) -> Pin<Box<dyn Future<Output = Result<Option<ToolOutput>, ToolError>> + Send + 'a>>
fn execute_tool_call_confirmed_erased<'a>( &'a self, call: &'a ToolCall, ) -> Pin<Box<dyn Future<Output = Result<Option<ToolOutput>, ToolError>> + Send + 'a>>
ToolExecutor::execute_tool_call_confirmed reach it through the blanket impl below.
Other implementors should fall back to
execute_tool_call_erased (normal
enforcement path) unless they need to replicate confirmed-path-specific behavior
(e.g. a fallback that only applies on the unconfirmed path must be mirrored
explicitly, not assumed). See
erased_tool_executor_no_inner_defaults!
for leaf executors with no wrapped inner.Source§fn set_skill_env(&self, env: Option<HashMap<String, String>>)
fn set_skill_env(&self, env: Option<HashMap<String, String>>)
Source§fn set_effective_trust(&self, level: SkillTrustLevel)
fn set_effective_trust(&self, level: SkillTrustLevel)
Source§fn is_tool_retryable_erased(&self, tool_id: &str) -> bool
fn is_tool_retryable_erased(&self, tool_id: &str) -> bool
Source§fn requires_confirmation_erased(&self, call: &ToolCall) -> bool
fn requires_confirmation_erased(&self, call: &ToolCall) -> bool
Source§fn checkpoint_undo_erased(&self, n: usize) -> CheckpointActionResult
fn checkpoint_undo_erased(&self, n: usize) -> CheckpointActionResult
n checkpointed write commands. Read moreSource§fn checkpoint_redo_erased(&self) -> CheckpointActionResult
fn checkpoint_redo_erased(&self) -> CheckpointActionResult
Source§fn checkpoint_list_erased(&self) -> CheckpointListResult
fn checkpoint_list_erased(&self) -> CheckpointListResult
Auto Trait Implementations§
impl !RefUnwindSafe for NetworkDenyToolExecutor
impl !UnwindSafe for NetworkDenyToolExecutor
impl Freeze for NetworkDenyToolExecutor
impl Send for NetworkDenyToolExecutor
impl Sync for NetworkDenyToolExecutor
impl Unpin for NetworkDenyToolExecutor
impl UnsafeUnpin for NetworkDenyToolExecutor
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> 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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request