Skip to content

codex upload ~/.codex/rules/default.rules even when sandbox_mode = "danger-full-access" #26575

Open

Description

@ninecc

What version of Codex CLI is running?

codex-cli 0.137.0

I would like to understand why codex includes the contents of ~/.codex/rules/default.rules as part of the model input.

// ~/.codex/rules/default.rules
// example
prefix_rule(pattern=["curl", "-L"], decision="allow")
prefix_rule(pattern=["node", "scripts/open-chrome-window.js"], decision="allow")
prefix_rule(pattern=["open", "-a"], decision="allow")
prefix_rule(pattern=["npm", "run", "build:wx"], decision="allow")
prefix_rule(pattern=["rtk", "mkdir"], decision="allow")
prefix_rule(pattern=["rtk", "cp"], decision="allow")
prefix_rule(pattern=["rtk", "git"], decision="allow")

Does the model need to rely on this file in order to generate commands with the correct permissions?

Why is this handled by providing the rules to the model, instead of enforcing the restrictions only at execution time?

input like:

<permissions instructions>
...

### Examples
...

## Approved command prefixes
The following prefix rules have already been approved: - ["rtk", "cp"]
- ["curl", "-L"]
- ["open", "-a"]
- ["rtk", "git"]
- ["rtk", "mkdir"]
- ["node", "scripts/open-chrome-window.js"]
- ["npm", "run", "build:wx"]
</permissions instructions>

In addition, even though I have already set:

sandbox_mode = "danger-full-access"

Codex still uploaded the contents of ~/.codex/rules/default.rules.

Could you clarify the intended behavior here? Is this expected, or should the rules file not be uploaded when full access mode is enabled?

Thanks.

Activity

  1. added
    CLIIssues related to the Codex CLI
    sandboxIssues related to permissions or sandboxing
    configIssues involving config.toml, config keys, config merging, or config updates
    on Jun 5, 2026
  2. changed the title [-]codex uploads ~/.codex/rules/default.rules even when sandbox_mode = "danger-full-access"[/-] [+]codex upload ~/.codex/rules/default.rules even when sandbox_mode = "danger-full-access"[/+] on Jun 5, 2026
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

    CLIIssues related to the Codex CLIbugSomething isn't workingconfigIssues involving config.toml, config keys, config merging, or config updatessandboxIssues related to permissions or sandboxing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions