Agentic. Sandbox. Runner
(agentic v0.4.0)
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:
wrap_shell/2— for arbitrary shell commands (e.g. thebashtool)wrap_executable/3— for executable + argument list (e.g. coding agents)
Summary
Functions
Extra sandbox-bind roots required by script shims, scanned statically.
Wraps an executable path and argument list in the platform-appropriate sandbox.
Wraps a shell command string in the platform-appropriate sandbox.
Functions
Extra sandbox-bind roots required by script shims, scanned statically.
A shim like /usr/sbin/claude is a shebang shell script whose body execs
the real binary (e.g. /opt/claude-code/bin/claude). The symlink chain can
never see that target, so benchmarks installed under tool prefixes like
/opt/… vanish inside the sandbox and the CLI dies instantly with
"No such file or directory". We scan the script text for absolute paths and
return each path's first two components (e.g. /opt/claude-code) so the
caller can --ro-bind-try them.
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]).
Wraps a shell command string in the platform-appropriate sandbox.
Returns a string that can be passed to Port.open({:spawn, command}, ...).