class LittleGhost::Tools::Filesystem
Filesystem gives an agent read, list, write, and replace tools backed by the application’s Sandbox. A read-only sandbox automatically exposes only the non-mutating tools.
binding = LittleGhost::Tool::Binding.new(sandbox: sandbox) registry = LittleGhost::ToolRegistry.new( [LittleGhost::Tools::Filesystem], binding: binding ) registry.names # => ["read_file", "list_files"]
Security and trust
These tools do not add isolation. The configured sandbox must enforce path containment, permissions, size limits, and cancellation.
Public Class Methods
Source
# File lib/little_ghost/tools/filesystem.rb, line 96 def tools(binding) [*read_tools, *(write_tools if binding.sandbox.writable?)] end
Provides read tools for every sandbox and mutation tools only when the sandbox is writable.