The sandbox limits what a process can touch; the approval policy decides when Codex must ask before crossing that boundary.
The decision behind the technique
Treating both controls as one setting leads either to needless interruptions or overly broad access. A normal repository task usually needs workspace writes while keeping external or destructive actions gated.
The sandbox limits what a process can touch; the approval policy decides when Codex must ask before crossing that boundary.
A practical step-by-step workflow
Use this sequence as a default, then tighten or expand it only when the evidence changes.
- Define the files and networks the task genuinely needs
- Use the narrowest sandbox that still permits normal work
- Require approval for external writes, installations and risky commands
- Review any reusable approval rule before accepting it
Failure boundary and finish line
Approval is not a substitute for a safe target; a destructive command remains dangerous after approval.
Finish when the configuration is smaller, reproducible and still preserves every required safety boundary.
Frequently asked questions
What should I do first?+
Define the files and networks the task genuinely needs
What is the main failure mode?+
Approval is not a substitute for a safe target; a destructive command remains dangerous after approval.
OFFICIAL SOURCES
Verify against the source
OpenAI sandboxing guidanceThis guide provides general information, not an OpenAI allowance promise or support decision. Your account and official pages govern actual usage, benefits and recovery times.