You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[possible degradation] Directories are now not trusted by default even with the --dangerously-bypass-approvals-and-sandbox option. #14345
bugSomething isn't workingregressionBehaviors that worked in previous versions but were broken due to an updatesandboxIssues related to permissions or sandboxing
What terminal emulator and version are you using (if applicable)?
No response
What issue are you seeing?
I recently updated codex from v0.112.0 to v0.114.0.
Now, even with the --dangerously-bypass-approvals-and-sandbox option, I always see the confirmation prompt like below every time I run codex in a new directory:
> You are in /home/user/workdir/some_project
Do you trust the contents of this directory? Working with untrusted contents comes with higher risk of prompt
injection.
› 1. Yes, continue
2. No, quit
This is annoying because of three reasons:
I just don't want the prompt. That defeats the purpose of using the --dangerously-bypass-approvals-and-sandbox option.
I use codex in a Docker container. For extra safety, I mount config.toml readonly to the container. So, even if I select 1 in the prompt above, the selection is not recorded.
I test a one-off script very often (e.g. 15 times a day). Every time I do that, I create a new temporary directory with a random name (e.g. mkdir ~/my_playground/${RANDOM}). So registering every possible directories to the trust directories list in advance is not feasible.
What steps can reproduce the bug?
Create a new directory.
cd to the directory.
Run codex --dangerously-bypass-approvals-and-sandbox.
What is the expected behavior?
It should trust any directory by default as before.
Or, at least there should be both of these:
another option to trust all directories by default (e.g. --dangerously-trust-any-directories)
breaking change notice / migration guide in the release note
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
* [Harness Misclassifying Commands? Yolo not yoloing #13663](https://github.com/openai/codex/issues/13663)
* [CLI TUI /approvals override not persisted across thread switch (reverts to Default after returning from sub-agent) #13119](https://github.com/openai/codex/issues/13119)
A similar issue occurs on Windows. In v0.112.0, running codex --sandbox workspace-write does not trigger a confirmation prompt. However, v0.113.0 and v0.114.0 do.
Same thing here, this is annoying for me because I use a Worker to create new projects and automatically open the folder in the Codex CLI, but now it's blocked by this stupid security message, requiring me to keep pressing enter.
Same for me as well, this is very annoying as I don't want my config.toml to be littered with trusted directories when I explicitly am running --yolo. I filed a duplicate of this issue #14547 before finding this issue, and having same problem as I use codex within a remote server and don't want to trust every folder. At the very least if this is needed, add a wildcard option in config.toml so all folders on the system can be trusted or just allow --yolo to overwrite the prompt as was before v0.113.0
Also, you can check whether it’s possible to start the sandbox with a read-only root filesystem:
Just run bwrap --ro-bind / / true. If it succeeds (zero exit code), everything is fine.
Reacted by milanglacier, Johnathan Silva, Zasda Yusuf Mikail, Limbo Peng and TSAO
Is there any plan to resolve this, or is there another solution to stop config pollution for trusted folders? Potentially just having a home folder trusted folder set for everything? It's becoming pretty frustrating having to deal with this.
Reacted by Mayurifag, Philipp Schmitt, Zasda Yusuf Mikail, Evgenii Gorchakov, Tom Lienard, TSAO, Savvy Raghuvanshi and 毒液哥
diff --git a/codex-rs/tui/src/lib.rs b/codex-rs/tui/src/lib.rs
index 2904306..0c16686 100644
--- a/codex-rs/tui/src/lib.rs+++ b/codex-rs/tui/src/lib.rs@@ -1379,8 +1379,11 @@ async fn run_ratatui_app(
}
let mut app_server = Some(app_server_session);
- let should_show_trust_screen_flag =- !uses_remote_workspace && should_show_trust_screen(&initial_config);+ // The bypass flag pins both sandbox and approval policy, so the trust+ // decision cannot affect this session.+ let should_show_trust_screen_flag = !uses_remote_workspace+ && !cli.dangerously_bypass_approvals_and_sandbox+ && should_show_trust_screen(&initial_config);
#[cfg(target_os = "windows")]
let mut trust_decision_was_made = false;
let login_status = if initial_config.model_provider.requires_openai_auth {
Still reproduces on codex-cli 0.145.0 (macOS arm64). Adding a downstream consequence that may raise the priority here, since it turns the prompt from an annoyance into silent data loss.
When Codex is launched by an agent orchestrator rather than a human, the trust prompt is not merely blocking — it consumes the work.
My orchestrator delivers a task by writing the prompt text into the terminal, terminated by Enter. If Codex happens to be sitting on the trust screen, the default cursor is already on "Yes, continue", so:
The injected Enter answers the trust prompt.
The directory is added to config.toml with trust_level = "trusted" — nobody was asked, and no human saw the screen.
The task text itself is swallowed by the prompt and never reaches Codex.
Codex lands at a normal idle prompt having received no work, so it emits no error and exits nothing.
The orchestrator sees a successful delivery and waits for a completion that will never arrive. I verified the config entry appearing with an mtime matching the moment of delivery.
The practical damage: a weekday scheduled job on this machine accumulated 11 orphan codex processes over six days, every one of them idle at 0% CPU parked on that screen. Each daily run started a process, had its task eaten, and never terminated.
--dangerously-bypass-approvals-and-sandbox was passed on every one of those launches.
Two things follow from a security standpoint, which I think matter more than the ergonomics:
The prompt is answerable by anything that can write to the TTY. As a defence against prompt injection from untrusted repo contents it is weak, because whatever is driving the terminal answers it by default. A prompt whose default is "yes" and which any keystroke satisfies is close to no gate at all in automated contexts.
Passing --dangerously-bypass-approvals-and-sandbox and then still showing the screen is worse than either alternative. The operator has already made and recorded an explicit trust decision on the command line. Showing the prompt anyway does not add a decision point; it just relocates it to whatever writes the next byte.
So the request in the title stands, with the emphasis that honouring the flag is not only a convenience fix — the current behaviour launders an automated keystroke into a recorded trust grant.
If it helps, the failure is trivially reproducible headlessly: launch codex --dangerously-bypass-approvals-and-sandbox in a directory with no [projects."<path>"] entry, write any text plus a newline to its TTY, then check config.toml for a new trusted entry and observe that the text was never processed as a prompt.
We've decided to make all directories trusted by default unless you are using :read-only permissions. This makes the CLI consistent with the desktop app's behavior.
Reacted by Stefano Fusai, Arvin Mirtorabi and Johnathan Silva
We've decided to make all directories trusted by default unless you are using :read-only permissions. This makes the CLI consistent with the desktop app's behavior.
I see that PR #36960 recently landed on v0.147.0 that explicitly says that: "Prompt before trusting local project directories" what do you mean? Did OpenAI team revoked this decision and decided that projects should still be untrusted by default?
If so, should this issue be reopened as it is not solved.
If manual confirmation is expected, can we move the [project.xxxx.trusted] entries to state.toml rather than spamming config.toml to prevent config pollution. People relies on dotfiles syncs (nix, chezmoi, GNU Stow, or just home-mode symlink shell-script) cannot sync codex's config.toml reliable because it is polluted with those states rather than actual configuration.
This is also claude code's behavior. User set configuration is stored under ~/.claude/settings.json so that is dotfiles manageable, and the state (like trusted projects) are stored under ~/.claude.json.
Reacted by Sam Estep, Aliaksandr Samatyia, Mayurifag, Tomoaki Kawada, Xuanbo Cheng and Casey Link
bugSomething isn't workingregressionBehaviors that worked in previous versions but were broken due to an updatesandboxIssues related to permissions or sandboxing
Activity
github-actions commentedon Mar 11, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
your-diary commentedon Mar 11, 2026
No, they are different from my problem.
Techie5879 commentedon Mar 11, 2026
I've had instances of the latest models typoing quite a bit when doing doing the grep/glob tool calls. GPT 5.4 high.
PillarsZhang commentedon Mar 12, 2026
A similar issue occurs on Windows. In v0.112.0, running
codex --sandbox workspace-writedoes not trigger a confirmation prompt. However, v0.113.0 and v0.114.0 do.iwinux commentedon Mar 12, 2026
Same here after upgrading from v0.112 to codex-cli 0.114
Config:
your-diary commentedon Mar 12, 2026
My current workaround is this (simplified):
I don't want to do things like this though.
iwinux commentedon Mar 12, 2026
This is extremely annoying on macOS because of the stupid Homebrew design:
johnslva commentedon Mar 12, 2026
Same thing here, this is annoying for me because I use a Worker to create new projects and automatically open the folder in the Codex CLI, but now it's blocked by this stupid security message, requiring me to keep pressing enter.
arvinmi commentedon Mar 13, 2026
Same for me as well, this is very annoying as I don't want my config.toml to be littered with trusted directories when I explicitly am running
--yolo. I filed a duplicate of this issue #14547 before finding this issue, and having same problem as I use codex within a remote server and don't want to trust every folder. At the very least if this is needed, add a wildcard option in config.toml so all folders on the system can be trusted or just allow--yoloto overwrite the prompt as was beforev0.113.0milanglacier commentedon Mar 16, 2026
Any update on this? This is a serious regression. Please try to fix it ASAP.
2 remaining items
vsevolod commentedon Apr 2, 2026
Proper configuration that allows working on the project without interruptions for changing each file.
Also, you can check whether it’s possible to start the sandbox with a read-only root filesystem:
Just run
bwrap --ro-bind / / true. If it succeeds (zero exit code), everything is fine.iwinux commentedon Apr 7, 2026
I have been forced to use Codex CLI v0.112 for weeks because of this annoying bug.
codexcli: pre-trust workingDir in ~/.codex/config.toml (issue #14345)
arvinmi commentedon Jun 14, 2026
Is there any plan to resolve this, or is there another solution to stop config pollution for trusted folders? Potentially just having a home folder trusted folder set for everything? It's becoming pretty frustrating having to deal with this.
csrutil commentedon Jul 2, 2026
Are there any plans to address this issue? It’s been quite annoying for a long time.
csrutil commentedon Jul 2, 2026
Here’s a workaround I’m using to fix the issue:
feat: trust preseed + starter dir + login framing
lalagogo2012 commentedon Jul 26, 2026
Still reproduces on codex-cli 0.145.0 (macOS arm64). Adding a downstream consequence that may raise the priority here, since it turns the prompt from an annoyance into silent data loss.
When Codex is launched by an agent orchestrator rather than a human, the trust prompt is not merely blocking — it consumes the work.
My orchestrator delivers a task by writing the prompt text into the terminal, terminated by Enter. If Codex happens to be sitting on the trust screen, the default cursor is already on "Yes, continue", so:
config.tomlwithtrust_level = "trusted"— nobody was asked, and no human saw the screen.The orchestrator sees a successful delivery and waits for a completion that will never arrive. I verified the config entry appearing with an mtime matching the moment of delivery.
The practical damage: a weekday scheduled job on this machine accumulated 11 orphan
codexprocesses over six days, every one of them idle at 0% CPU parked on that screen. Each daily run started a process, had its task eaten, and never terminated.--dangerously-bypass-approvals-and-sandboxwas passed on every one of those launches.Two things follow from a security standpoint, which I think matter more than the ergonomics:
--dangerously-bypass-approvals-and-sandboxand then still showing the screen is worse than either alternative. The operator has already made and recorded an explicit trust decision on the command line. Showing the prompt anyway does not add a decision point; it just relocates it to whatever writes the next byte.So the request in the title stands, with the emphasis that honouring the flag is not only a convenience fix — the current behaviour launders an automated keystroke into a recorded trust grant.
If it helps, the failure is trivially reproducible headlessly: launch
codex --dangerously-bypass-approvals-and-sandboxin a directory with no[projects."<path>"]entry, write any text plus a newline to its TTY, then checkconfig.tomlfor a new trusted entry and observe that the text was never processed as a prompt.fix(configs): fish trust codex-cli projects per invocation
etraut-openai commentedon Aug 4, 2026
We've decided to make all directories trusted by default unless you are using :read-only permissions. This makes the CLI consistent with the desktop app's behavior.
milanglacier commentedon Aug 8, 2026
I see that PR #36960 recently landed on v0.147.0 that explicitly says that: "Prompt before trusting local project directories" what do you mean? Did OpenAI team revoked this decision and decided that projects should still be untrusted by default?
If so, should this issue be reopened as it is not solved.
etraut-openai commentedon Aug 8, 2026
Yes, after additional internal discussion, we decided to revisit this decision for security reasons. More discussion is needed. Reopening.
milanglacier commentedon Aug 8, 2026
This is also related to: #14601
If manual confirmation is expected, can we move the [project.xxxx.trusted] entries to
state.tomlrather than spammingconfig.tomlto prevent config pollution. People relies on dotfiles syncs (nix, chezmoi, GNU Stow, or just home-mode symlink shell-script) cannot sync codex's config.toml reliable because it is polluted with those states rather than actual configuration.This is also claude code's behavior. User set configuration is stored under
~/.claude/settings.jsonso that is dotfiles manageable, and the state (like trusted projects) are stored under~/.claude.json.