`-c` overrides: dotted-path parser has no TOML quoted-key support, so `projects."/path".trust_level` is silently misapplied
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
Research direction
Start in codex-rs/config/src/overrides.rs at apply_toml_override and reproduce the quoted and unquoted -c commands from the issue. Verify the change with paths containing quoted segments and dots; done means valid TOML-style paths apply to the canonical project key, or unsupported quoting is rejected instead of silently misapplying the override.
Written by the indexing model from the issue text.
Description
What version of Codex CLI is running?
codex-cli 0.144.6
What subscription do you have?
ChatGPT (logged in via codex login; not relevant to this bug)
Which model were you using?
gpt-5.6-luna (not relevant: config parsing bug, model-independent)
What platform is your computer?
macOS (Darwin 25.5.0, Apple Silicon)
What terminal emulator and version are you using (if applicable)?
n/a (headless codex exec)
What issue are you seeing?
-c key=value overrides use a naive dotted-path split (str::split('.')) with no support for TOML quoted key segments. A key like:
-c 'projects."/tmp/proj".trust_level="trusted"'
is split on every . and the quote characters are kept as literal key text, so the override is stored under a key segment that includes the quotes ("/tmp/proj" rather than /tmp/proj). Nothing errors: the setting is simply never matched against the canonicalized project path, so the project stays untrusted and its .codex/rules execpolicy files silently do not load.
The workaround is to omit the quotes (-c projects./tmp/proj.trust_level=trusted), which works because the naive split then happens to produce the right segments. But that only works for paths containing no dots. A corollary of the same parser: any key whose segment legitimately contains a . (e.g. a project path like /Users/me/my.project) cannot be addressed from -c at all.
Relevant code: apply_toml_override in codex-rs/config/src/overrides.rs, which does path.split('.') with no quote handling.
What steps can reproduce the bug?
- Create a project dir
/tmp/projcontaining: a.gitdirectory; an executablestep.shthat appends a line to/tmp/proj/file.txt; and.codex/rules/allow.rulescontaining:prefix_rule(pattern = ["/tmp/proj/step.sh"], decision = "allow") - From inside
/tmp/proj, run:
The script runs inside the read-only sandbox and its write is denied: the trust override did not apply, so the project rules never loaded and thecodex exec --skip-git-repo-check -s read-only -c approval_policy=never \ -c 'projects."/tmp/proj".trust_level="trusted"' \ 'Run exactly this command: /tmp/proj/step.sh'allowrule could not grant the sandbox bypass. - Re-run with the unquoted spelling:
Now the rules load, the allow rule matches, and the script's write succeeds.codex exec --skip-git-repo-check -s read-only -c approval_policy=never \ -c projects./tmp/proj.trust_level=trusted \ 'Run exactly this command: /tmp/proj/step.sh'
codex execpolicy check --rules /tmp/proj/.codex/rules/allow.rules /tmp/proj/step.sh confirms the rule itself is fine ("decision":"allow"), isolating the failure to the -c key parsing.
What is the expected behavior?
Either parse dotted -c paths with TOML key semantics (so quoted segments work, matching how the same key must be written in config.toml), or reject keys containing quote characters with an error. The current behavior accepts the override and silently misapplies it, which is the worst of both: the user has written the spelling that works in config.toml, gets no diagnostic, and the resulting misconfiguration (rules not loading) is invisible until a downstream permission check behaves unexpectedly.
Additional information
This issue was authored by an AI assistant under the supervision of Jeremy Howard, who reviewed it.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.5k
- Avg merge
- 1m
- Merged PRs (30d)
- 1k
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openai/codex
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
bug CLI windows-os
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
macOS sandbox blocks hw.optional.arm64 sysctl, causing Flutter to misdetect Apple Silicon as x64 Openbug CLI sandbox
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug CLI TUI
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
CLI config enhancement skills
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
A-linter
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
oxc-project/oxc#26863 ·