AIToday
Large Language ModelsZenn AI/MLPublished: Nov 16, 2026, 04:00 JST

Codex read-only still read outside the workspace, developer adopts permission profiles

Send on LINE
Codex read-only still read outside the workspace, developer adopts permission profiles

3 Key Points

  1. What happened

    A developer found that Codex 0.164.0's read-only setting for automated PR reviews did not restrict where it could read, so they switched to permission profiles that deny the root and allow only git, python3, rg and the workspace.

  2. Why it matters

    With read-only, a reviewer could read files unrelated to the task, so limiting the allowed locations keeps the review scoped to the working folder and the tools it needs.

Not sure about something? Ask the AI

Questions and answers are published on this page.

Summaries like this, every morning.

Context & Analysis

The developer's earlier automated review used -s read-only, which only forbids writing and leaves reading unrestricted. The trigger for change came on the morning of November 8, when a review of another PR pointed out that read-only does not narrow where Codex reads. Testing with mock files placed outside the working folder—data not meant to be seen, a list of forbidden words, ssh keys, and .env—confirmed that read-only Codex could read all of them.

The replacement is a permission profile, a beta feature in Codex 0.164.0 on this Mac that sets read, write, or deny per location, with deny blocking both reading and writing. The profile closes the root entirely and opens only the minimum Codex needs, the command-line tools for git and python3, the location for rg, and the workspace, where .env is denied. The developer passes this table on each call via -c rather than editing the config file, and does not pass -s. They also add --disable view_image because the documentation did not state whether profile rules apply to built-in tools.

Three subtle points emerged. Passing -s causes the old sandbox setting to take precedence and the profile to be ignored without error, so the caller checks for that key before starting Codex. The log header still shows sandbox: read-only even when the profile is active, so a test with mock folders runs nightly and after Codex upgrades. And a workspace's .codex/config.toml is loaded for trusted repositories, so the developer refuses to run if .codex exists in the workspace. The nightly test verifies that mock files not meant to be seen and .env are unreadable, while workspace files and git remain readable.

FAQ
Why not just use a deny list for folders that should not be read?
With a deny list, a forgotten entry is read without any error. With an allow list, a forgotten entry makes the tool fail to start, so the mistake is noticed.
Does passing -s override the permission profile?
Yes. If -s or sandbox_mode is set, the older sandbox setting is used and default_permissions is ignored without an error.
Can the workspace's own config file weaken the protection?
Yes. In a trusted repository's worktree, Codex loads .codex/config.toml from the workspace, so a PR could include that file to remove the guard. The developer skips running when .codex exists in the workspace.
Send on LINE

AI news that matters for your work, delivered every morning.

Pick your industry and the AI tools you use, and get news related to your work every day.

Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →

Ask AI

Ask AI anything about this article. The AI reads this article, earlier AIToday articles, and Wikipedia, and cites its sources. Q&As are published on this page for other readers too.

Questions and answers are published on this page.

Related Articles

Next articleNikkei survey: New York's 50 AI startups tied closely to finance, medical