Any filesystem deny rule prevents exiting the sandbox after approval

Open
#33,349 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
58/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
rust
Domain
cli, security

Research direction

Start with codex-rs/core/src/tools/sandboxing.rs around lines 250-307 and reproduce the issue using a permissions profile with a deny rule, then approve escalation for access to that path. Trace how the deny rule affects the transition out of the sandbox. Done means escalation behaves as intended and the behavior is covered by a regression check.

Written by the indexing model from the issue text.

Description

bug CLI sandbox
What issue are you seeing?

When the current permission profile contains any deny rule, codex will not exit the sandbox after asking for approval. This makes escalation basically useless.

This is not documented at https://learn.chatgpt.com/docs/permissions

What steps can reproduce the bug?
  • Use some profile of the new permissions that uses deny on some paths
  • Tell codex to access that path, e.g. with ls
  • Approve escalation to run out of sandbox
What is the expected behavior?

Deny rules should not be so special cased.

If the behaviour "deny always, even after escalation" is required, maybe:

  • add a new keyword
  • allow specifying which profile codex can escalate TO, so that even the escalated profile could still deny some paths.
Additional information

https://github.com/openai/codex/blob/rust-v0.144.2/codex-rs/core/src/tools/sandboxing.rs#L250-L307

Dominant language
Rust
Stars
125k
Forks
19.5k
Avg merge
1m
Merged PRs (30d)
1k

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openai/codex

All issues in openai/codex

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.