Skip to content

Allow trust_level = "trusted" for any projects #14599

Closed as not planned
Closed as not planned

Description

@milanglacier

What variant of Codex are you using?

CLI

What feature would you like to see?

Upon initially opening a project, Codex requires manual approval. This recurring prompt can be quite inconvenient.

Feature Request: Please add a new configuration option that allows setting trusted_level = 'trusted' globally for all projects.

Additional information

No response

Activity

  1. added
    enhancement
    on Mar 13, 2026
  2. added
    CLI
    safety-check
    on Mar 13, 2026
  3. added
    TUI
    and removed
    CLI
    safety-check
    on Mar 13, 2026
  4. keramblock commented on Mar 16, 2026

    @keramblock

    that probably should work by glob(/opt/projects/* or /* is user feels risky), not just allow_anything = true

  5. mserajnik commented on Mar 16, 2026

    @mserajnik

    I would like to see this too, although for a different reason: the absolute paths to trusted projects are currently added to ~/.codex/config.toml, which means if this file is committed to a public dotfiles repo (a reasonable thing someone might want to do) it leaks the project directory names (which can obviously be undesirable).

    I agree with keramblock that a glob/wildcard approach would probably be the best solution here. E.g.:

    [projects."/home/user/code/*"]
    trust_level = "trusted"
  6. samestep commented on Mar 19, 2026

    @samestep

    Am I correct in understanding that the trust level is specifically for enabling/disabling project-specific .codex configs to be merged with user-global ~/.codex configs when working in that directory? In that case, since I don't need or want project-specific configs anyway, I'd want to be able to do the opposite of what's requested in this issue, i.e. to mark every directory as untrusted instead of trusted. (This is assuming that trust_level is separate from approval_policy and sandbox_mode, which I do want set permissively.)

  7. samestep commented on Mar 20, 2026

    @samestep

    In case anyone finds it useful, as a stopgap solution I'm using a wrapper script like this to achieve the same effect until OpenAI implements this sort of glob config:

    import json
    import os
    import sys
    from pathlib import Path
    
    
    def main() -> None:
        project = json.dumps(str(Path.cwd()))
        config = f'projects={{{project}={{trust_level="trusted"}}}}'
        os.execvp("codex", ["codex", "-c", config, *sys.argv[1:]])
    
    
    if __name__ == "__main__":
        main()
  8. milanglacier commented on Mar 27, 2026

    @milanglacier
    Author

    No updates on this? This is a severe regression that has not been fixed for over3 weeks.

  9. etraut-openai commented on Mar 27, 2026

    @etraut-openai
    Contributor

    @milanglacier, this isn't a regression. It's a feature request. We prioritize feature requests based on community inputs (upvotes). This one has received some upvotes, but there are many features ahead of it in the queue.

  10. milanglacier commented on Mar 27, 2026

    @milanglacier
    Author

    @milanglacier, this isn't a regression. It's a feature request. We prioritize feature requests based on community inputs (upvotes). This one has received some upvotes, but there are many features ahead of it in the queue.

    This is a regression according to #14345.
    While the scope of this issue and #14345 is different, and developers can solve the two issues in different ways. But essentially they are pointing to the same aspect of bad user experience that codex users have been facing since the release of v0.113.

  11. DanteMarshal commented on Jul 16, 2026

    @DanteMarshal

    I would like to see this too, although for a different reason: the absolute paths to trusted projects are currently added to ~/.codex/config.toml, which means if this file is committed to a public dotfiles repo (a reasonable thing someone might want to do) it leaks the project directory names (which can obviously be undesirable).

    I agree with keramblock that a glob/wildcard approach would probably be the best solution here. E.g.:

    [projects."/home/user/code/*"]
    trust_level = "trusted"

    This is exactly why I happened to find this issue.

    Any updates people ?

  12. etraut-openai commented on Aug 4, 2026

    @etraut-openai
    Contributor

    We've decided to make all directories trusted by default unless you are using :read-only permissions. This makes the CLI (TUI) consistent with the desktop app's behavior. This will be included in the next release.

  13. smileBeda commented on Aug 7, 2026

    @smileBeda

    Every tool with such power (or way less) asks whether you trust the code or folder you’re about to work with. Visual Studio Code - an industry leader in "working with stuff that is in a folder" - is a good example.

    Defaulting to trusting every folder in which someone runs codex will inevitably lead to people running it from ~/ or, worse, from somewhere containing sensitive files they never intended Codex to access.

    Is that really the security tradeoff we want to make, just to save users two keystrokes?

    A trust prompt is a tiny amount of friction at exactly the point where a little friction is valuable.

  14. etraut-openai commented on Aug 7, 2026

    @etraut-openai
    Contributor

    @smileBeda, agree. After further internal discussion, we've decided not to move forward with this change. Reopening this issue.

  15. smileBeda commented on Aug 7, 2026

    @smileBeda

    Phew.


    A companion on Discord mentioned that allowing wildcards would be a solution they'd prefer, and that would also be safe in the sense that it doesn't amount to a blanket allowance.

    In short, they propose allowing something like:

    [allowed_dirs]
    /path/to/dir/*
    

    This would trust all directories inside /path/to/dir/, but not /path/to/dir/ itself, its parent directories, or its siblings.
    That would satisfy both the "we cannot bear to tap once to allow trust" faction and the "we cannot bear to just let Codex spin its wheels wherever it wants" faction.

    PS:

    If YOLO mode is actually asking for those confirmations (did not confirm, I am not using YOLO), then I would consider that indeed a BUG - but for YOLO mode only 😅

  16. samestep commented on Aug 7, 2026

    @samestep

    Every tool with such power (or way less) asks whether you trust the code or folder you’re about to work with. Visual Studio Code - an industry leader in "working with stuff that is in a folder" - is a good example.

    Not everyone agrees VS Code is a good example to copy here. For instance, this security researcher criticized the VS Code popup by saying that it "is just noise and desensitizes the user to the real underlying security threat": https://news.ycombinator.com/item?id=46725548

    If YOLO mode is actually asking for those confirmations (did not confirm, I am not using YOLO), then I would consider that indeed a BUG - but for YOLO mode only 😅

    That is in fact exactly the behavior, which is why people complained about this in the first place:

  17. smileBeda commented on Aug 7, 2026

    @smileBeda

    That is in fact exactly the behavior, which is why people complained about this in the first place:

    On that ticket, this one here is about a global blanket trust. And that is for described reasons a bad idea. It is obviously enough not a good idea to just let codex run in any dir without first approving it, this is not even about "trust this directory content", but "trust codex to read this directory" to start with.
    Yes, it technically still could somehow escape, but we do not need to make it easier, right?

    The proposed wildcards (or even the more hammer-like OP original proposal) would solve the gripe people have expressed here, which is not about YOLO being not full YOLO.

  18. samestep commented on Aug 7, 2026

    @samestep

    All I'm pointing out is that the thing you said you would agree is a bug is indeed the case.

  19. DanteMarshal commented on Aug 8, 2026

    @DanteMarshal

    Visual Studio Code - an industry leader in "working with stuff that is in a folder" - is a good example.

    Then at least we should use that example fully, VS Code has "security.workspace.trust.enabled" setting which allows users to fully disable the annoyance.
    I think the ones who don't like this feature are fine with having to manually turn it off once and for all in their settings, I'm fine with that.

  20. milanglacier commented on Aug 8, 2026

    @milanglacier
    Author

    @smileBeda, agree. After further internal discussion, we've decided not to move forward with this change. Reopening this issue.

    This is also related to: #14601

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    TUIenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions