Agentic.Sandbox.Runner (agentic v0.2.2)

Copy Markdown

Cross-platform sandbox wrapper for agent subprocesses.

Provides a single entry point that selects the correct OS-level isolation mechanism based on Agentic.Sandbox.Platform.backend/0.

Supports two invocation styles:

Summary

Functions

Wraps an executable path and argument list in the platform-appropriate sandbox.

Wraps a shell command string in the platform-appropriate sandbox.

Functions

wrap_executable(executable, args, opts \\ [])

@spec wrap_executable(String.t(), [String.t()], keyword()) ::
  {String.t(), [String.t()], keyword()}

Wraps an executable path and argument list in the platform-appropriate sandbox.

Returns {executable, args, extra_env} suitable for Port.open({:spawn_executable, executable}, [:binary, :exit_status, {:args, args} | extra_env]).

wrap_shell(command, opts \\ [])

@spec wrap_shell(
  String.t(),
  keyword()
) :: String.t()

Wraps a shell command string in the platform-appropriate sandbox.

Returns a string that can be passed to Port.open({:spawn, command}, ...).