---
title: "GPT-5.6 Codex Critical Bug: Unexpected File Deletion in Full Access Mode"
source: "Simon Willison 博客（Atom）"
source_tier: "t2"
url: "https://simonwillison.net/2026/Jul/16/bad-codex-bug/#atom-everything"
permalink: "https://feed.astralor.com/items/itm_0474f9c399b0290d16c691a5"
published: "2026-07-16T17:45:59.000Z"
score: 71
channel: "ai"
tags: ["Codex","GPT-5.6","OpenAI","Coding Agent Security"]
---

# GPT-5.6 Codex Critical Bug: Unexpected File Deletion in Full Access Mode

## AI commentary

> This is one of the most disruptive AI coding agent bugs disclosed so far, directly threatening user file safety. All developers using AI-assisted coding tools should immediately check their safeguard settings and never run in full access mode without sandboxing.

## At a glance

According to a report cited by Simon Willison's blog from Thibault Sottiaux, GPT-5.6's Codex tool can unexpectedly delete user files when full access mode is enabled without sandboxing protections, due to the model mistakenly overriding the $HOME environment variable. The bug highlights the security risks of AI coding agents, especially without auto review enabled. OpenAI's internal investigation found this is the most common scenario, and developers are advised to immediately review their Codex configuration and enable sandboxing and auto review to prevent data loss.

## Key points

- In full access mode, Codex running without sandbox protection can cause file deletion.
- The model attempts to override the $HOME env var and mistakenly deletes $HOME.
- The bug most commonly occurs when auto review is disabled; users should enable sandboxing or review.

## Full text

On file deletions. We’ve investigated a handful of reports where GPT-5.6 unexpectedly deleted files. What we have found is that this most commonly occurs when: Full access mode is enabled and codex is run without sandboxing protections, including without auto review being enabled The model attempts to override the $HOME env var to define a temporary directory. The model makes an honest mistake and mistakenly deletes $HOME instead. — Thibault Sottiaux, describing a pretty gnarly Codex bug Tags: codex, coding-agents, generative-ai, ai, llms

---

Verify against the original before citing; curated by Astral Feed: https://feed.astralor.com/items/itm_0474f9c399b0290d16c691a5
