[possible degradation] Directories are now not trusted by default even with the `--dangerously-bypass-approvals-and-sandbox` option.

Open 💬 16 comments Opened Mar 11, 2026 by your-diary
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex CLI is running?

codex-cli 0.114.0

What subscription do you have?

ChatGPT

Which model were you using?

_No response_

What platform is your computer?

_No response_

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?

  1. Create a new directory.
  1. cd to the directory.
  1. 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

Additional information

Possible cause:

View original on GitHub ↗

16 Comments

github-actions[bot] contributor · 4 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #13663
  • #13119

Powered by Codex Action

your-diary · 4 months ago
Potential duplicates detected. Please review them and close your issue if it is a duplicate. Harness Misclassifying Commands? Yolo not yoloing #13663 CLI TUI /approvals override not persisted across thread switch (reverts to Default after returning from sub-agent) #13119 _Powered by Codex Action_

No, they are different from my problem.

Techie5879 · 4 months ago

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 · 4 months ago

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.

iwinux · 4 months ago

Same here after upgrading from v0.112 to codex-cli 0.114

Config:

profile = 'default'
personality = 'none'
model = 'gpt-5.3-codex'
model_reasoning_effort = 'high'
plan_mode_reasoning_effort = 'high'

approval_policy = 'on-request'
sandbox_mode = 'workspace-write'

check_for_update_on_startup = false
cli_auth_credentials_store = 'file'
suppress_unstable_features_warning = true

[agents]
max_depth = 1
max_threads = 6

[analytics]
enabled = false

[features]
multi_agent = true
runtime_metrics = true
undo = true

[sandbox_workspace_write]
writable_roots = ["/Users/limbo/.cache/uv"]

[tui]
status_line = [
  'model-with-reasoning',
  'project-root',
  'git-branch',
  'context-used',
  'total-input-tokens',
  'total-output-tokens',
  'session-id',
]
theme = "base16-eighties-dark"
your-diary · 4 months ago

My current workaround is this (simplified):

function codex() {
    __codex_automatically_trust_the_current_dir

    command codex "$@"
}

function __codex_automatically_trust_the_current_dir() {
    local key="[projects.\"$(pwd)\"]"

    if rg --quiet -F "${key}" ~/.codex/config.toml; then
        return
    fi

    echo "${key}" >> ~/.codex/config.toml
    echo 'trust_level = "trusted"' >> ~/.codex/config.toml
}

I don't want to do things like this though.

iwinux · 4 months ago

This is extremely annoying on macOS because of the stupid Homebrew design:

<img width="2922" height="496" alt="Image" src="https://github.com/user-attachments/assets/92a5e286-476a-4843-8de7-142419d45d90" />

johnslva · 4 months ago

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 · 4 months ago

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

milanglacier · 4 months ago

Any update on this? This is a serious regression. Please try to fix it ASAP.

samestep · 4 months ago

Same issue here. This is extra annoying because I my ~/.codex/config.toml is symlinked from Git, and so even when I do answer the prompt (which I don't want to have to do because that's why I use a VM and set approval_policy and sandbox_mode in config.toml in the first place), it dirties my local Git clone of my env repo.

vsevolod · 3 months ago

Proper configuration that allows working on the project without interruptions for changing each file.

# path-to_your-project/.codex/config.toml
approval_policy = "on-request"
sandbox_mode = "workspace-write"

[sandbox_workspace_write]
network_access = true
trust_level = "trusted"

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 · 3 months ago

I have been forced to use Codex CLI v0.112 for weeks because of this annoying bug.

arvinmi · 1 month ago

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 · 19 days ago

Are there any plans to address this issue? It’s been quite annoying for a long time.

csrutil · 18 days ago

Here’s a workaround I’m using to fix the issue:

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 {