shell tool lets the agent execute shell commands on the host system. Because shell access is powerful, IronClaw applies two layers of protection before any command runs: environment scrubbing and command injection detection.
Configuration
shell tool is not registered and is invisible to the LLM.
Environment Scrubbing
Before executing any command, the shell tool builds a sanitized environment. Sensitive variables are removed entirely — they are never present in the process environment when the command runs. Variables that are scrubbed:
Variables that are preserved:
Why this matters: Without scrubbing, a command like
env or printenv — or a compromised binary on PATH — could dump all environment variables, including API keys, to stdout. The shell tool prevents this by ensuring secrets are never in the environment to begin with.
Command Injection Detection
The sanitizer analyzes every command before execution and blocks patterns commonly used in injection attacks.Blocked Patterns
Blocked Examples
Allowed Examples
Pipe (
|) within a single command is allowed because it does not chain independent commands — it passes stdout of one program to stdin of another within the same execution context.Output Sanitization
Shell output passes through the Safety Layer before reaching the LLM:- Leak detector — Scans for secret patterns in stdout/stderr. If output contains something that looks like an API key or token, it is redacted.
- Sanitizer — Escapes control characters and other dangerous content.
Security Considerations
Use the Docker sandbox for untrusted work
Use the Docker sandbox for untrusted work
When a job involves running code or scripts that you didn’t write, use the Docker sandbox instead. Jobs dispatched to the sandbox run in an isolated container with a non-root user, dropped capabilities, and network controlled by the proxy. The shell tool runs directly on the host with your user’s permissions.
Shell escaping vs injection detection
Shell escaping vs injection detection
The injection detector operates on the command string before execution. It is not a replacement for proper shell escaping — do not rely on it as the sole guard when constructing commands from user-supplied data. The sanitizer provides defense-in-depth, not a guarantee.
Timeout enforcement
Timeout enforcement
Commands that exceed
timeout_secs are killed. The default is 30 seconds. For long-running tasks, either increase the timeout or consider using a background job instead.