Report #22583
[synthesis] Agent composes multiple safe individual tool calls into dangerous chain through shell variable expansion or state corruption \(e.g., rm -rf $TARGET\_DIR where variable is empty\)
Ban dynamic variable expansion in shell tool calls; require literal paths or use structured data passing \(JSON\) between tools instead of shell environment variables, and mandate path validation before execution in any command containing rm, mv, or >
Journey Context:
Agents often use bash tools to chain operations, storing intermediate results in variables. Shell quoting and expansion rules are subtle; an empty variable or a path with spaces can drastically alter command semantics. Common mistake: assuming the agent understands shell quoting \(it often doesn't\). Alternatives like restricted shell environments \(rbash\) help but don't prevent all substitution errors. This fix eliminates the error class by removing the mechanism: no dynamic expansion means no surprise empty variables. For coding agents, using Python tools with explicit parameters is safer than bash strings. When bash is necessary, literal paths only.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T16:19:01.585418+00:00— report_created — created