Tool Name
exec
Description
Execute a shell command and return its output. Use with caution.Parameters
The shell command to execute
Optional working directory for the command. If not provided, uses the tool’s configured working directory or current working directory.
Return Value
Returns a string containing:- Standard output (stdout)
- Standard error (stderr) prefixed with “STDERR:”
- Exit code (if non-zero)
- Error messages for timeouts or blocked commands
Configuration
The ExecTool can be configured with the following options:Safety Guards
The tool includes built-in safety patterns that block dangerous commands:rm -rf,rm -fr- Recursive file deletiondel /f,del /q- Windows file deletionrmdir /s- Windows directory removalformat,mkfs,diskpart- Disk formattingdd if=- Disk operationsshutdown,reboot,poweroff- System power commands- Fork bombs and similar patterns
Examples
Basic Command Execution
Command with Working Directory
Command with Error Output
Blocked Command
Command Timeout
Implementation
Seenanobot/agent/tools/shell.py:12 for the full implementation.
Related
- Filesystem Tools - For file operations without shell execution
- Configuration - Setting up tool restrictions