Codex inserted unrelated and potentially state-changing commands during read-only tasks
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
What version of Codex CLI is running?
0.150.1
What subscription do you have?
ChatGPT Plus
Which model were you using?
GPT-5.6 Sol
What platform is your computer?
Linux 6.18.33.2-microsoft-standard-WSL2 x86_64 unknown
What terminal emulator and version are you using (if applicable)?
VS Code integrated terminal (Remote - WSL2)
Codex doctor report
What issue are you seeing?
I encountered two unrelated command-generation anomalies during the same Codex session.
In the first incident, Codex inserted an unrelated personal-looking name into a read-only Git command. The inserted text had no relationship to the task or prompt and caused the Git command to fail.
In the second incident, during another explicitly READ-ONLY Git verification, Codex unexpectedly inserted a filesystem move command:
mv /tmp/x /tmp/y
This command was completely unrelated to the requested task and directly contradicted the instruction that no files were to be modified.
The move failed because the source path did not exist, so no filesystem modification occurred. However, this is concerning because the generated command could potentially have caused a state-changing operation if the referenced path had existed.
Subsequent verification confirmed that the repository and working tree remained unchanged.
Both incidents occurred in the same Codex session.
Environment:
Windows 11 host with WSL2
Codex CLI 0.150.1
GPT-5.6 Sol
VS Code integrated terminal (Remote - WSL2)
Expected behavior:
When Codex is explicitly instructed to perform only read-only commands, generated tool commands should contain only operations necessary for that task. Unrelated text or state-changing commands must not be introduced.
No proprietary source code, repository details, credentials, database information, or project-specific data are included in this report.
Feedback thread ID:
01a085cf-0121-7730-8eec-8ad39aae9ba2
What steps can reproduce the bug?
Uploaded thread: 01a085cf-0121-7730-8eec-8ad39aae9ba2
What is the expected behavior?
When a task is explicitly restricted to read-only operations, Codex should generate only commands required for those read-only checks.
It must not introduce unrelated text, arbitrary paths, or state-changing filesystem commands that were not requested or authorized.
In particular, an explicitly READ-ONLY task should never unexpectedly introduce commands such as mv, rm, or other filesystem mutations.
Additional information
Both anomalies occurred during the same Codex session.
No filesystem modification occurred because the unexpected mv command failed before changing anything. Subsequent verification confirmed that the repository and working tree remained unchanged.
I intentionally did not upload session logs because the session involved a private proprietary project. No proprietary source code, repository paths, credentials, database information, or other project-specific data are included in this report.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is named. Start by reviewing feedback thread 01a085cf-0121-7730-8eec-8ad39aae9ba2 and the Codex CLI command-generation behavior described there; done means read-only tasks produce only necessary read-only commands and never introduce unrelated or state-changing operations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- ai-infra-agents, cli, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100