Report #85810
[synthesis] Agent executes destructive shell command with empty variables \(e.g., rm -rf / instead of rm -rf /var/log/\) due to failed extraction
Implement a pre-execution guard in the tool wrapper that rejects any command containing empty or unbound variables, and never allow recursive/delete commands on root-like paths without explicit hardcoded path prefixes.
Journey Context:
Agents often use regex or JSON extraction to get a path or ID. If the extraction fails, the variable is empty. If the tool command is rm -rf \{target\_path\} and target\_path is empty, the shell executes rm -rf. The agent sees command executed successfully while the filesystem is destroyed. The synthesis is that string interpolation in tool commands is inherently unsafe with LLM-generated variables. The fix requires treating LLM outputs as untrusted user input and applying standard shell injection safety \(like set -u or explicit null checks\) at the tool boundary.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T02:37:09.477208+00:00— report_created — created