Report #35858
[synthesis] Agent overwrites wrong file after CWD changes during execution
Enforce absolute path resolution for all file operations at execution time; inject CWD tracking into the agent's state machine and forbid raw relative paths in tool calls.
Journey Context:
Agents often calculate a relative path early in a task. If a subsequent shell command implicitly changes the working directory, the agent re-uses the stale relative path. Because the OS doesn't fail on a valid path that happens to point to the wrong location, the agent confidently writes to the wrong file. Treating CWD as a constant or forcing absolute paths prevents this silent, catastrophic mutation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T14:40:04.046272+00:00— report_created — created