concepts/sandboxing.md +38 −1
21those commands inherit the same sandbox boundaries.21those commands inherit the same sandbox boundaries.
22 22
23Codex uses platform-native enforcement on each OS. The implementation differs23Codex uses platform-native enforcement on each OS. The implementation differs
2424between macOS, Linux, WSL, and native Windows, but the idea is the same acrossbetween macOS, Linux, WSL2, and native Windows, but the idea is the same across
25surfaces: give the agent a bounded place to work so routine tasks can run25surfaces: give the agent a bounded place to work so routine tasks can run
26autonomously inside clear limits.26autonomously inside clear limits.
27 27
36inside enforced limits. That makes it easier to let Codex work independently36inside enforced limits. That makes it easier to let Codex work independently
37while still knowing when it will stop and ask for help.37while still knowing when it will stop and ask for help.
38 38
39## Getting started
40
41Codex applies sandboxing automatically when you use the default permissions
42mode.
43
44### Prerequisites
45
46On **macOS**, sandboxing works out of the box using the built-in Seatbelt
47framework.
48
49On **Windows**, Codex uses the native [Windows
50sandbox](https://developers.openai.com/codex/windows#windows-sandbox) when you run in PowerShell and the
51Linux sandbox implementation when you run in WSL2.
52
53On **Linux and WSL2**, install `bubblewrap` with your package manager first:
54
55```bash
56sudo apt install bubblewrap
57```
58
59```bash
60sudo dnf install bubblewrap
61```
62
63Codex uses the first `bwrap` executable it finds on `PATH`. If no `bwrap`
64executable is available, Codex falls back to a bundled helper, but that helper
65requires unprivileged user namespaces. Installing your distro’s `bubblewrap`
66package keeps this setup reliable.
67
68Codex surfaces a startup warning when `bwrap` is missing or cannot create user
69namespaces. On distributions that restrict them with AppArmor, you can enable
70them with:
71
72```bash
73sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
74```
75
39## How you control it76## How you control it
40 77
41Most people start with the permissions controls in the product.78Most people start with the permissions controls in the product.