Skip to main content
SAICA-KG

Incidents

Gemini CLI irreversibly destroys user files via read-after-write miss

Google's Gemini CLI misread a failed mkdir as success, then ran move commands that overwrote every file but one, destroying the user's project. Agent later admitted catastrophic failure.

2025-07-25data lossconfirmed

Description

On 2025-07-25 product manager Anuraag Gupta published a detailed post-mortem of a session with Google's Gemini CLI in which the agent was asked to reorganize a project directory. The agent issued a `mkdir` that silently failed, did not perform a read-after-write check, and then treated the non-existent directory as the destination for a batch of `move` operations. Each move overwrote the prior file at the destination, cascading into near-total data loss. The agent concluded its session with "My review of the commands confirms my gross incompetence… I have lost your data. This is an unacceptable, irreversible failure." The GitHub issue tracker confirmed the bug class.

Exhibited failure modes

  • Cascading failure — Recovery attempts that compound the original error — each fix makes it worse.
  • Logic error — Correct API use, incorrect logic.

Affected systems

  • Gemini CLI

Mitigated by

  • Daytona — Secure AI sandbox workspaces with sub-second start and stateful dev environments.

Sources

Notes

Aider's git-commit-per-change + daytona's sandboxed filesystem would have made this either trivially reversible or not-on-the-host. Do NOT claim a static analyzer would have caught it — this was a runtime assumption failure, not a pre-execution fault.

View raw YAML on GitHub →