--sandbox workspace-write fails with read-only mount in Azure DevOps Pipeline CI despite correct flags
What version of Codex CLI is running?
0.104.0
What subscription do you have?
OpenAI API (Pay-as-you-go)
Which model were you using?
gpt-5-codex
What platform is your computer?
Azure DevOps Pipeline (Ubuntu-latest agent)
What terminal emulator and version are you using (if applicable)?
Azure DevOps Pipeline bash shell (non-interactive CI environment)
What issue are you seeing?
Summary: --sandbox workspace-write --ask-for-approval never flags result in read-only workspace mount in CI environments, despite official documentation recommending this combination for automated/CI usage.
Blocked. The workspace is mounted read-only (`touch foo.txt` fails with Permission denied),
so I can't update files, create files, or create the required commit.
Once write access is restored, I can proceed with the implementation.
What steps can reproduce the bug?
Install Codex CLI in CI environment:npm install -g @openai/codex@0.104.0
Configure and login:
export OPENAI_API_KEY="sk-proj-..."
printf '%s' "$OPENAI_API_KEY" | codex login --with-api-key
Try official recommended flags for CI
echo "Create file test.txt with text 'hello'" | \
codex -C . --sandbox workspace-write --ask-for-approval never exec -m gpt-5-codex -
Expected: File created, no prompts
Actual: Codex says "workspace is mounted read-only", no file created
Try bypass flag:
echo "Create file test.txt with text 'hello'" | \
codex -C . --dangerously-bypass-approvals-and-sandbox exec -m gpt-5-codex -
File created successfully.
Only --dangerously-bypass flag works.
What is the expected behavior?
Expected behavior (per documentation):
--sandbox workspace-write should allow file modifications within workspace directory
--ask-for-approval never should disable approval prompts
This combination should work for CI/CD unattended operation
Additional information
_No response_
2 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Thanks for reporting the problem. It's not clear to me whether this is an issue with Codex or the environment.
This isn't a bug that we're likely going to be able to prioritize any time soon because it will require significant time to repro and is not affecting many users (you're the only one who has reported it so far). If you or other members of the Codex community would like to investigate or diagnose, you're welcome to do so. Let us know what you find.