Before submitting
Area
apps/server
Steps to reproduce
- On a Linux T3 server, open Settings > Providers for that environment and set Codex "Launch arguments" to
-c sandbox_workspace_write.network_access=true.
- Start a new Codex thread in Auto mode.
- Ask the agent to run
gh api user --jq .login.
Expected behavior
The command runs inside the workspace-write sandbox with network access, because Codex is configured with sandbox_workspace_write.network_access = true.
Actual behavior
The sandbox has no network access. The command fails:
Get "https://api.github.com/user": proxyconnect tcp: dial tcp 127.0.0.1:43117: socket: operation not permitted
The Codex rollout for the turn records "sandbox_policy":{"type":"workspace-write","network_access":false,...}. The codex app-server process does have -c sandbox_workspace_write.network_access=true on its command line.
The thread starts with the correct policy. I sent the same thread/start request that T3 sends (sandbox: "workspace-write", approvalPolicy: "on-request") to a separate codex app-server started with the same -c argument. The response contained "networkAccess": true.
The value changes at the turn. buildTurnStartParams sends sandboxPolicy: runtimeModeToTurnSandboxPolicy(input.runtimeMode) on every turn. For Auto and Auto-accept-edits, that function returns { type: "workspaceWrite" } with no networkAccess field. Codex treats the missing field as false, and the turn policy replaces the thread policy that came from the configuration.
|
function runtimeModeToTurnSandboxPolicy( |
|
input: RuntimeMode, |
|
): EffectCodexSchema.V2TurnStartParams__SandboxPolicy { |
|
switch (input) { |
|
case "approval-required": |
|
return { |
|
type: "readOnly", |
|
}; |
|
case "auto-accept-edits": |
|
case "auto": |
|
return { |
|
type: "workspaceWrite", |
|
}; |
|
case "full-access": |
|
default: |
|
return { |
|
type: "dangerFullAccess", |
|
}; |
|
} |
|
} |
|
|
|
function buildCodexTurnInstructions(input: { |
|
readonly interactionMode?: ProviderInteractionMode; |
|
sandboxPolicy: runtimeModeToTurnSandboxPolicy(input.runtimeMode), |
As a result, the documented Codex setting and T3's own Launch arguments field have no effect in sandboxed modes. The only mode with network access is Full access, which removes the sandbox and all approvals. gh auth status also reports this failure as "The token in ... is invalid", which is misleading.
A possible fix is to build the turn policy from the thread's effective sandbox value, which thread/start returns, and change only its type. Another option is to send sandboxPolicy only when the runtime mode changes. Either option keeps the user's Codex settings for network access and writable roots.
Impact
Major degradation or frequent failure
Version or commit
T3 server 0.0.42; same code on main at 6391be2
Environment
T3 server on Debian 13 as a systemd user service; T3 desktop 0.0.42 on Windows as a remote client; Codex CLI 0.157.0; Auto mode
Logs or stack traces
Codex rollout turn_context for the failing turn:
"approval_policy": "on-request",
"approvals_reviewer": "auto_review",
"sandbox_policy": {"type": "workspace-write", "network_access": false, "exclude_tmpdir_env_var": false, "exclude_slash_tmp": false}
Screenshots, recordings, or supporting files
No response
Workaround
None in a sandboxed mode. Escalated commands can reach the network after approval.
Related: #6415, which asked for Codex sessions to inherit configured permission profiles and was moved to Discussions.
Before submitting
Area
apps/server
Steps to reproduce
-c sandbox_workspace_write.network_access=true.gh api user --jq .login.Expected behavior
The command runs inside the workspace-write sandbox with network access, because Codex is configured with
sandbox_workspace_write.network_access = true.Actual behavior
The sandbox has no network access. The command fails:
The Codex rollout for the turn records
"sandbox_policy":{"type":"workspace-write","network_access":false,...}. Thecodex app-serverprocess does have-c sandbox_workspace_write.network_access=trueon its command line.The thread starts with the correct policy. I sent the same
thread/startrequest that T3 sends (sandbox: "workspace-write",approvalPolicy: "on-request") to a separatecodex app-serverstarted with the same-cargument. The response contained"networkAccess": true.The value changes at the turn.
buildTurnStartParamssendssandboxPolicy: runtimeModeToTurnSandboxPolicy(input.runtimeMode)on every turn. For Auto and Auto-accept-edits, that function returns{ type: "workspaceWrite" }with nonetworkAccessfield. Codex treats the missing field asfalse, and the turn policy replaces the thread policy that came from the configuration.t3code/apps/server/src/provider/Layers/CodexSessionRuntime.ts
Lines 568 to 590 in 6391be2
t3code/apps/server/src/provider/Layers/CodexSessionRuntime.ts
Line 666 in 6391be2
As a result, the documented Codex setting and T3's own Launch arguments field have no effect in sandboxed modes. The only mode with network access is Full access, which removes the sandbox and all approvals.
gh auth statusalso reports this failure as "The token in ... is invalid", which is misleading.A possible fix is to build the turn policy from the thread's effective
sandboxvalue, whichthread/startreturns, and change only itstype. Another option is to sendsandboxPolicyonly when the runtime mode changes. Either option keeps the user's Codex settings for network access and writable roots.Impact
Major degradation or frequent failure
Version or commit
T3 server 0.0.42; same code on main at 6391be2
Environment
T3 server on Debian 13 as a systemd user service; T3 desktop 0.0.42 on Windows as a remote client; Codex CLI 0.157.0; Auto mode
Logs or stack traces
Codex rollout
turn_contextfor the failing turn:Screenshots, recordings, or supporting files
No response
Workaround
None in a sandboxed mode. Escalated commands can reach the network after approval.
Related: #6415, which asked for Codex sessions to inherit configured permission profiles and was moved to Discussions.