codex - 💡(How to fix) Fix 0.135: default.rules prompt for git push is ignored under danger-full-access / granular rules=true

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

Codex should show an approval prompt because default.rules says decision = "prompt" for git push and granular rules = true is enabled.

Code Example

codex-cli 0.135.0

---

macOS arm64

---

# ~/.codex/config.toml
sandbox_mode = "danger-full-access"
approval_policy = { granular = { sandbox_approval = false, rules = true, mcp_elicitations = false, request_permissions = false, skill_approval = false } }
approvals_reviewer = "user"

---

// ~/.codex/rules/default.rules
prefix_rule(
    pattern = ["git", "push"],
    decision = "prompt",
    justification = "Publishing changes requires approval"
)

---

git push origin main

---

codex execpolicy check --pretty --rules ~/.codex/rules/default.rules -- git push origin main

---

{
  "matchedRules": [
    {
      "prefixRuleMatch": {
        "matchedPrefix": ["git", "push"],
        "decision": "prompt",
        "justification": "Publishing changes requires approval"
      }
    }
  ],
  "decision": "prompt"
}

---

Codex Doctor v0.135.0 · macos-aarch64
sandbox: filesystem unrestricted · network enabled
Configuration: sandbox unrestricted fs + enabled network · approval Granular(GranularApprovalConfig { sandbox_approval: false, rules: true, skill_approval: false, request_permissions: false, mcp_elicitations: false })
RAW_BUFFERClick to expand / collapse

What version of Codex are you using?

codex-cli 0.135.0

What platform are you using?

macOS arm64

What happened?

A default.rules prompt rule for git push was matched by codex execpolicy check, but the runtime allowed an agent-initiated git push origin main to run without an approval prompt.

This happened in a trusted project while using unrestricted filesystem/network access plus granular approval configuration with rules = true.

Relevant config

# ~/.codex/config.toml
sandbox_mode = "danger-full-access"
approval_policy = { granular = { sandbox_approval = false, rules = true, mcp_elicitations = false, request_permissions = false, skill_approval = false } }
approvals_reviewer = "user"
// ~/.codex/rules/default.rules
prefix_rule(
    pattern = ["git", "push"],
    decision = "prompt",
    justification = "Publishing changes requires approval"
)

Expected behavior

When the agent attempts to run:

git push origin main

Codex should show an approval prompt because default.rules says decision = "prompt" for git push and granular rules = true is enabled.

Actual behavior

The agent ran git push origin main and pushed successfully without an approval prompt.

The /permissions UI only showed coarse profiles: Default, Auto, and Full. It did not show whether ~/.codex/rules/default.rules was active, nor any custom/granular rules state.

Diagnostics

codex execpolicy check correctly reports prompt:

codex execpolicy check --pretty --rules ~/.codex/rules/default.rules -- git push origin main
{
  "matchedRules": [
    {
      "prefixRuleMatch": {
        "matchedPrefix": ["git", "push"],
        "decision": "prompt",
        "justification": "Publishing changes requires approval"
      }
    }
  ],
  "decision": "prompt"
}

codex doctor --summary --ascii reports:

Codex Doctor v0.135.0 · macos-aarch64
sandbox: filesystem unrestricted · network enabled
Configuration: sandbox unrestricted fs + enabled network · approval Granular(GranularApprovalConfig { sandbox_approval: false, rules: true, skill_approval: false, request_permissions: false, mcp_elicitations: false })

Notes

This looks related to the broader class of issues where execpolicy check, runtime command normalization, and the permissions UI do not fully agree, but I did not find an exact duplicate for the under-prompting case on macOS 0.135:

The direct rule appears valid; the issue is that the runtime path did not enforce the prompt despite execpolicy check returning prompt.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

When the agent attempts to run:

git push origin main

Codex should show an approval prompt because default.rules says decision = "prompt" for git push and granular rules = true is enabled.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix 0.135: default.rules prompt for git push is ignored under danger-full-access / granular rules=true