Documentation
¶
Overview ¶
Package toolworker runs file tools in a fresh, per-call OS sandbox. The process running the agent is never sandboxed: credentials, model connections, history and the rewind journal stay in the parent. Only approved tool input, the workspace and the grant snapshot cross the process boundary.
Index ¶
Constants ¶
const Flag = "--tool-worker"
Variables ¶
This section is empty.
Functions ¶
func Serve ¶
Serve runs in the worker subprocess, exclusively. It consumes one request, creates a grant table in memory, executes a known file tool, then exits. The parent already passed the call through its three gates; these checks are a second layer, not a substitute for the parent gate or the OS sandbox.
Types ¶
type Request ¶
type Request struct {
Name string `json:"name"`
ID string `json:"id"`
Args json.RawMessage `json:"args"`
Root string `json:"root"`
ExtraRoots []string `json:"extraRoots,omitempty"`
Grants grants.Entries `json:"-"`
Rows []grantWire `json:"grants"`
ReadFile string `json:"readFile,omitempty"`
WriteFile string `json:"writeFile,omitempty"`
}
Request carries one approved call. No credential or persistent state path is transferred; the worker never opens grants.json. Exact grants are copied from the call context after the boundary gate has answered.
type Tool ¶
type Tool struct {
Original agentcore.AgentTool
Root string
ExtraRoots []string
Snap *agenttool.FileSnapshotRecorder
Runner seatbelt.CallRunner
Mode *permissions.State
// RequireIsolation, when set, refuses a call whose OS runner is missing
// instead of running the native tool in-process. Production sets it where
// isolation is the default; on a platform with no sandbox implementation it
// stays false so the tools keep working as they always did.
RequireIsolation bool
// Binary overrides the current executable (integration tests only).
Binary string
}
Tool decorates a built-in file tool without changing its public schema, scheduling mode or identity. Only builtin file tools are decorated; shell, network, session and in-memory tools use their own execution routes.
func (*Tool) Description ¶
func (*Tool) Execute ¶
func (t *Tool) Execute(ctx context.Context, id string, args json.RawMessage, _ agentcore.ToolUpdateFunc) (agentcore.AgentToolResult, error)
func (*Tool) ExecutionMode ¶
func (t *Tool) ExecutionMode() agentcore.ToolExecutionMode
func (*Tool) Schema ¶
func (t *Tool) Schema() json.RawMessage