Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Shell Tool

Executes shell commands in a controlled environment with optional command allowlisting and sandboxing.

Details

IDnexus.tool.shell
Tool Nameshell
DependenciesNone

Configuration

KeyTypeDefaultDescription
working_dirstring(session files dir)Working directory for executions.
timeoutduration30sMaximum execution time per command.
sandbox.backendstringhostSandbox tier (host; future: gvisor, firecracker, landlock).
sandbox.allowed_commandsstring[](none — all allowed)Whitelist of base command names.
sandbox.path_dirsstring[](none)Directories prepended to PATH.
sandbox.env_restrictboolfalseStrip sensitive env vars before execution.
sandbox.timeoutduration30sPer-command default; top-level timeout wins per-call.

Tool Parameters

ParameterTypeRequiredDescription
commandstringYesThe shell command to execute

Events

Subscribes To

EventPriorityPurpose
tool.invoke50Handles shell command execution

Emits

EventWhen
tool.resultCommand output (stdout + stderr)
tool.registerRegisters the shell tool at boot
core.errorExecution errors

Security Features

Command Allowlist

When sandbox.allowed_commands is set, only commands whose base name matches the list are permitted:

nexus.tool.shell:
  sandbox:
    allowed_commands: ["ls", "cat", "grep", "find", "git", "make"]

Attempting to run a command not in the list returns an error to the agent.

Sandbox Environment Restriction

When sandbox.env_restrict: true, sensitive environment variables (AWS, Google, Azure, Anthropic API keys) are stripped before command execution.

Command History

All executed commands are logged to plugins/nexus.tool.shell/history.txt in the session directory.

Example Configurations

Minimal (full access)

nexus.tool.shell:
  timeout: 30s

Coding assistant

nexus.tool.shell:
  timeout: 30s
  sandbox:
    allowed_commands: ["go", "git", "ls", "cat", "grep", "find", "mkdir", "rm", "cp", "mv", "make", "docker", "npm", "cargo", "python"]
    env_restrict: true

Read-only exploration

nexus.tool.shell:
  timeout: 10s
  sandbox:
    allowed_commands: ["ls", "cat", "grep", "find", "head", "tail", "wc"]
    env_restrict: true