GuidesHosting choices

Codex exec "Untrusted project-local configuration is disabled"

Why codex exec skips a project's .codex config, MCP servers and hooks since 0.169.0, what --trust saves and where, and when not to trust a repository.

November 19, 2026The Everpod team
The short answer

Since Codex 0.169.0 (November 13, 2026), codex exec ignores a project’s own .codex/ folder (its config.toml, its MCP servers, its hooks and rules) until that project is trusted, and prints this warning instead of running with it. If you wrote the repository and want its settings, run the job once with codex exec --trust. That saves a trust_level = "trusted" entry under [projects."<path>"] in your user config, ~/.codex/config.toml, and every later run in that project loads its settings without the flag. Do not trust a repository you did not write: its MCP servers can run commands outside Codex’s sandbox.

The full message, as the exec source at 0.170.0 prints it to stderr:

warning: Untrusted project-local configuration is disabled. Run `codex exec --trust` to allow project configuration and MCP servers for this and future chats in the project, including MCP commands outside the sandbox. Explicitly untrusted projects must have their trust setting updated first.
Copied

What changed in 0.169.0

Codex has long kept project-level configuration behind a trust decision. The configuration reference puts it as “Untrusted projects skip project-scoped .codex/ layers, including project-local config, hooks, and rules.” An interactive codex session asks you when you open a folder and saves your answer; codex exec never asks anything. The change in 0.169.0 applies the rule to non-interactive runs whatever the sandbox setting, says so with this warning, and adds a way to grant trust from the command line. Its release note: “codex exec keeps project configuration and MCP servers disabled in untrusted directories”, even with --sandbox workspace-write, and “Use --trust with codex exec or codex review to explicitly save project trust.”

What is affected is only the project’s layer: every .codex/config.toml Codex finds walking from the project root (by default the folder holding .git) down to the working directory, with the MCP servers, hooks and rules defined there. Your own ~/.codex/config.toml, and the MCP servers and hooks in it, load either way; OpenAI’s advanced configuration page says “User and system layers remain separate and still load.” So a job that seems to have lost its model choice, its MCP tools or a hook after an update is most likely reading only the user layer now.

Trusting a project for scheduled runs

Run the job once, by hand or as it is scheduled, with --trust:

cd /srv/app
codex exec --trust --sandbox workspace-write "run the nightly checks"
Copied

Per the flag’s own help, it will “Save trust for this project and future chats, including MCP commands outside the sandbox. Persists even with --ephemeral. Does not override an explicitly untrusted project.” In the source, a project with no saved decision gets trust_level set to trusted in the user config, a project already trusted is left alone, and one marked untrusted stops the run. Leaving --trust in the job’s command line is therefore harmless, and on a CI runner that starts from a clean home folder each time, where nothing saved survives, it is how every run gets the project’s settings.

Afterwards the entry is in ~/.codex/config.toml (more exactly, $CODEX_HOME/config.toml):

grep -A1 '^\[projects' ~/.codex/config.toml
Copied

Two consequences for unattended jobs follow from where it is saved. The trust belongs to one account and one CODEX_HOME: trust granted as yourself does nothing for a job that runs as another user, under root, or with CODEX_HOME pointed elsewhere, so grant it as the account and environment the job actually uses (the cron and service pitfalls in running Codex on a Linux server apply here too). And a project trusted in an interactive session counts for exec as well; the interactive prompt applies trust to the Git repository root even when you start in a subfolder.

You can also write the entry yourself. The reference documents the key as projects.<path>.trust_level, “"trusted" | "untrusted"”:

[projects."/srv/app"]
trust_level = "trusted"
Copied

Which path exec looks up for a project started from a subfolder is not spelled out in OpenAI’s documentation, so letting --trust write the entry and reading what it wrote is the reliable way to get it right.

“is marked as untrusted. Update its trust setting first.”

The full form is <path> is marked as untrusted. Update its trust setting first. Someone, possibly you at an interactive prompt, recorded trust_level = "untrusted" for this project, and --trust deliberately does not overturn that. If the decision was a mistake, change that entry in ~/.codex/config.toml to "trusted" (or delete it and run with --trust). If it was not a mistake, the project stays untrusted and its own configuration stays off: move what the job needs into your user config instead.

“--trust cannot be combined with --ignore-user-config”

The whole message is “--trust cannot be combined with --ignore-user-config: saved project trust decisions must be checked”. --ignore-user-config tells Codex not to read $CODEX_HOME/config.toml, and that file is where trust decisions live, so Codex cannot check whether the project was marked untrusted or save the new decision. Drop one of the two flags. If you used --ignore-user-config to keep a job independent of your personal settings, the alternative is a separate CODEX_HOME for the job, with its own small config.toml holding the trust entry.

Hooks can stay off after the project is trusted

Hooks have a second gate of their own. OpenAI’s hooks documentation: “Before a non-managed hook can run, Codex requires you to review and trust the exact hook definition.” That trust is recorded against the hook’s current hash, so a new or edited hook needs reviewing again. You review hooks in an interactive session with /hooks; open codex in the project once, as the account the job runs under, and trust them there.

In exec the skip is easy to miss. A user report on Codex 0.169.0, openai/codex#61741, shows hooks waiting for review printed only as hook: SessionStart Failed, with no reason given, and openai/codex#46210, still open, tracks hooks waiting for trust being skipped in exec with no diagnostic. The documented --dangerously-bypass-hook-trust runs hooks without review, and OpenAI describes it for “one-off automation that already vets hook sources outside Codex”; it is not a substitute for reviewing hooks in a repository you did not write.

When not to trust a project

Trust is not a formality. OpenAI’s non-interactive mode page warns that “Project-defined MCP servers can run commands outside the sandbox”, and Codex’s own trust prompt says “Folder settings can run code automatically, even without a model request.” A trusted .codex/config.toml can name any program as an MCP server, and Codex starts it as you, outside the bubblewrap sandbox that bounds the model’s own commands. So:

The warning on its own is harmless: the run goes ahead with your user settings. If the job already does what you want without the project’s configuration, there is nothing to fix.

Not this message: “Not inside a trusted directory”

Not inside a trusted directory and --skip-git-repo-check was not specified. is a different, older check, and despite the wording it is about Git, not the trust setting: codex exec refuses to start outside a Git repository. Run it inside one, or add --skip-git-repo-check if the directory is meant to be outside one. It exits rather than warning. For the rest of a scheduled Codex job (sign-in, timeouts, output), see running a coding agent headless on a schedule, which has a Codex section.

Run Codex on an always-on developer pod.

A developer pod is a permanent cloud computer (VPS), set up and secured for you, with your pick of Claude Code, Codex, OpenCode, Pi, Hermes and OpenClaw installed. Run more agents at once than your laptop can hold, and keep them working when it’s closed. From $24 a month, built in about ten minutes.