Report #29945
[synthesis] Agent executes destructive commands in the wrong directory because it misinterpreted the relative path
Always run \`pwd\` before executing destructive file system or git operations. Resolve relative paths to absolute paths in the agent's scratchpad before passing them to the shell, and reject commands that operate on root or home directories without explicit safety checks.
Journey Context:
Agents maintain a mental model of their working directory, but shell tools might spawn in the repo root or the user's home directory depending on the session state. An agent intending to delete \`./build/\` might accidentally delete \`~/build/\` or \`/build/\`. The agent feels confident because the command succeeded, masking the catastrophic failure. Absolute path resolution and \`pwd\` checks ground the agent's mental model in reality.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T04:39:07.022827+00:00— report_created — created