Repository navigation
Description
Versions: bb-app 0.50.1 (npm), Codex CLI 0.171.0, Linux x86_64. Admin-enforced /etc/codex/requirements.toml.
Two problems in the Codex provider. Each one overrides a sandbox restriction that the admin set in Codex's own configuration.
1. networkAccess: true is hard-coded in the workspace-write sandbox policy
server/dist/builtin-plugins/provider-codex/dist/host.js:135, toWorkspaceWriteCodexSandboxPolicy:
return {type:"workspaceWrite",writableRoots:[...e],networkAccess:!0,excludeTmpdirEnvVar:!1,excludeSlashTmp:!1}This goes out as turn/start params.sandboxPolicy on every workspace turn (host.js:146). An explicit per-turn policy overrides Codex's config, so a requirements profile with network off has no effect:
# /etc/codex/requirements.toml
default_permissions = "sandboxed"
[allowed_permission_profiles]
sandboxed = true
[permissions.sandboxed]
extends = ":workspace"
[permissions.sandboxed.network]
enabled = falseRepro
- Install the requirements above.
- Start a Codex thread with permission mode
accept-edits. - Ask it to run
curl -m5 -o /dev/null -w '%{http_code}' https://example.com. It prints200, and Codex reports "Network access is enabled".
The same command with Codex's own resolution (codex sandbox -- curl …, or command/exec sent to codex app-server with networkAccess:false) fails with Could not resolve host. If the client sends networkAccess:true, it returns 200.
Expected: don't send networkAccess unless the user asked for network. Leave it to Codex's config and requirements. Alternatively, add a provider or project setting such as "sandbox network: off".
2. Provider env contributions, including the Account Pooler token, go into shell_environment_policy.set
server/dist/builtin-plugins/account-pool/dist/server.js:236contributesCODEX_POOL_AUTH_TOKENto the codex provider env, and the same value again asBB_ACCOUNT_POOL_PARENT_TOKEN(markerEntries).provider-codex/dist/host.js:135,buildShellEnvironmentPolicyConfig, turns every thread env var intoconfig["shell_environment_policy.set.<NAME>"]. That config goes out inthread/start(host.js:141,:146).- Codex applies
setafterexcludeand its default*TOKEN*filter. So every sandboxed command gets the hub token in its environment, even withshell_environment_policy.excludeconfigured.
Repro: with the Account Pooler routing Codex, start a Codex thread and run env | grep -c TOKEN in it. The count is 2: CODEX_POOL_AUTH_TOKEN and BB_ACCOUNT_POOL_PARENT_TOKEN. Combined with issue 1, a command can send that token out.
Expected: don't put credentials in shell_environment_policy.set. The app-server already gets CODEX_POOL_AUTH_TOKEN in its own process env (host.js:144, appServerLaunchEnv), which is what env_http_headers reads for model calls. Commands don't need it. If some contributions must reach commands, let a contribution mark itself "app-server only".
Related note: login-shell PATH wins over the daemon's PATH when starting a provider
host-daemon/dist/daemon-bundle.mjs:71, searchPath, builds the provider's PATH as the login shell's PATH (from $SHELL -ilc /usr/bin/env, daemon-bundle.mjs:68) followed by the daemon's own inherited PATH. If an admin puts a wrapper directory first on the service's PATH to control which codex gets started, a user-level ~/.local/bin from the login profile still wins. Also, BB_CODEX_BRIDGE_APP_SERVER_COMMAND never reaches the provider bridge, because BB_* is stripped from its env. So there is no supported way to wrap the Codex binary. A documented provider setting for the app-server command, or putting the inherited PATH first, would help.
Activity
bb-slop-cop commentedon Nov 22, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotproviders,security, andprovider-codex; no existing classifications were replaced.partial-repro.networkAccess: true; provider environment entries are copied into both the app-server process environment andshell_environment_policy.set, including synthetic pool-authentication entries in the test.796cdcc0f4. The report includes the complete failing reproduction test. Existing Codex tests: 85 passed; focused pool/PATH tests and the full build also passed. Real Codex administrative-policy bypass and sandbox-command credential exposure remain unverified; no real credentials were used.Stop overriding Codex's shell_environment_policy with the thread env (#…
Respect Codex sandbox config for network access
Run Codex sessions under the admin's or user's custom permission profile