Skip to main content

wrap_stdio_command

Function wrap_stdio_command 

Source
pub fn wrap_stdio_command(
    command: Command,
    sandbox_policy: &SandboxPolicy,
) -> Result<Command>
Expand description

Apply the per-server sandbox wrapper to a stdio command.

This delegates to the same crate::sandboxing::SandboxManager used by command execution. Unsupported platforms, missing Linux helpers, external policies, workspace-write policies, and policies whose network rules cannot be enforced exactly all return an error. A workspace-write policy always carries a timeout (zero selects the default), which this command-only API cannot enforce without owning the child lifecycle.

stdio configuration is inherited by default — callers that need to redirect stdin/stdout/stderr should configure the returned command after this call.