class

Autobot::Tools::SandboxExecutor

Inherits Reference < Object

Centralized sandbox executor - all file and command operations must go through this Prevents tools from bypassing sandboxing by using direct File.* operations

Usage: executor = SandboxExecutor.new(workspace) result = executor.read_file("test.txt") result = executor.exec("ls -la")

Constants

MAX_FILE_SIZE = 1048576

Constructors

new(workspace : Path | Nil, sandboxed : Bool = true, roots : Array(Path) = [] of Path)
Source

Instance methods

exec(command : String, timeout : Int32 = 60) : ToolResult
Source
exec_program(program : String, args : Array(String), timeout : Int32 = 60) : ToolResult
Source
list_dir(path : String) : ToolResult
Source
read_file(path : String) : ToolResult
Source
read_file_base64(path : String) : ToolResult

Read a file and return base64-encoded contents. Safe for binary files (images, GIFs, documents).

Source
roots
Source
sandboxed?
Source
write_file(path : String, content : String) : ToolResult
Source