Back to Eliza

Shell Plugin

packages/docs/plugin-registry/shell.md

2.0.12.5 KB
Original Source

The Shell plugin gives Eliza agents direct access to the system shell, allowing them to execute arbitrary commands. USE AT YOUR OWN RISK. THIS GIVES AI FULL ACCESS TO THE SYSTEM SHELL.

Package: @elizaos/plugin-shell (core plugin — always loaded)

Overview

This plugin exposes shell command execution to agents, enabling them to run system commands, scripts, and tools directly. It includes a configurable security model with command whitelists, blacklists, timeouts, and output size limits. Despite these controls, granting shell access to an AI agent carries inherent risk and should be configured carefully.

Installation

This plugin is a core plugin and is always loaded. No manual installation is required.

Auto-Enable

The plugin auto-enables when the SHELL_ALLOWED_COMMANDS environment variable is set, defining which commands the agent is permitted to run.

Configuration

ParameterTypeRequiredDescription
SHELL_ALLOWED_COMMANDSstringNoComma-separated whitelist of allowed commands
SHELL_TIMEOUT_MSstringNoMaximum execution time in milliseconds
SHELL_MAX_OUTPUT_SIZEstringNoMaximum output size in bytes
SHELL_WORKING_DIRstringNoDefault working directory
SHELL_ENABLE_DANGEROUSbooleanNoEnable dangerous commands (rm -rf, etc.)
SHELL_LOG_COMMANDSbooleanNoLog all executed commands
SHELL_BLOCKED_COMMANDSstringNoComma-separated blacklist of blocked commands

Example configuration via environment variables:

bash
export SHELL_ALLOWED_COMMANDS="ls,cat,grep,find,git"
export SHELL_TIMEOUT_MS="10000"
export SHELL_MAX_OUTPUT_SIZE="1048576"
export SHELL_WORKING_DIR="/home/user/project"
export SHELL_LOG_COMMANDS=true

Security

  • Whitelist preferred over blacklist. Use SHELL_ALLOWED_COMMANDS to restrict the agent to a known-safe set of commands rather than relying solely on SHELL_BLOCKED_COMMANDS.
  • Never enable SHELL_ENABLE_DANGEROUS in production. This flag permits destructive commands like rm -rf.
  • Set timeouts and output limits to prevent runaway processes and excessive memory usage.
  • Enable command logging (SHELL_LOG_COMMANDS=true) for auditability.