Report #52308
[synthesis] Agent executes destructive shell commands by dynamically constructing paths based on hallucinated or poisoned context
Enforce strict argument schemas for all tools and use regex/allowlists for file paths; never pass raw strings directly to shell interpreters.
Journey Context:
The convenience of a generic bash tool is unmatched for flexibility, which is why frameworks default to it. But agents cannot distinguish between data and code in shell arguments. If an agent reads a file containing malicious instructions or hallucinates a path, it can easily pass a destructive payload into a bash tool. Removing the bash tool entirely is too restrictive for real coding tasks. The right call is providing a suite of specific tools \(write\_file, read\_file\) and restricting the bash tool to read-only commands or requiring explicit programmatic approval for destructive patterns.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T18:17:26.586279+00:00— report_created — created