You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Exec approval rules are persisted globally by default (should be repo-local by default) #16167
Exec-policy approval rules are currently easy to persist globally (~/.codex/rules/default.rules) without users realizing the scope impact. This is a security footgun.
Problems
Rule persistence scope is effectively global unless explicitly handled otherwise.
Approval UX does not clearly communicate where the approved prefix rule will be written before user approval.
Proposal
Add config for rule write scope with secure default:
Overlap: both involve the pain of rules applying globally.
Distinction (this issue): this requests changing where newly approved rules are persisted by default (repo-local vs global) and improving approval-time disclosure of the destination path.
Distinction: that issue requests runtime/profile-level control over rule application after rules already exist.
If maintainers prefer, these can be merged into a single umbrella issue; this one focuses specifically on safer default persistence + clear UX disclosure.
changed the title [-]Default exec-policy approval rules to project-local scope, and surface write target in approval UX[/-][+]Exec approval rules are persisted globally by default (should be repo-local by default)[/+]on Mar 29, 2026
This is a really scary gap. I always thought approvals will be stored at repo level.
I have a personal repo where I have a task(Taskfile) which is ok to be run without approval because the side-effects are not harmful. So when working in that repo I allowed that approval to be persisted. In a different repo, Codex ran that task without any permission prompt. Weirdly that task didn't even exist in that repo. When I asked Codex why it ran that command, and whether it is listed as a possible task in repo docs, it said something like "I found out in global approval rules. So I thought it is available here".
Activity
github-actions commentedon Mar 29, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
[-]Default exec-policy approval rules to project-local scope, and surface write target in approval UX[/-][+]Exec approval rules are persisted globally by default (should be repo-local by default)[/+]etraut-openai commentedon May 16, 2026
This feature hasn't received enough upvotes, so closing.
sandipb commentedon Jul 16, 2026
This is a really scary gap. I always thought approvals will be stored at repo level.
I have a personal repo where I have a task(Taskfile) which is ok to be run without approval because the side-effects are not harmful. So when working in that repo I allowed that approval to be persisted. In a different repo, Codex ran that task without any permission prompt. Weirdly that task didn't even exist in that repo. When I asked Codex why it ran that command, and whether it is listed as a possible task in repo docs, it said something like "I found out in global approval rules. So I thought it is available here".