Remove-Item fails with Full access while .NET deletion succeeds

Open
#35,903 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
40/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
powershell
Domain
desktop, security

Research direction

Reproduce this on Windows 11 in the Codex desktop app with Full access and no selected workspace, comparing PowerShell Remove-Item with the .NET Directory API for the same empty folder. Trace the normal deletion workflow and its workspace-permission decision; done means a narrowly scoped deletion uses the standard method safely without incorrectly reporting that it is blocked.

Written by the indexing model from the issue text.

Description

app bug sandbox tool-calls windows-os
What version of the Codex App are you using (From “About Codex” dialog)?

26.721.41059

What subscription do you have?

ChatGPT Plus

What platform is your computer?

Windows 11 x64 — Microsoft Windows NT 10.0.26200.0

What issue are you seeing?

With "Full access" enabled, Codex failed to delete an empty folder using PowerShell Remove-Item and reported that delete commands outside the active workspace were blocked, even though no project or workspace was selected.

I started a new chat without selecting a project or workspace and asked Codex to delete this empty folder:

C:\Users\AMD4x\Desktop\New folder

The initial deletion attempt using Remove-Item failed, and Codex responded:

"I couldn’t remove the folder because this environment blocks delete commands outside the active workspace."

In the same chat, I then asked Codex to delete the same folder using the .NET Directory API. The deletion succeeded.

This suggests inconsistent command handling with Full access enabled: the PowerShell Remove-Item attempt failed, while System.IO.Directory.Delete successfully deleted the same folder in the same session.

Codex showing Remove-Item failure followed by successful .NET Directory API deletion
What steps can reproduce the bug?
  1. Open the Codex desktop app on Windows.
  2. Start a new chat without selecting a project or workspace.
  3. Select "Full access" from the permissions control.
  4. Create an empty folder outside any selected workspace, for example:

C:\Users<username>\Desktop\CodexTestFolder

  1. Ask Codex to delete the folder without specifying a deletion method.
  2. Codex attempts the deletion using PowerShell Remove-Item, but the operation fails. It then reports that delete commands outside the active workspace are blocked, even though no workspace is selected.
  3. In the same chat, ask Codex to delete the same folder using the .NET Directory API.
  4. The .NET deletion succeeds.
  5. Confirm that "Full access" remains enabled throughout the test.
What is the expected behavior?

With "Full access" enabled and a clear, narrowly scoped deletion request, Codex should complete the operation through its normal deletion workflow without requiring the user to specify an alternative API.

If Remove-Item was restricted because the model previously performed overly broad or unsafe deletions, the preferred solution is to improve the model's deletion judgment and safeguards—such as validating the exact target, limiting the deletion scope, avoiding broad recursive patterns, and requesting confirmation when appropriate—then restore reliable use of the standard deletion method.

The successful .NET deletion demonstrates that the requested operation was permitted and technically possible. It should not result in restricting the .NET API as well; instead, Codex's default deletion behavior should be made both safe and functional.

Additional information

No response

Dominant language
Rust
Stars
125k
Forks
19.5k
Avg merge
1m
Merged PRs (30d)
1k

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openai/codex

All issues in openai/codex

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.